Created
December 11, 2013 07:40
-
-
Save kimitaka/7906423 to your computer and use it in GitHub Desktop.
初心者が陥りそうな罠 〜なんでもintrosすればいいってわけじゃない〜 ref: http://qiita.com/kimitaka@github/items/7879ea3133fe378b178c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forall b c : bool, P -> Q -> R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intros b c p q. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 subgoals | |
______________________________________(1/3) | |
(true && true)%bool = (true || true)%bool -> true = true | |
______________________________________(2/3) | |
(true && false)%bool = (true || false)%bool -> true = false | |
______________________________________(3/3) | |
(false && c)%bool = (false || c)%bool -> false = c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Theorem andb_eq_orb : | |
forall (b c : bool), | |
(andb b c = orb b c) -> | |
b = c. | |
Proof. | |
intros b c. | |
destruct b. | |
destruct c. | |
simpl. | |
reflexivity. | |
simpl. | |
intros H. | |
rewrite H. | |
reflexivity. | |
simpl. | |
intros H. | |
rewrite H. | |
reflexivity. | |
Qed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Theorem andb_eq_orb : | |
forall (b c : bool), | |
(andb b c = orb b c) -> | |
b = c. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intros b c H. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 subgoal | |
b : bool | |
c : bool | |
H : (b && c)%bool = (b || c)%bool | |
______________________________________(1/1) | |
b = c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
destruct b. | |
destruct c. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 subgoals | |
H : (true && true)%bool = (true || true)%bool | |
______________________________________(1/3) | |
true = true | |
______________________________________(2/3) | |
true = false | |
______________________________________(3/3) | |
false = c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reflexivity. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 subgoals | |
H : (true && false)%bool = (true || false)%bool | |
______________________________________(1/2) | |
true = false | |
______________________________________(2/2) | |
false = c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
intros b c. | |
destruct b. | |
destruct c. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment