1

While using ssreflect in the following lemma:

From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype.

Lemma nat_dec n m: (m <= n) -> (~~ (m <= n)) -> False.
Proof.
  intros A notA.
  (* auto. *)
  red in A.
  red in notA.
  (* auto. *)
  rewrite -> A in notA.
  auto.
Qed.

May I ask why those autos, that I commented out, do not work at those proof states? as it seems to me that these states already observe contradiction in the context.

And is there some automation by ssreflect to prove this lemma?

Zheng Cheng
  • 389
  • 2
  • 11

1 Answers1

4

I think if you remove some notations and the coercions you get a clearer view of what is going on in this goal:

Lemma nat_dec n m: (m <= n = true) -> (negb (m <= n) = true) -> False.

In particular, auto doesn't work as it is not powerful enough to reason about the behavior of negb. However, when you rewrite, your goal becomes:

Lemma nat_dec n m: (m <= n = true) -> (negb true = true) -> False.

so after simplification, false = true is in the context and auto can indeed close the goal.

ejgallego
  • 6,709
  • 1
  • 14
  • 29