I have a hypothesis that is clearly wrong and I would like to use that to prove False. In this case I have Hx: 0 * 0 = 2
and I have False
in my goal. How would I start to do it?

- 1,209
- 3
- 11
- 22

- 11
- 1
-
1`trivial` should work – Edward Z. Yang Mar 28 '21 at 22:35
-
Another solution: `discriminate` (as in this post: https://stackoverflow.com/questions/66842087/how-to-deal-with-false-true-proposition-while-proving-theorems-in-coq/66869782#66869782) – Cyril Mar 30 '21 at 11:24
5 Answers
You can use the easy
tactic:
Goal 0 * 0 = 2 -> False. Proof. easy. Qed.

- 23,012
- 3
- 33
- 39
A manual approach, for completeness:
Goal 0 * 0 = 2 -> False.
Proof.
intro H.
inversion H.
Qed.
(Disclaimer: I'm a relative beginner at Coq myself, so apologies if I get any details incorrect—please let me know so I can improve the answer!)
This works because 0 * 0 = 2
evaluates to 0 = 2
, and inverting that hypothesis breaks it down into its different possible constructors (like a smarter version of destruct
). The only possible constructor for eq
is eq_refl : forall a, a = a
. So, Coq realizes that eq_refl
is the only possible constructor that could have been used to make a hypothesis of the form 0 = 2
. As such, Coq will try to find the value of a
, as part of the inversion process. But, applying this to 0 = 2
, it gets x = 0
and x = 2
! Because 0 = O
and 2 = S (S O)
are made up of entirely different constructors, Coq recognizes this as a contradiction and considers your proof complete.

- 2,086
- 2
- 15
- 32
Yet another solution for completeness: cbn ; congruence
. Indeed 0 * 0
reduces to 0 (i.e. O
), which is different from 2 (S (S O)
) by disjointness of the constructors of the type nat
. The first tactic reduces (simplifies) the goal, the second one exploits disjointness to deduce the contradiction.
Goal 0 * 0 = 2 -> False.
cbn. congruence.
Qed.

- 3,586
- 1
- 15
- 35
Yet another solution, which applies in this specific example: lia
. lia
stands for Linear Integer Arithmetic. This powerful tactic considers all hypotheses consisting of, well, linear integer arithmetic (be it equations or inequalities) and uses them to solve an arithmetic goal, or any goal if the arithmetic hypotheses are contradictory.
You have to load a library.
Require Import Coq.micromega.Lia.
Goal 0 * 0 = 2 -> False.
lia.
Qed.
With Coq there are always a bunch of alternatives.

- 3,586
- 1
- 15
- 35
If you want to understand how it works "behind the scenes", this answer may be useful.

- 5,447
- 19
- 38