Using Lean, the computer proof checking system.
The first of these proofs succeeds, the second does not.
variables n m : nat
theorem works (h1 : n = m) (h2 : 0 < n) : (0 < m) :=
eq.subst h1 h2
theorem nowrk (h3 : n = 0) (h4 : 0 < n) : (0 < 0) :=
eq.subst h3 h4
The error occurs in the eq.subst
and is the following:
"eliminator" elaborator type mismatch, term
h4
has type
0 < n
but is expected to have type
n < n
[and then some additional information]
I don't understand the error message. I tried various obvious permutations in the hypotheses like 0 = n or n > 0, but I couldn't get it to work, or to produce an error message which I could understand.
Can anyone clarify? I read the part of Theorem Proving In Lean about congr_arg
etc but these other commands didn't help me.