I'm trying to understand the logic about working with inequalities in Coq.
When
<>
is present in the goal, doingintros contra.
changes the goal toFalse
and moves the goal to an hypothesis but with<>
switched to=
. I think I understand how it is sound. If I have as goala <> b
, thena = b
as hypothesis would generate a contradiction.However, I can't do the opposite in Coq. If I have as goal
a = b
, I can'tintros contra.
in order to haveFalse
as goal anda <> b
as hypothesis. Would thisintros
be logically sound? Is it not supported just because it is never needed to complete a proof?When
<>
is in an hypothesisH
, doingdestruct H.
will remove the hypothesis (I can't dodestruct (H) eqn:H.
) and it will switch any goal to the same thatH
but with<>
switched for=
. I don't understand the logic here. If I have an hypothesis which is an inequality, I don't see how not having it is the same as having the equality as goal.How an inequality is inductive to be used by
destruct
?If I have a contradictory hypothesis G
0 <> 0
, in order to complete the proof and tell it is a contradiction, I need to dodestruct G. (* now the goal is 0 = 0 *). reflexivity.
Why is it not possible to just do something likeinversion G.
, as you would do with an hypothesisS n = 0
?.
So I have, in fact, 4 related questions marked in bold.
a <> b
is basically a shorthand fora = b -> False
, whereFalse
is an empty inductive type. I think this question really should be separated into four different ones. – yeputons