Why does "intuition" work on the example of Coq?

My question is: why does "intuition" work in my example?

I'm trying to prove

Lemma eqb_false : forall n m : nat, eqb n m = false -> n <> m.

In the last step I see

n : nat
IHn : forall m : nat, (n =? m) = false -> n <> m
m : nat
IHm : (S n =? m) = false -> S n <> m
============================
 (n =? m) = false -> S n <> S m

Then 'intuition' / 'firstorder' / 'auto' all work on the current target.

But why do they work? The Coq manual says that they will do some search work. Does this mean that it can be rewritten using other simple tactics?

Thank!

EDIT: You can see that I applied induction on n and m in the proof above. According to @Vinz's answer, he does not need to carry out such an induction process. introsin the first step and introfor the purpose n <> m, he will give rise to a contradictory hypothesis for H.

+4
source share
1 answer

intuition, firstorder auto , , .

Coq info intuition, script, , . , . Show Proof intuition , .

, S n = S m , injection , n = m , (n =? m) = false.

EDIT xywang: A <> B A = B -> False. intros P1 -> ... Pn -> A <> B, n+1 ( +1). , :

=============================
 P -> Q -> A <> B

intros p q eqAB.,

p : P
q : Q
eqAB : A = B
=============================
False
+6

All Articles