forked from djvelleman/HTPILeanPackage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChap3Ex.lean
More file actions
206 lines (153 loc) · 5.17 KB
/
Chap3Ex.lean
File metadata and controls
206 lines (153 loc) · 5.17 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import HTPILib.Chap3
namespace HTPI.Exercises
/- Sections 3.1 and 3.2 -/
-- 1.
theorem Exercise_3_2_1a (P Q R : Prop)
(h1 : P → Q) (h2 : Q → R) : P → R := by
done
-- 2.
theorem Exercise_3_2_1b (P Q R : Prop)
(h1 : ¬R → (P → ¬Q)) : P → (Q → R) := by
done
-- 3.
theorem Exercise_3_2_2a (P Q R : Prop)
(h1 : P → Q) (h2 : R → ¬Q) : P → ¬R := by
done
-- 4.
theorem Exercise_3_2_2b (P Q : Prop)
(h1 : P) : Q → ¬(Q → ¬P) := by
done
/- Section 3.3 -/
-- 1.
theorem Exercise_3_3_1
(U : Type) (P Q : Pred U) (h1 : ∃ (x : U), P x → Q x) :
(∀ (x : U), P x) → ∃ (x : U), Q x := by
done
-- 2.
theorem Exercise_3_3_8 (U : Type) (F : Set (Set U)) (A : Set U)
(h1 : A ∈ F) : A ⊆ ⋃₀ F := by
done
-- 3.
theorem Exercise_3_3_9 (U : Type) (F : Set (Set U)) (A : Set U)
(h1 : A ∈ F) : ⋂₀ F ⊆ A := by
done
-- 4.
theorem Exercise_3_3_10 (U : Type) (B : Set U) (F : Set (Set U))
(h1 : ∀ (A : Set U), A ∈ F → B ⊆ A) : B ⊆ ⋂₀ F := by
done
-- 5.
theorem Exercise_3_3_13 (U : Type)
(F G : Set (Set U)) : F ⊆ G → ⋂₀ G ⊆ ⋂₀ F := by
done
/- Section 3.4 -/
-- 1.
theorem Exercise_3_4_2 (U : Type) (A B C : Set U)
(h1 : A ⊆ B) (h2 : A ⊆ C) : A ⊆ B ∩ C := by
done
-- 2.
theorem Exercise_3_4_4 (U : Type) (A B C : Set U)
(h1 : A ⊆ B) (h2 : A ⊈ C) : B ⊈ C := by
done
-- 3.
theorem Exercise_3_3_16 (U : Type) (B : Set U)
(F : Set (Set U)) : F ⊆ 𝒫 B → ⋃₀ F ⊆ B := by
done
-- 4.
theorem Exercise_3_3_17 (U : Type) (F G : Set (Set U))
(h1 : ∀ (A : Set U), A ∈ F → ∀ (B : Set U), B ∈ G → A ⊆ B) :
⋃₀ F ⊆ ⋂₀ G := by
done
-- 5.
theorem Exercise_3_4_7 (U : Type) (A B : Set U) :
𝒫 (A ∩ B) = 𝒫 A ∩ 𝒫 B := by
done
-- 6.
theorem Exercise_3_4_17 (U : Type) (A : Set U) : A = ⋃₀ (𝒫 A) := by
done
-- 7.
theorem Exercise_3_4_18a (U : Type) (F G : Set (Set U)) :
⋃₀ (F ∩ G) ⊆ (⋃₀ F) ∩ (⋃₀ G) := by
done
-- 8.
theorem Exercise_3_4_19 (U : Type) (F G : Set (Set U)) :
(⋃₀ F) ∩ (⋃₀ G) ⊆ ⋃₀ (F ∩ G) ↔
∀ (A B : Set U), A ∈ F → B ∈ G → A ∩ B ⊆ ⋃₀ (F ∩ G) := by
done
/- Section 3.5 -/
-- 1.
theorem Exercise_3_5_2 (U : Type) (A B C : Set U) :
(A ∪ B) \ C ⊆ A ∪ (B \ C) := sorry
-- 2.
theorem Exercise_3_5_5 (U : Type) (A B C : Set U)
(h1 : A ∩ C ⊆ B ∩ C) (h2 : A ∪ C ⊆ B ∪ C) : A ⊆ B := sorry
-- 3.
theorem Exercise_3_5_7 (U : Type) (A B C : Set U) :
A ∪ C ⊆ B ∪ C ↔ A \ C ⊆ B \ C := sorry
-- 4.
theorem Exercise_3_5_8 (U : Type) (A B : Set U) :
𝒫 A ∪ 𝒫 B ⊆ 𝒫 (A ∪ B) := sorry
-- 5.
theorem Exercise_3_5_17b (U : Type) (F : Set (Set U)) (B : Set U) :
B ∪ (⋂₀ F) = { x : U | ∀ (A : Set U), A ∈ F → x ∈ B ∪ A } := sorry
-- 6.
theorem Exercise_3_5_18 (U : Type) (F G H : Set (Set U))
(h1 : ∀ (A : Set U), A ∈ F → ∀ (B : Set U), B ∈ G → A ∪ B ∈ H) :
⋂₀ H ⊆ (⋂₀ F) ∪ (⋂₀ G) := sorry
-- 7.
theorem Exercise_3_5_24a (U : Type) (A B C : Set U) :
(A ∪ B) △ C ⊆ (A △ C) ∪ (B △ C) := sorry
/- Section 3.6 -/
-- 1.
theorem Exercise_3_4_15 (U : Type) (B : Set U) (F : Set (Set U)) :
⋃₀ { X : Set U | ∃ (A : Set U), A ∈ F ∧ X = A \ B }
⊆ ⋃₀ (F \ 𝒫 B) := sorry
-- 2.
theorem Exercise_3_5_9 (U : Type) (A B : Set U)
(h1 : 𝒫 (A ∪ B) = 𝒫 A ∪ 𝒫 B) : A ⊆ B ∨ B ⊆ A := by
--Hint: Start like this:
have h2 : A ∪ B ∈ 𝒫 (A ∪ B) := sorry
done
-- 3.
theorem Exercise_3_6_6b (U : Type) :
∃! (A : Set U), ∀ (B : Set U), A ∪ B = A := sorry
-- 4.
theorem Exercise_3_6_7b (U : Type) :
∃! (A : Set U), ∀ (B : Set U), A ∩ B = A := sorry
-- 5.
theorem Exercise_3_6_8a (U : Type) : ∀ (A : Set U),
∃! (B : Set U), ∀ (C : Set U), C \ A = C ∩ B := sorry
-- 6.
theorem Exercise_3_6_10 (U : Type) (A : Set U)
(h1 : ∀ (F : Set (Set U)), ⋃₀ F = A → A ∈ F) :
∃! (x : U), x ∈ A := by
--Hint: Start like this:
set F0 : Set (Set U) := { X : Set U | X ⊆ A ∧ ∃! (x : U), x ∈ X }
--Now F0 is in the tactic state, with the definition above
have h2 : ⋃₀ F0 = A := sorry
done
/- Section 3.7 -/
-- 1.
theorem Exercise_3_3_18a (a b c : Int)
(h1 : a ∣ b) (h2 : a ∣ c) : a ∣ (b + c) := sorry
-- 2.
theorem Exercise_3_4_6 (U : Type) (A B C : Set U) :
A \ (B ∩ C) = (A \ B) ∪ (A \ C) := by
apply Set.ext
fix x : U
show x ∈ A \ (B ∩ C) ↔ x ∈ A \ B ∪ A \ C from
calc x ∈ A \ (B ∩ C)
_ ↔ x ∈ A ∧ ¬(x ∈ B ∧ x ∈ C) := sorry
_ ↔ x ∈ A ∧ (x ∉ B ∨ x ∉ C) := sorry
_ ↔ (x ∈ A ∧ x ∉ B) ∨ (x ∈ A ∧ x ∉ C) := sorry
_ ↔ x ∈ (A \ B) ∪ (A \ C) := sorry
done
-- 3.
theorem Exercise_3_4_10 (x y : Int)
(h1 : odd x) (h2 : odd y) : even (x - y) := sorry
-- 4.
theorem Exercise_3_4_27a :
∀ (n : Int), 15 ∣ n ↔ 3 ∣ n ∧ 5 ∣ n := sorry
-- 5.
theorem Like_Exercise_3_7_5 (U : Type) (F : Set (Set U))
(h1 : 𝒫 (⋃₀ F) ⊆ ⋃₀ { 𝒫 A | A ∈ F }) :
∃ (A : Set U), A ∈ F ∧ ∀ (B : Set U), B ∈ F → B ⊆ A := sorry