Skip to content

Commit d28b3ab

Browse files
committed
tidying up
1 parent 852349c commit d28b3ab

File tree

2 files changed

+107
-114
lines changed

2 files changed

+107
-114
lines changed

FLT/ForMathlib/ActionTopology.lean

+50-114
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and `+ : A × A → A` continuous (with all the products having the product topo
1515
1616
This topology was suggested by Will Sawin [here](https://mathoverflow.net/a/477763/1384).
1717
18+
## TODO
19+
Drop freeness from continuity of bilinear map claim; presumably only finiteness is needed,
20+
becuse of Sawin's observation that the quotient topology for a surjection of R-mods
21+
is the action topology.
1822
-/
1923

2024
section basics
@@ -73,11 +77,11 @@ namespace ActionTopology
7377

7478
section zero
7579

76-
instance subsingleton (R : Type*) [TopologicalSpace R] (A : Type*) [Add A] [SMul R A] [Subsingleton A]
77-
[TopologicalSpace A] : IsActionTopology R A := by
78-
constructor
79-
ext U
80-
simp only [isOpen_discrete]
80+
instance subsingleton (R : Type*) [TopologicalSpace R] (A : Type*) [Add A] [SMul R A]
81+
[Subsingleton A] [TopologicalSpace A] : IsActionTopology R A where
82+
isActionTopology' := by
83+
ext U
84+
simp only [isOpen_discrete]
8185

8286
end zero
8387

@@ -136,34 +140,35 @@ variable {A : Type*} [AddCommMonoid A] [Module R A] [τA : TopologicalSpace A] [
136140
variable {B : Type*} [AddCommMonoid B] [Module R B] [τB : TopologicalSpace B]
137141

138142
-- this is horrible. Why isn't it easy?
143+
-- One reason: we are rolling our own continuous linear equivs!
144+
-- **TODO** Ask about making continuous linear equivs properly
139145
lemma iso (ehomeo : A ≃ₜ B) (elinear : A ≃ₗ[R] B) (he : ∀ a, ehomeo a = elinear a)
140146
[IsActionTopology R A] : IsActionTopology R B where
141147
isActionTopology' := by
142-
have ⟨foo⟩ := ehomeo.symm.inducing
143-
rw [foo]
144-
simp_rw [isActionTopology R A, actionTopology]
145-
rw [induced_sInf]
148+
simp_rw [ehomeo.symm.inducing.1, isActionTopology R A, actionTopology, induced_sInf]
146149
congr 1
147150
ext τ
148151
rw [Set.mem_image]
149-
-- bleurgh
152+
-- it's the same picture
150153
constructor
151154
· rintro ⟨σ, ⟨hσ1, hσ2⟩, rfl⟩
152155
refine ⟨?_, ?_⟩
153-
· convert @induced_continuous_smul (f := @id R) (hf := continuous_id) (g := elinear.symm.toMulActionHom) (τA := σ) _ _ _ _ _
156+
· convert @induced_continuous_smul (f := @id R) (hf := continuous_id)
157+
(g := elinear.symm.toMulActionHom) (τA := σ) _ _ _ _ _
154158
ext x
155-
rw [@Homeomorph.symm_apply_eq, he]
156-
exact (LinearEquiv.symm_apply_eq elinear).mp rfl
159+
rw [@Homeomorph.symm_apply_eq, he, ← LinearEquiv.symm_apply_eq elinear]
160+
rfl
157161
· convert @induced_continuous_add (h := elinear.symm.toAddMonoidHom) σ _
158162
ext x
159-
rw [@Homeomorph.symm_apply_eq, he]
160-
exact (LinearEquiv.symm_apply_eq elinear).mp rfl
163+
rw [@Homeomorph.symm_apply_eq, he, ← LinearEquiv.symm_apply_eq elinear]
164+
rfl
161165
· rintro ⟨h1, h2⟩
162166
use τ.induced elinear
163167
rw [induced_compose]
164168
refine ⟨⟨?_, ?_⟩, ?_⟩
165-
· convert @induced_continuous_smul (f := @id R) (hf := continuous_id) (g := elinear.toMulActionHom) (τA := τ) _ _ _ _ _
166-
· convert @induced_continuous_add (h := elinear.toAddMonoidHom) τ _
169+
· exact @induced_continuous_smul (f := @id R) (hf := continuous_id)
170+
(g := elinear.toMulActionHom) (τA := τ) _ _ _ _ _
171+
· exact @induced_continuous_add (h := elinear.toAddMonoidHom) τ _
167172
· nth_rw 2 [← induced_id (t := τ)]
168173
congr
169174
ext x
@@ -195,16 +200,15 @@ lemma continuous_of_linearMap (φ : A →ₗ[R] B) : Continuous φ :=
195200
continuous_of_distribMulActionHom φ.toDistribMulActionHom
196201

197202
variable (R) in
198-
lemma continuous_neg (C : Type*) [AddCommGroup C] [Module R C] [TopologicalSpace C] [IsActionTopology R C] :
199-
Continuous (fun a ↦ -a : C → C) :=
203+
lemma continuous_neg (C : Type*) [AddCommGroup C] [Module R C] [TopologicalSpace C]
204+
[IsActionTopology R C] : Continuous (fun a ↦ -a : C → C) :=
200205
continuous_of_linearMap (LinearEquiv.neg R).toLinearMap
201206

202207
end function
203208

204209
section prod
205210

206211
variable {R : Type*} [τR : TopologicalSpace R] [Semiring R] [TopologicalSemiring R]
207-
208212
variable {M : Type*} [AddCommMonoid M] [Module R M] [aM : TopologicalSpace M] [IsActionTopology R M]
209213
variable {N : Type*} [AddCommMonoid N] [Module R N] [aN : TopologicalSpace N] [IsActionTopology R N]
210214

@@ -255,54 +259,6 @@ variable {ι : Type*} [Finite ι] {A : ι → Type*} [∀ i, AddCommGroup (A i)]
255259
[∀ i, Module R (A i)] [∀ i, TopologicalSpace (A i)]
256260
[∀ i, IsActionTopology R (A i)]
257261

258-
-- elsewhere
259-
variable (R) in
260-
def LinearEquiv.sumPiEquivProdPi (S T : Type*) (A : S ⊕ T → Type*)
261-
[∀ st, AddCommGroup (A st)] [∀ st, Module R (A st)] :
262-
(∀ (st : S ⊕ T), A st) ≃ₗ[R] (∀ (s : S), A (.inl s)) × (∀ (t : T), A (.inr t)) where
263-
toFun f := (fun s ↦ f (.inl s), fun t ↦ f (.inr t))
264-
map_add' f g := by aesop
265-
map_smul' := by aesop
266-
invFun fg st := Sum.rec (fun s => fg.1 s) (fun t => fg.2 t) st
267-
left_inv := by intro x; aesop
268-
right_inv := by intro x; aesop
269-
270-
-- elsewhere
271-
def Homeomorph.sumPiEquivProdPi (S T : Type*) (A : S ⊕ T → Type*)
272-
[∀ st, TopologicalSpace (A st)] :
273-
(∀ (st : S ⊕ T), A st) ≃ₜ (∀ (s : S), A (.inl s)) × (∀ (t : T), A (.inr t)) where
274-
toFun f := (fun s ↦ f (.inl s), fun t ↦ f (.inr t))
275-
invFun fg st := Sum.rec (fun s => fg.1 s) (fun t => fg.2 t) st
276-
left_inv := by intro x; aesop
277-
right_inv := by intro x; aesop
278-
continuous_toFun := Continuous.prod_mk (by fun_prop) (by fun_prop)
279-
continuous_invFun := continuous_pi <| fun st ↦ by
280-
rcases st with s | t
281-
· simp
282-
fun_prop
283-
· simp
284-
fun_prop
285-
286-
-- elsewhere
287-
def Homeomorph.pUnitPiEquiv (f : PUnit → Type*) [∀ x, TopologicalSpace (f x)]: ((t : PUnit) → (f t)) ≃ₜ f () where
288-
toFun a := a ()
289-
invFun a _t := a
290-
left_inv x := by aesop
291-
right_inv x := by aesop
292-
continuous_toFun := by simp; fun_prop
293-
continuous_invFun := by simp; fun_prop
294-
295-
-- elsewhere
296-
variable (R) in
297-
def LinearEquiv.pUnitPiEquiv (f : PUnit → Type*) [∀ x, AddCommGroup (f x)] [∀ x, Module R (f x)] :
298-
((t : PUnit) → (f t)) ≃ₗ[R] f () where
299-
toFun a := a ()
300-
invFun a _t := a
301-
left_inv x := by aesop
302-
right_inv x := by aesop
303-
map_add' f g := rfl
304-
map_smul' r f := rfl
305-
306262
instance pi : IsActionTopology R (∀ i, A i) := by
307263
induction ι using Finite.induction_empty_option
308264
· case of_equiv X Y e hind _ _ _ _ =>
@@ -326,14 +282,6 @@ instance pi : IsActionTopology R (∀ i, A i) := by
326282

327283
end Pi
328284

329-
-- elsewhere
330-
lemma finsum_apply {α ι N : Type*} [AddCommMonoid N] [Finite ι]
331-
(f : ι → α → N) (a : α) : (∑ᶠ i, f i) a = ∑ᶠ i, (f i) a := by
332-
classical
333-
simp only [finsum_def, dif_pos (Set.toFinite _), Finset.sum_apply]
334-
symm
335-
apply Finset.sum_subset <;> aesop
336-
337285
section bilinear
338286

339287
-- I need these because ` ChooseBasisIndex.fintype` needs a ring instead of a semiring
@@ -421,68 +369,56 @@ variable {R : Type*} [τR : TopologicalSpace R] [Ring R] [TopologicalRing R]
421369
variable {A : Type*} [AddCommGroup A] [Module R A] [aA : TopologicalSpace A] [IsActionTopology R A]
422370
variable {B : Type*} [AddCommGroup B] [Module R B] [aB : TopologicalSpace B] [IsActionTopology R B]
423371

424-
-- is this true? I used it with topology 4 to "reduce to the case of R^n -> B".
425-
-- It might not be true here. Maybe the quotient topology `R / I` is strictly finer than
426-
-- the action topology?
427-
-- Here I need this lemma about how quotients are open so I need groups
372+
-- Here I need the lemma about how quotients are open so I need groups
428373
-- because this relies on translates of an open being open
429374
lemma coinduced_of_surjective {φ : A →ₗ[R] B} (hφ : Function.Surjective φ) :
430375
TopologicalSpace.coinduced φ (actionTopology R A) = actionTopology R B := by
431376
have : Continuous φ := continuous_of_linearMap φ
432-
rw [continuous_iff_coinduced_le] at this
433-
rw [isActionTopology R A, isActionTopology R B] at this
377+
rw [continuous_iff_coinduced_le, isActionTopology R A, isActionTopology R B] at this
434378
apply le_antisymm this
435-
clear this
436-
apply sInf_le
437-
constructor
438-
· -- Is this true? Will Sawin thinks so
439-
apply @ContinuousSMul.mk R B _ _ (_)
379+
have : ContinuousAdd A := isActionTopology_continuousAdd R A
380+
refine sInf_le ⟨?_, ?_⟩
381+
· apply @ContinuousSMul.mk R B _ _ (_)
440382
obtain ⟨foo⟩ : ContinuousSMul R A := inferInstance
441383
rw [continuous_def] at foo ⊢
442384
intro U hU
443385
rw [isOpen_coinduced, ← isActionTopology R A] at hU
444-
specialize foo _ hU
445-
rw [← Set.preimage_comp] at foo
446-
rw [show φ ∘ (fun p ↦ p.1 • p.2 : R × A → A) =
386+
specialize foo _ hU; clear hU
387+
rw [← Set.preimage_comp, show φ ∘ (fun p ↦ p.1 • p.2 : R × A → A) =
447388
(fun p ↦ p.1 • p.2 : R × B → B) ∘
448-
(Prod.map id ⇑φ.toAddMonoidHom) by ext; simp] at foo
449-
rw [Set.preimage_comp] at foo
450-
clear! aB -- easiest to just remove topology on B completely now
451-
have : ContinuousAdd A := isActionTopology_continuousAdd R A
452-
have := coinduced_prod_eq_prod_coinduced (AddMonoidHom.id R) φ.toAddMonoidHom (Function.surjective_id) hφ
453-
convert isOpenMap_of_coinduced (AddMonoidHom.prodMap (AddMonoidHom.id R) φ.toAddMonoidHom) (_) (_) (_) foo
454-
· -- aesop would do this if Function.surjective_id was known by it
389+
(Prod.map id ⇑φ.toAddMonoidHom) by ext; simp, Set.preimage_comp] at foo
390+
clear! aB -- easiest to just remove topology on B completely now so typeclass inference
391+
-- never sees it
392+
convert isOpenMap_of_coinduced (AddMonoidHom.prodMap (AddMonoidHom.id R) φ.toAddMonoidHom)
393+
(_) (_) (_) foo
394+
· -- aesop would do this if `Function.surjective_id : Surjective ⇑(AddMonoidHom.id R)`
395+
-- was known by it
455396
apply (Set.image_preimage_eq _ _).symm
456397
rw [AddMonoidHom.coe_prodMap, Prod.map_surjective]
457398
exact ⟨Function.surjective_id, by simp_all⟩
458399
· -- should `apply continuousprodmap ctrl-space` find `Continuous.prod_map`?
459-
apply @Continuous.prod_map _ _ _ _ (_) (_) (_) (_) id φ
460-
· exact continuous_id
461-
· rw [continuous_iff_coinduced_le, isActionTopology R A]
400+
apply @Continuous.prod_map _ _ _ _ (_) (_) (_) (_) id φ continuous_id
401+
rw [continuous_iff_coinduced_le, isActionTopology R A]
462402
· rw [← isActionTopology R A]
463-
exact this
403+
exact coinduced_prod_eq_prod_coinduced (AddMonoidHom.id R) φ.toAddMonoidHom
404+
(Function.surjective_id) hφ
464405
· apply @ContinuousAdd.mk _ (_)
465-
have foo : ContinuousAdd A := isActionTopology_continuousAdd R A
466-
let bar := foo
467-
obtain ⟨bar⟩ := bar
406+
obtain ⟨bar⟩ := isActionTopology_continuousAdd R A
468407
rw [continuous_def] at bar ⊢
469408
intro U hU
470409
rw [isOpen_coinduced, ← isActionTopology R A] at hU
471-
specialize bar _ hU
472-
rw [← Set.preimage_comp] at bar
473-
rw [show φ ∘ (fun p ↦ p.1 + p.2 : A × A → A) =
410+
specialize bar _ hU; clear hU
411+
rw [← Set.preimage_comp, show φ ∘ (fun p ↦ p.1 + p.2 : A × A → A) =
474412
(fun p ↦ p.1 + p.2 : B × B → B) ∘
475-
(Prod.map ⇑φ.toAddMonoidHom ⇑φ.toAddMonoidHom) by ext; simp] at bar
476-
rw [Set.preimage_comp] at bar
413+
(Prod.map ⇑φ.toAddMonoidHom ⇑φ.toAddMonoidHom) by ext; simp, Set.preimage_comp] at bar
477414
clear! aB -- easiest to just remove topology on B completely now
478-
have := coinduced_prod_eq_prod_coinduced (φ.toAddMonoidHom : A →+ B) φ.toAddMonoidHom hφ hφ
479-
convert isOpenMap_of_coinduced (AddMonoidHom.prodMap φ.toAddMonoidHom φ.toAddMonoidHom) (_) (_) (_) bar
415+
convert isOpenMap_of_coinduced (AddMonoidHom.prodMap φ.toAddMonoidHom φ.toAddMonoidHom)
416+
(_) (_) (_) bar
480417
· aesop
481-
· -- should `apply continuousprodmap ctrl-space` find `Continuous.prod_map`?
482-
apply @Continuous.prod_map _ _ _ _ (_) (_) (_) (_) <;>
418+
· apply @Continuous.prod_map _ _ _ _ (_) (_) (_) (_) <;>
483419
· rw [continuous_iff_coinduced_le, isActionTopology R A]; rfl
484420
· rw [← isActionTopology R A]
485-
exact this
421+
exact coinduced_prod_eq_prod_coinduced (φ.toAddMonoidHom : A →+ B) φ.toAddMonoidHom hφ hφ
486422

487423

488424
end topology_problem

FLT/ForMathlib/MiscLemmas.lean

+57
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,60 @@ lemma LinearMap.finsum_apply {R : Type*} [Semiring R] {A B : Type*} [AddCommMono
153153
· simp [finsum_of_isEmpty]
154154
· case h_option X _ hX =>
155155
simp [finsum_option, hX]
156+
157+
-- more continuous linear equiv stuff
158+
-- elsewhere
159+
variable (R : Type*) [Semiring R] in
160+
def LinearEquiv.sumPiEquivProdPi (S T : Type*) (A : S ⊕ T → Type*)
161+
[∀ st, AddCommGroup (A st)] [∀ st, Module R (A st)] :
162+
(∀ (st : S ⊕ T), A st) ≃ₗ[R] (∀ (s : S), A (.inl s)) × (∀ (t : T), A (.inr t)) where
163+
toFun f := (fun s ↦ f (.inl s), fun t ↦ f (.inr t))
164+
map_add' f g := by aesop
165+
map_smul' := by aesop
166+
invFun fg st := Sum.rec (fun s => fg.1 s) (fun t => fg.2 t) st
167+
left_inv := by intro x; aesop
168+
right_inv := by intro x; aesop
169+
170+
-- elsewhere
171+
def Homeomorph.sumPiEquivProdPi (S T : Type*) (A : S ⊕ T → Type*)
172+
[∀ st, TopologicalSpace (A st)] :
173+
(∀ (st : S ⊕ T), A st) ≃ₜ (∀ (s : S), A (.inl s)) × (∀ (t : T), A (.inr t)) where
174+
toFun f := (fun s ↦ f (.inl s), fun t ↦ f (.inr t))
175+
invFun fg st := Sum.rec (fun s => fg.1 s) (fun t => fg.2 t) st
176+
left_inv := by intro x; aesop
177+
right_inv := by intro x; aesop
178+
continuous_toFun := Continuous.prod_mk (by fun_prop) (by fun_prop)
179+
continuous_invFun := continuous_pi <| fun st ↦ by
180+
rcases st with s | t
181+
· simp
182+
fun_prop
183+
· simp
184+
fun_prop
185+
186+
-- elsewhere
187+
def Homeomorph.pUnitPiEquiv (f : PUnit → Type*) [∀ x, TopologicalSpace (f x)]: ((t : PUnit) → (f t)) ≃ₜ f () where
188+
toFun a := a ()
189+
invFun a _t := a
190+
left_inv x := by aesop
191+
right_inv x := by aesop
192+
continuous_toFun := by simp; fun_prop
193+
continuous_invFun := by simp; fun_prop
194+
195+
-- elsewhere
196+
variable (R : Type*) [Semiring R] in
197+
def LinearEquiv.pUnitPiEquiv (f : PUnit → Type*) [∀ x, AddCommGroup (f x)] [∀ x, Module R (f x)] :
198+
((t : PUnit) → (f t)) ≃ₗ[R] f () where
199+
toFun a := a ()
200+
invFun a _t := a
201+
left_inv x := by aesop
202+
right_inv x := by aesop
203+
map_add' f g := rfl
204+
map_smul' r f := rfl
205+
206+
-- elsewhere
207+
lemma finsum_apply {α ι N : Type*} [AddCommMonoid N] [Finite ι]
208+
(f : ι → α → N) (a : α) : (∑ᶠ i, f i) a = ∑ᶠ i, (f i) a := by
209+
classical
210+
simp only [finsum_def, dif_pos (Set.toFinite _), Finset.sum_apply]
211+
symm
212+
apply Finset.sum_subset <;> aesop

0 commit comments

Comments
 (0)