First steps in Lean
Warm-upFormalLet n : ℕ be a variable. Which of these goals can be closed by rfl alone? (Choose all that apply.)
Let n : ℕ be a variable. Which of these goals can be closed by rfl alone? (Choose all that apply.)
A classmate's Lean file compiles with the warning "declaration uses sorry". What can you conclude?
In Lean, what is the value of (7 : ℕ) - 10?
In Lean, what is the value of (17 : ℕ) / 5?
You are proving theorem t (p q : Prop) : p → (q → p) := by and you type intro hp. What does the goal state look like now?
Which term is a proof of p ∧ q → q ∧ p?
The theorem no_nat_sqrt_two : ¬ ∃ q : ℕ, q * q = 2 is proved in Lean without sorry. Does it show that is irrational?
Mathlib contains theorem Nat.exists_infinite_primes (n : ℕ) : ∃ p, n ≤ p ∧ Nat.Prime p. Which reading is correct?
In the induction proof of 0 + n = n, the inductive step has hypothesis ih : 0 + k = k and goal ⊢ 0 + (k + 1) = k + 1. Which tactic line closes the goal?
Truth tables decide propositional tautologies by brute force. Write is_tautology(formula, n), where formula is a Python function of n Booleans, returning True exactly when it is true for all assignments. (In Python, p <= q on Booleans means .)