I have the following Lemma but couldn't prove it:
Lemma my_comp2: forall i t:Z,
t<i -> Int.ltu (Int.repr i) (Int.repr t) = false.
Proof.
....
I found the tactic for equality (link) but can't find the one for lt/ltu or gt/gtu:
Theorem eq_false: forall x y, x <> y -> eq x y = false.
Any help will be appreciated!
Thanks,
This lemma cannot be proved because it is false. And here is a counterexample for the case where
wordsize = 8
bits (I'll leave the generalization to you).Let's take
i = 256
andt = 255
. Clearly, the premise of the lemma is true (t < i
). Then,(Int.repr i) = 0
because of the integer wrap around.(Int.repr t) = 255
, since there is no overflow in this case, butltu
will returntrue
for the aforementioned values, notfalse
as the lemma states.As for the theorem
eq_false
, it differs significantly from your lemma, sincex
andy
belong toint
, notZ
:Hope this helps.