Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11781

How can I handle this `false = true` case?

$
0
0

I am trying to prove the following lemma.

Inductive bool : Type :=  | true  | false.Lemma andb_true_iff : forall b1 b2 : bool,  b1 && b2 = true <-> b1 = true /\ b2 = true.Proof.  intros.  split.  - intros. split.+ destruct b1.      * reflexivity.      * discriminate.+ destruct b2.      * reflexivity.      * simpl. 

And now I get

1 goalb1 : boolH : b1 && false = true______________________________________(1/1)false = true

This is very absurd, since false = true is never True. However, I can't discriminate this goal.

OK, maybe we should prove H to be False, which is exact false = true. We can't reject to prove a goal which we believe to be False. However, why can't I even rewrite this goal to False? Is it because we have not proved it yet? So I prove the following

Lemma false_true: (false = true) -> False.Proof.  intros.  simpl in H.  discriminate H.Qed.

And seems the Lemma false_true can't be applied to this goal. Instead, I know I can write the following lemma to perform a rewrite

Lemma false_true2: (false = true) = False.Proof. Admitted.

However, I think false_true and false_true2 are somehow very similar. Is there any way that instead of rewrite by false_true2, we can just apply false_true?

Or must I write the following to apply?

Lemma false_true3: False -> (false = true).Proof.  intros.  destruct H.Qed.

== NOTE ==

I have solved this problem by destructing b1 either. However, I want to know is there any way to resolve false = true, since it looks weird to me.


Viewing all articles
Browse latest Browse all 11781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>