Questions tagged [lean]

Lean is an open source theorem prover being developed at Microsoft Research, with a monolothic standard library developed collaboratively. The Lean Theorem Prover aims to bridge the gap between interactive and automated theorem proving. There are two main versions available; Lean 3 and Lean 4, with similar designs but different syntax.

Resources:

169 questions
0
votes
1 answer

Trying to install lean in ubuntu

I got the following error and I don't know how to fix this issue. m0nst3r@m0nst3r-G3:~/logical_verification_2019$ leanpkg configure leanpkg: command not found m0nst3r@m0nst3r-G3:~/logical_verification_2019$ kindly help with this. I tried pulling…
0
votes
0 answers

TPIL 4.4: example : ¬ (∃ x, ¬ p x) → (∀ x, p x)

Section 4.4 of Theorem Proving in Lean shows the following: example : (∀ x, p x) ↔ ¬ (∃ x, ¬ p x) := sorry Here I'll focus on the right-to-left case: ¬ (∃ x, ¬ p x) → (∀ x, p x) Approach 1 We know that we'll have a parameter of type ¬ (∃ x, ¬ p x)…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
0
votes
1 answer

example : ((p ∨ q) → r) → (p → r) ∧ (q → r)

Section 3.6 of Theorem Proving in Lean shows the following: example : ((p ∨ q) → r) ↔ (p → r) ∧ (q → r) := sorry Let's focus on the left-to-right direction: example : ((p ∨ q) → r) → (p → r) ∧ (q → r) := sorry What's a good way to structure this…
dharmatech
  • 8,979
  • 8
  • 42
  • 88
0
votes
1 answer

How to switch to HoTT-mode for Lean 2 in Emacs

I compiled Lean 2 from the github repository. Then, as instructed in scr/emacs/README.md, I modified my .emacs file, opened a file, clicked on 'Create new project', clicked on 'Open', typed 'hott' and pressed Enter. Then I typed print…
0
votes
1 answer

How to simplify a proof by induction in Lean?

I'd like to simplify a proof by induction in Lean. I've defined an inductive type with 3 constructors in Lean and a binary relation on this type. I've included the axioms because Lean wouldn't let me have them as constructors for rel. inductive…
LyX2394
  • 121
  • 1
  • 5
0
votes
1 answer

How to remove a universal quantifier in Lean?

I am working with two binary relations: g_o and pw_o, and I've defined pw_o below: constants {A : Type} (g_o : A → A → Prop) def pw_o (x y : A) : Prop := ∀ w : A, (g_o w x → g_o w y) ∧ (g_o y w → g_o x w) I need to prove the following: theorem…
LyX2394
  • 121
  • 1
  • 5
0
votes
1 answer

Does lean have syntax for declaration of signatures?

I've looked but haven't found any mechanism described in the documentation which allows you to describe a section by it's signature. For example, in the section below the syntax of def requires the right hand side (here sorry) section variable A :…
matt
  • 5,364
  • 1
  • 25
  • 25
0
votes
1 answer

Why am I getting "Symbol's value as a variable is void: ..." when trying to set lean-rootdir?

I downloaded lean for Linux on Ubuntu, extracted it, installed Emacs, installed lean-mode and company-lean via MELPA, it's complaining that the lean-rootdir variable is not set. When I try to set it, I get the error in the title.
user
  • 2,345
  • 3
  • 12
  • 14
0
votes
0 answers

VS code `\` underlining for insufficiently long

I am using Lean, an open source theorem prover and programming language on VS Code. Lots of commands require '\' to write math symbols, in the same way that LaTeX does. The essential difference between Lean on VS Code and LaTeX is that in order to…
0
votes
0 answers

Proving property of recursive function

Trying to prove that a sum of positive numbers is positive. -- some function variable {w : nat -> int} -- sum of w's from 0 to i def sw : nat -> int | 0 := w 0 | (i+1) := sw i + w (i+1) -- w is always positive axiom w_pos : ∀ i : nat, 0 < w…
Valéry
  • 4,574
  • 1
  • 14
  • 25
0
votes
1 answer

How to leave out a part of programming code, in a programming code quote?

How to leave out a part of programming code, in a programming code quote? In particular I have the following code snippet (from the Lean proof assistant): def single (a : α) (b : β) : α →₀ β := ⟨λa', if a = a' then b else 0, finite_subset…
Jens Wagemaker
  • 354
  • 3
  • 13
0
votes
1 answer

Representing a theorem with multiple hypotheses in Lean (propositional logic)

Real beginners question here. How do I represent a problem with multiple hypotheses in Lean? For example: Given A A→B A→C B→D C→D Prove the proposition D. (Problem taken from The Incredible Proof Machine, Session 2 problem 3. I was actually…
Antony
  • 450
  • 1
  • 4
  • 15
0
votes
1 answer

Why doesn't this dual poset definition don't type check

I created the following poset definition, the dual definition doesn't type check for antisymmetry. I am not sure how to make it work, any suggestions? structure Poset {α : Type} (leq : α → (α → Prop)) := mkPoset :: (reflexive: (∀x : α, (leq x…
0
votes
0 answers

Adjusting dependently typed function spaces

Suppose we have the following definition that represents a bounded integer in clopen interval
ScarletAmaranth
  • 5,065
  • 2
  • 23
  • 34
0
votes
1 answer

Painless way to show simple inequality over whole number

I have the following state: a : ℕ, a_1 : ℕ, nltm : of_nat a_1 + 1 < of_nat a + 1 ⊢ of_nat a_1 < of_nat a Do note that of_nat constructs Z. Is there a painless way of discharging the goal?
ScarletAmaranth
  • 5,065
  • 2
  • 23
  • 34
1 2 3
11
12