See which 'same statement' the kernel accepts
Renamed variables and unfolded notation bind; a logically equivalent statement and a weaker one do not.
There are at least five things “these two statements are the same” could mean, from equal text to meaning the same thing. The laboratory’s binding check asks Lean to accept a declaration as a proof of the pinned statement: that checks definitional equality, and nothing weaker. This core-Lean file shows where that line falls.
Run it
Save this as statement_identity.lean and run lean statement_identity.lean with Lean 4.35.0 (core Lean only, no Mathlib), or paste it into the Lean 4 web editor at live.lean-lang.org
.
-- Statement identity: what the binding check accepts, and what it does not (core Lean 4).
theorem proved : ∀ n : Nat, 0 + n = n := fun n => Nat.zero_add n
-- 1-3. Bound variables renamed, or notation unfolded: definitionally the same. Accepted.
example : ∀ m : Nat, 0 + m = m := proved
example : ∀ k : Nat, Nat.add 0 k = k := proved
-- 4. Logically equivalent, but only with a proof: the binding check refuses it.
theorem exists_nonzero : ∃ n : Nat, n ≠ 0 := ⟨1, by decide⟩
example : ¬ ∀ n : Nat, n = 0 := exists_nonzero
-- The equivalence is a theorem in its own right, not something the binding sees.
example : ¬ ∀ n : Nat, n = 0 := fun h => absurd (h 1) (by decide)
-- 5. A weaker statement is a different statement. Refused.
theorem small_only : ∀ n : Nat, n ≤ 10 → 0 + n = n := fun n _ => Nat.zero_add n
example : ∀ n : Nat, 0 + n = n := small_onlyExpected outcome
statement_identity.lean:11:32: error: Type mismatch
exists_nonzero
has type
∃ n, n ≠ 0
but is expected to have type
¬∀ (n : Nat), n = 0
statement_identity.lean:18:34: error: Type mismatch
small_only
has type
∀ (n : Nat), n ≤ 10 → 0 + n = n
but is expected to have type
∀ (n : Nat), 0 + n = nRenaming the bound variable, or writing Nat.add 0 k for 0 + k, is
definitionally the same statement, and the binding is accepted silently. A
proof of ∃ n, n ≠ 0 is not accepted as a proof of ¬ ∀ n, n = 0, although
the two are equivalent: that needs a proof, given on the next line. A weaker
statement is refused. The two errors are the expected output.
Mechanism and limitations
Documented: Chapter 22 of the book sets out the mathematics; this program is a self-contained demonstration of it, not one of the laboratory’s recorded investigations.
Observed: the output above, produced by running the program exactly as shown.
Not shown:
- Logical equivalence is deliberately not attempted by the binding check; it would need a proof for each pair.
- Whether a statement means what the claim says (the fifth sense) is the correspondence, which only a person can approve.
Related worked example: Chapter 5 .
Challenge this result
Copy this into the AI assistant of your choice, or work through it yourself. Check any finding against the recorded evidence.
Examine each binding in the file and classify it by the five senses of "the
same statement". Predict which Lean accepts, then run it. Find two statements
that are definitionally equal but would look different to a reader, and two
that look the same but are not definitionally equal.
Chapter: https://programmer.ie/books/math/22-chapter/
Example: https://programmer.ie/examples/math/22-chapter/
Program: https://github.com/ernanhughes/math/blob/main/notebooks/math/programs/22-statement-identity.lean
Distinguish what the record shows from what you infer. If you cannot open a link, ask me for the material; do not invent it.Canonical source and the program .
Understand this example
Copy this prompt into your AI tool. No code runs here.
Apply this example
Copy this prompt into your AI tool. No code runs here.