wip tactics

This commit is contained in:
Michael Zhang 2020-06-04 07:22:09 -05:00
parent 027cc8dc14
commit 5440b4b482
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B

View file

@ -74,7 +74,9 @@ Theorem silly_ex :
oddb 3 = true -> oddb 3 = true ->
evenb 4 = true. evenb 4 = true.
Proof. Proof.
(* FILL IN HERE *) Admitted. intros A B.
apply B.
Qed.
(** [] *) (** [] *)
(** To use the [apply] tactic, the (conclusion of the) fact (** To use the [apply] tactic, the (conclusion of the) fact
@ -107,8 +109,11 @@ Theorem rev_exercise1 : forall (l l' : list nat),
l = rev l' -> l = rev l' ->
l' = rev l. l' = rev l.
Proof. Proof.
(* FILL IN HERE *) Admitted. intros l l' H.
(** [] *) rewrite -> H.
symmetry.
apply rev_involutive.
Qed.
(** **** Exercise: 1 star, standard, optional (apply_rewrite) (** **** Exercise: 1 star, standard, optional (apply_rewrite)
@ -176,8 +181,10 @@ Example trans_eq_exercise : forall (n m o p : nat),
(n + p) = m -> (n + p) = m ->
(n + p) = (minustwo o). (n + p) = (minustwo o).
Proof. Proof.
(* FILL IN HERE *) Admitted. intros n m o p H J.
(** [] *) apply trans_eq with (m:=m).
apply J. apply H.
Qed.
(* ################################################################# *) (* ################################################################# *)
(** * The [injection] and [discriminate] Tactics *) (** * The [injection] and [discriminate] Tactics *)
@ -273,8 +280,9 @@ Example injection_ex3 : forall (X : Type) (x y z : X) (l j : list X),
y :: l = x :: j -> y :: l = x :: j ->
x = y. x = y.
Proof. Proof.
(* FILL IN HERE *) Admitted. intros X x y z l j H J.
(** [] *) injection J as J1. symmetry. apply J1.
Qed.
(** So much for injectivity of constructors. What about disjointness? (** So much for injectivity of constructors. What about disjointness?
@ -345,8 +353,9 @@ Example discriminate_ex3 :
x :: y :: l = [] -> x :: y :: l = [] ->
x = z. x = z.
Proof. Proof.
(* FILL IN HERE *) Admitted. intros X x y z l H J.
(** [] *) discriminate J.
Qed.
(** The injectivity of constructors allows us to reason that (** The injectivity of constructors allows us to reason that
[forall (n m : nat), S n = S m -> n = m]. The converse of this [forall (n m : nat), S n = S m -> n = m]. The converse of this