-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAssignment7.lean
More file actions
379 lines (307 loc) · 12.6 KB
/
Assignment7.lean
File metadata and controls
379 lines (307 loc) · 12.6 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus
import Mathlib.Order.CompletePartialOrder
noncomputable section
open BigOperators Function Set Real Filter Classical Topology TopologicalSpace
/-! # Exercises to practice. -/
-- Work out the details in the definition of the principal filter.
def principal {α : Type*} (s : Set α) : Filter α
where
sets := { t | s ⊆ t }
univ_sets := by simp
sets_of_superset := by
simp
intro x y hx hy
exact fun ⦃a⦄ a_1 ↦ hy (hx a_1)
inter_sets := by
simp
intro x y hx hy
constructor
· exact hx
· exact hy
done
-- Work out the details in the definition of the atTop filter.
example : Filter ℕ :=
{ sets := { s | ∃ a, ∀ b, a ≤ b → b ∈ s }
univ_sets := by simp
sets_of_superset := by
simp
intro x y a ha hxy
use a
exact fun b a ↦ hxy (ha b a)
inter_sets := by
simp
intro x y a ha c hc
use (max a c)
intro b hb
specialize ha b
specialize hc b
have hab : a ≤ b := by exact le_of_max_le_left hb
have hcb : c ≤ b := by exact le_of_max_le_right hb
constructor
· exact ha hab
· exact hc hcb
}
-- Harder: show the same result, over any pre-order. You may have to adjust your proof
-- of the intersection property.
example {α : Type*} [Nonempty α] [Preorder α] : Filter α :=
{ sets := { s | ∃ a, ∀ b, a ≤ b → b ∈ s }
univ_sets := by sorry
sets_of_superset := by sorry
inter_sets := by sorry }
/- You can use `filter_upwards` to conveniently conclude `Eventually` statements from `Eventually`
in one or more hypotheses using the same filter. -/
example {ι : Type*} {L : Filter ι} {f g : ι → ℝ} (h1 : ∀ᶠ i in L, f i ≤ g i)
(h2 : ∀ᶠ i in L, g i ≤ f i) : ∀ᶠ i in L, f i = g i := by
filter_upwards [h1, h2] with i h1 h2
exact le_antisymm h1 h2
example {ι : Type*} {L : Filter ι} {a b : ι → ℤ} (h1 : ∀ᶠ i in L, a i ≤ b i + 1)
(h2 : ∀ᶠ i in L, b i ≤ a i + 1) (h3 : ∀ᶠ i in L, b i ≠ a i) : ∀ᶠ i in L, |a i - b i| = 1 := by
sorry
done
section RegularOpens
/- The goal of the following exercise is to prove that
the regular open sets in a topological space form a complete boolean algebra.
`U ⊔ V` is given by `interior (closure (U ∪ V))`.
`U ⊓ V` is given by `U ∩ V`. -/
variable {X : Type*} [TopologicalSpace X]
variable (X) in
structure RegularOpens where
carrier : Set X
isOpen : IsOpen carrier
regular' : interior (closure carrier) = carrier
namespace RegularOpens
/- We write some lemmas so that we can easily reason about regular open sets. -/
variable {U V : RegularOpens X}
instance : SetLike (RegularOpens X) X where
coe := RegularOpens.carrier
coe_injective' := fun ⟨_, _, _⟩ ⟨_, _, _⟩ _ => by congr
theorem le_def {U V : RegularOpens X} : U ≤ V ↔ (U : Set X) ⊆ (V : Set X) := by simp
@[simp] theorem regular {U : RegularOpens X} : interior (closure (U : Set X)) = U := U.regular'
@[simp] theorem carrier_eq_coe (U : RegularOpens X) : U.1 = ↑U := rfl
@[ext] theorem ext (h : (U : Set X) = V) : U = V :=
SetLike.coe_injective h
/- First we want a complete lattice structure on the regular open sets.
We can obtain this from a so-called `GaloisCoinsertion` with the closed sets.
This is a pair of maps
* `l : RegularOpens X → Closeds X`
* `r : Closeds X → RegularOpens X`
with the properties that
* for any `U : RegularOpens X` and `C : Closeds X` we have `l U ≤ C ↔ U ≤ r U`
* `r ∘ l = id`
If you know category theory, this is an *adjunction* between orders
(or more precisely, a coreflection).
-/
/- The closure of a regular open set. Of course Mathlib knows that the closure of a set is closed.
(the `simps` attribute will automatically generate the simp-lemma for you that
`(U.cl : Set X) = closure (U : Set X)`
-/
@[simps]
def cl (U : RegularOpens X) : Closeds X :=
⟨closure U, sorry⟩
/- The interior of a closed set. You will have to prove yourself that it is regular open. -/
@[simps]
def _root_.TopologicalSpace.Closeds.int (C : Closeds X) : RegularOpens X :=
⟨interior C, sorry, sorry⟩
/- Now let's show the relation between these two operations. -/
lemma cl_le_iff {U : RegularOpens X} {C : Closeds X} :
U.cl ≤ C ↔ U ≤ C.int := by sorry
@[simp] lemma cl_int : U.cl.int = U := by sorry
/- This gives us a GaloisCoinsertion. -/
def gi : GaloisCoinsertion cl (fun C : Closeds X ↦ C.int) where
gc U C := cl_le_iff
u_l_le U := by simp
choice C hC := C.int
choice_eq C hC := rfl
/- It is now a general theorem that we can lift the complete lattice structure from `Closeds X`
to `RegularOpens X`. The lemmas below give the definitions of the lattice operations. -/
instance completeLattice : CompleteLattice (RegularOpens X) :=
GaloisCoinsertion.liftCompleteLattice gi
@[simp] lemma coe_inf {U V : RegularOpens X} : ↑(U ⊓ V) = (U : Set X) ∩ V := by
have : U ⊓ V = (U.cl ⊓ V.cl).int := rfl
simp [this]
@[simp] lemma coe_sup {U V : RegularOpens X} : ↑(U ⊔ V) = interior (closure ((U : Set X) ∪ V)) := by
have : U ⊔ V = (U.cl ⊔ V.cl).int := rfl
simp [this]
@[simp] lemma coe_top : ((⊤ : RegularOpens X) : Set X) = univ := by
have : (⊤ : RegularOpens X) = (⊤ : Closeds X).int := rfl
simp [this]
@[simp] lemma coe_bot : ((⊥ : RegularOpens X) : Set X) = ∅ := by
have : (⊥ : RegularOpens X) = (⊥ : Closeds X).int := rfl
simp [this]
@[simp] lemma coe_sInf {U : Set (RegularOpens X)} :
((sInf U : RegularOpens X) : Set X) =
interior (⋂₀ ((fun u : RegularOpens X ↦ closure u) '' U)) := by
have : sInf U = (sInf (cl '' U)).int := rfl
simp [this]
@[simp] lemma Closeds.coe_sSup {C : Set (Closeds X)} : ((sSup C : Closeds X) : Set X) =
closure (⋃₀ ((↑) '' C)) := by
have : sSup C = Closeds.closure (sSup ((↑) '' C)) := rfl
simp [this]
@[simp] lemma coe_sSup {U : Set (RegularOpens X)} :
((sSup U : RegularOpens X) : Set X) =
interior (closure (⋃₀ ((fun u : RegularOpens X ↦ closure u) '' U))) := by
have : sSup U = (sSup (cl '' U)).int := rfl
simp [this]
/- We still have to prove that this gives a distributive lattice.
Warning: these are hard. -/
instance completeDistribLattice : CompleteDistribLattice (RegularOpens X) :=
CompleteDistribLattice.ofMinimalAxioms
{ completeLattice with
inf_sSup_le_iSup_inf := by sorry
iInf_sup_le_sup_sInf := by sorry
}
/- Finally, we can show that the regular open subsets form a complete Boolean algebra.
Define `compl` and`coe_compl` holds and complete the instance below. -/
structure CompleteBooleanAlgebra.MinimalAxioms (α : Type*) extends
CompleteDistribLattice.MinimalAxioms α, HasCompl α where
inf_compl_le_bot : ∀ (x : α), x ⊓ xᶜ ≤ ⊥
top_le_sup_compl : ∀ (x : α), ⊤ ≤ x ⊔ xᶜ
abbrev CompleteBooleanAlgebra.ofMinimalAxioms {α : Type*}
(h : CompleteBooleanAlgebra.MinimalAxioms α) : CompleteBooleanAlgebra α where
__ := h
le_sup_inf x y z :=
let z := CompleteDistribLattice.ofMinimalAxioms h.toMinimalAxioms
le_sup_inf
instance : HasCompl (RegularOpens X) where
compl U := sorry
@[simp]
lemma coe_compl (U : RegularOpens X) : ↑Uᶜ = interior (U : Set X)ᶜ := sorry
instance completeBooleanAlgebra : CompleteBooleanAlgebra (RegularOpens X) :=
CompleteBooleanAlgebra.ofMinimalAxioms {
inf_sSup_le_iSup_inf := sorry -- you may skip this if you want
iInf_sup_le_sup_sInf := sorry -- you may skip this if you want
inf_compl_le_bot := by
sorry
top_le_sup_compl := by
sorry
}
end RegularOpens
/-! # Exercises to hand in. -/
section GroupActions
variable (G : Type*) {X : Type*} [Group G] [MulAction G X]
/- Below is the orbit of an element `x ∈ X` w.r.t. a group action by `G`.
Prove that the orbits of two elements are equal
precisely when one element is in the orbit of the other. -/
def orbitOf (x : X) : Set X := range (fun g : G ↦ g • x)
lemma orbitOf_eq_iff (x y : X) : orbitOf G x = orbitOf G y ↔ y ∈ orbitOf G x := by
unfold orbitOf
constructor
· intro h
simp
have hy1 : y ∈ (range (fun (g:G) ↦ g • y)) := by
simp
use 1
simp
rw [← h] at hy1
simp at hy1
obtain ⟨z, hz⟩ := hy1
use z
· intro h
ext z
simp
constructor
· intro ⟨y1, hy1⟩
obtain ⟨y2, hy2⟩ := h
simp at hy2
rw [← hy1, ← hy2]
use y1 * y2⁻¹
rw [smul_smul (y1 * y2⁻¹) y2 x]
simp
· intro ⟨y1, hy1⟩
obtain ⟨y2, hy2⟩ := h
simp at hy2
rw [← hy1, ← hy2]
use y1 * y2
rw [smul_smul y1 y2 x]
done
/- Define the stabilizer of an element `x` as the subgroup of elements
`g ∈ G` that satisfy `g • x = x`. -/
def stabilizerOf (x : X) : Subgroup G where
carrier := {g | g • x = x }
mul_mem' a b := by
simp at *
rw [mul_smul]
rw [b, a]
one_mem' := by
simp
inv_mem' := by
intro g hg
simp at *
exact inv_smul_eq_iff.mpr (id (Eq.symm hg))
-- This is a lemma that allows `simp` to simplify `x ≈ y` in the proof below.
@[simp] theorem leftRel_iff {x y : G} {s : Subgroup G} :
letI := QuotientGroup.leftRel s; x ≈ y ↔ x⁻¹ * y ∈ s :=
QuotientGroup.leftRel_apply
/- Let's prove the orbit-stabilizer theorem.
Hint: Only define the forward map (as a separate definition),
and use `Equiv.ofBijective` to get an equivalence.
(Note that we are coercing `orbitOf G x` to a (sub)type in the right-hand side) -/
def orbit_stabilizer_theorem (x : X) : G ⧸ stabilizerOf G x ≃ orbitOf G x := by
have f : (G ⧸ stabilizerOf G x → orbitOf G x) := by
intro h
ext g
have hf : Function.Bijective f := by sorry
exact Equiv.ofBijective f hf
done
end GroupActions
section tendsto
/- Let's convince ourselves that convergence of a sequence and continuity at `x` as
defined in the lecture (and mathlib) correspond to the definitions we used in an analysis course. -/
/- Using these operations, we can define the limit. -/
def MyTendsto {X Y : Type*} (f : X → Y)
(F : Filter X) (G : Filter Y) :=
map f F ≤ G
-- The following lemma will be very helpful.
#check mem_nhds_iff
-- You can assume this lemma for this exercise; you don't have to prove it.
-- (It is similar to the lemma `IsOpen.exists_Ioo_subset` in mathlib.)
lemma _root_.IsOpen.exists_Ioo_subset' {s : Set ℝ} {x : ℝ} (hs : IsOpen s) (hx : x ∈ s) :
∃ a b, a < b ∧ x ∈ Ioo a b ∧ Ioo a b ⊆ s := by
sorry
example (u : ℕ → ℝ) (x : ℝ) : MyTendsto u atTop (𝓝 x) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, |u n - x| < ε := by
simp only [MyTendsto]
constructor
· intro h ε hε
have : ∃ N, ∀ n ≥ N, n ∈ u ⁻¹' (Ioo (x - ε) (x + ε)) := by
sorry
sorry
· intro h s hs
-- Choose epsilon so an open interval around it is contained in s.
have : ∃ ε, 0 < ε ∧ Ioo (x - ε) (x + ε) ⊆ s := by
sorry
sorry
-- The following exercise is a bonus exercise: any points you get here will be counted on top
-- of your regular points.
example (f : ℝ → ℝ) (x : ℝ) :
Tendsto f (𝓝 x) (𝓝 (f x)) ↔ ∀ ε > 0, ∃ δ > 0, ∀ x y, |x - y| < δ → |f x - f y| < ε := by
sorry
end tendsto
section indicator
/- Here is a technical property using filters, characterizing when a 2-valued function converges to
a filter of the form `if q then F else G`. The next exercise is a more concrete application.
Useful lemmas here are
* `Filter.Eventually.filter_mono`
* `Filter.Eventually.mono` -/
lemma technical_filter_exercise {ι α : Type*} {p : ι → Prop} {q : Prop} {a b : α}
{L : Filter ι} {F G : Filter α}
(hbF : ∀ᶠ x in F, x ≠ b) (haG : ∀ᶠ x in G, x ≠ a) (haF : pure a ≤ F) (hbG : pure b ≤ G) :
(∀ᶠ i in L, p i ↔ q) ↔
Tendsto (fun i ↦ if p i then a else b) L (if q then F else G) := by
have hab : a ≠ b := by
sorry
rw [tendsto_iff_eventually]
sorry
done
/- To be more concrete, we can use the previous lemma to prove the following.
if we denote the characteristic function of `A` by `1_A`, and `f : ℝ → ℝ` is a function,
then `f * 1_{s i}` tends to `f * 1_t` iff `x ∈ s i` is eventually equivalent to
`x ∈ t` for all `x`. (note that this does *not* necessarily mean that `s i = t` eventually).
`f * 1_t` is written `indicator t f` in Lean.
Useful lemmas for this exercise are `indicator_apply`, `apply_ite` and `tendsto_pi_nhds`. -/
lemma tendsto_indicator_iff {ι : Type*} {L : Filter ι} {s : ι → Set ℝ} {t : Set ℝ} {f : ℝ → ℝ}
(ha : ∀ x, f x ≠ 0) :
(∀ x, ∀ᶠ i in L, x ∈ s i ↔ x ∈ t) ↔
Tendsto (fun i ↦ indicator (s i) f) L (𝓝 (indicator t f)) := by
sorry
done
end indicator