-
Notifications
You must be signed in to change notification settings - Fork 2
/
l01sol.v
89 lines (72 loc) · 1.43 KB
/
l01sol.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Module Lecture1.
Require Import Arith.
Require Import List.
Definition AnIntegerExists : nat := 2.
Lemma AnIntegerExistsB : nat.
Proof.
apply 0.
Qed.
Print nat.
Locate "_ /\ _".
Check and.
Print and.
Definition Proj1 {A B:Prop} : A /\ B -> A :=
fun (H:A /\ B) =>
match H with
| conj x y => x
end.
Lemma Proj1B {A B:Prop} : A /\ B -> A.
Proof.
intros.
destruct H.
apply H.
Qed.
Locate "_ <-> _".
Check iff.
Print iff.
Print and.
Lemma ObjectivismB {A:Prop} : A <-> A.
Proof.
split.
intros.
apply H.
intros.
apply H.
Qed.
Lemma ObjectivismB_Semicolons {A:Prop} : A <-> A.
Proof.
split; intros; apply H.
Qed.
Lemma ObjectivismB_Auto {A:Prop} : A <-> A.
Proof.
split; auto.
Qed.
Definition Objectivism {A:Prop} : A <-> A :=
conj (fun x => x) (fun x => x).
Lemma DistributeAnd {A B C:Prop} :
A /\ (B \/ C) -> (A /\ B) \/ (A /\ C).
Proof.
intros.
destruct H.
destruct H0.
left.
split.
apply H.
apply H0.
right.
split.
apply H.
apply H0.
Qed.
Lemma DistributeAnd_Semicolons {A B C:Prop} :
A /\ (B \/ C) -> (A /\ B) \/ (A /\ C).
Proof.
intros.
destruct H.
destruct H0;
(* [X1 | X2 | ... | Xn] applies X1 to the 1st
subgoal, X2 to the second, and so forth. *)
[left | right];
split; try apply H; try apply H0.
Qed.
End Lecture1.