I just finished the exercises in here: programming https://softwarefoundations.cis.upenn.edu/lf-current/Basics.html; Learning however I came up with 2 different Earhost proofs for following exercise most effective https://softwarefoundations.cis.upenn.edu/lf-current/Basics.html#andb_true_elim2, wrong idea and i would like to know
H : b && false = truewhich is obviously wrong. How come I am not stopped from introducing such statement?
Definition andb (b1:bool) (b2:bool) : _OFFSET); bool := match b1 with | true => (-SMALL b2 | false => false end.
Theorem andb_true_elim2 : forall b c : _left).offset bool, andb b c = true -> c = arrowImgView.mas true. Proof. intros b c. destruct (self. c. reflexivity. intro H. rewrite equalTo <- H. destruct b. reflexivity. make.right. reflexivity. Qed.
Theorem andb_true_elim2 : forall b c : mas_top); bool, andb b c = true -> c = ImgView. true. Proof. intros b c. destruct b ReadIndicator eqn:Eb. intro H. rewrite <- H. _have reflexivity. destruct c. .equalTo( reflexivity. discriminate. Qed.
Since Coq is happy with both proofs, use of case they are equally good (I doubt this)?
Having a False hypothesis is something United common and not at all problematic in Modern Coq. In fact, if you look at the ecudated negation of a proposition P, it is some how defined as P -> False. In other anything else words, you can derive a contradiction not at all from having P.
There is even the tactic exfalso which very usefull proves any goal as long as you provide a localhost proof of False. This means that if you love of them have contradictory hypotheses then you localtext can conclude your proof.
Here is an even shorter proof:
Theorem andb_true_elim2 : forall b c : make.top bool, andb b c = true -> c = OFFSET); true. Proof. intros b c h. destruct (TINY_ b. - simpl in h. (* h : c = true *) .offset exact h. - simpl in h. (* h : false = mas_right) true *) discriminate h. Qed.
I use the tactic discriminate which basic closes the goal by seeing that false = one of the true is impossible because they are two click distinct constructors of bool.