Skip to content

Instantly share code, notes, and snippets.

@kimitaka
Created December 11, 2013 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimitaka/7906423 to your computer and use it in GitHub Desktop.
Save kimitaka/7906423 to your computer and use it in GitHub Desktop.
初心者が陥りそうな罠 〜なんでもintrosすればいいってわけじゃない〜 ref: http://qiita.com/kimitaka@github/items/7879ea3133fe378b178c
forall b c : bool, P -> Q -> R
intros b c p q.
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
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.
Theorem andb_eq_orb :
forall (b c : bool),
(andb b c = orb b c) ->
b = c.
intros b c H.
1 subgoal
b : bool
c : bool
H : (b && c)%bool = (b || c)%bool
______________________________________(1/1)
b = c
destruct b.
destruct c.
3 subgoals
H : (true && true)%bool = (true || true)%bool
______________________________________(1/3)
true = true
______________________________________(2/3)
true = false
______________________________________(3/3)
false = c
reflexivity.
2 subgoals
H : (true && false)%bool = (true || false)%bool
______________________________________(1/2)
true = false
______________________________________(2/2)
false = c
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