Skip to content

Commit 875c586

Browse files
mo271mcdollChrisHughes24
committed
feat: port Topology.Algebra.UniformField (#3049)
Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: Moritz Doll <moritz.doll@googlemail.com> Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>
1 parent dc37f26 commit 875c586

File tree

2 files changed

+221
-0
lines changed

2 files changed

+221
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,7 @@ import Mathlib.Topology.Algebra.Ring.Ideal
16601660
import Mathlib.Topology.Algebra.Semigroup
16611661
import Mathlib.Topology.Algebra.Star
16621662
import Mathlib.Topology.Algebra.StarSubalgebra
1663+
import Mathlib.Topology.Algebra.UniformField
16631664
import Mathlib.Topology.Algebra.UniformFilterBasis
16641665
import Mathlib.Topology.Algebra.UniformGroup
16651666
import Mathlib.Topology.Algebra.UniformMulAction
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
/-
2+
Copyright (c) 2019 Patrick Massot. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Patrick Massot
5+
6+
! This file was ported from Lean 3 source module topology.algebra.uniform_field
7+
! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.Topology.Algebra.UniformRing
12+
import Mathlib.Topology.Algebra.Field
13+
import Mathlib.FieldTheory.Subfield
14+
15+
/-!
16+
# Completion of topological fields
17+
18+
The goal of this file is to prove the main part of Proposition 7 of Bourbaki GT III 6.8 :
19+
20+
The completion `hat K` of a Hausdorff topological field is a field if the image under
21+
the mapping `x ↦ x⁻¹` of every Cauchy filter (with respect to the additive uniform structure)
22+
which does not have a cluster point at `0` is a Cauchy filter
23+
(with respect to the additive uniform structure).
24+
25+
Bourbaki does not give any detail here, he refers to the general discussion of extending
26+
functions defined on a dense subset with values in a complete Hausdorff space. In particular
27+
the subtlety about clustering at zero is totally left to readers.
28+
29+
Note that the separated completion of a non-separated topological field is the zero ring, hence
30+
the separation assumption is needed. Indeed the kernel of the completion map is the closure of
31+
zero which is an ideal. Hence it's either zero (and the field is separated) or the full field,
32+
which implies one is sent to zero and the completion ring is trivial.
33+
34+
The main definition is `CompletableTopField` which packages the assumptions as a Prop-valued
35+
type class and the main results are the instances `UniformSpace.Completion.Field` and
36+
`UniformSpace.Completion.TopologicalDivisionRing`.
37+
-/
38+
39+
40+
noncomputable section
41+
42+
open Classical uniformity Topology
43+
44+
open Set UniformSpace UniformSpace.Completion Filter
45+
46+
variable (K : Type _) [Field K] [UniformSpace K]
47+
48+
-- mathport name: exprhat
49+
local notation "hat" => Completion
50+
51+
/-- A topological field is completable if it is separated and the image under
52+
the mapping x ↦ x⁻¹ of every Cauchy filter (with respect to the additive uniform structure)
53+
which does not have a cluster point at 0 is a Cauchy filter
54+
(with respect to the additive uniform structure). This ensures the completion is
55+
a field.
56+
-/
57+
class CompletableTopField extends SeparatedSpace K : Prop where
58+
nice : ∀ F : Filter K, Cauchy F → 𝓝 0 ⊓ F = ⊥ → Cauchy (map (fun x => x⁻¹) F)
59+
#align completable_top_field CompletableTopField
60+
61+
namespace UniformSpace
62+
63+
namespace Completion
64+
65+
instance (priority := 100) [SeparatedSpace K] : Nontrivial (hat K) :=
66+
⟨⟨0, 1, fun h => zero_ne_one <| (uniformEmbedding_coe K).inj h⟩⟩
67+
68+
variable {K}
69+
70+
/-- extension of inversion to the completion of a field. -/
71+
def hatInv : hat K → hat K :=
72+
denseInducing_coe.extend fun x : K => (↑x⁻¹ : hat K)
73+
#align uniform_space.completion.hat_inv UniformSpace.Completion.hatInv
74+
75+
theorem continuous_hatInv [CompletableTopField K] {x : hat K} (h : x ≠ 0) : ContinuousAt hatInv x :=
76+
by
77+
haveI : T3Space (hat K) := Completion.t3Space K
78+
refine' denseInducing_coe.continuousAt_extend _
79+
apply mem_of_superset (compl_singleton_mem_nhds h)
80+
intro y y_ne
81+
rw [mem_compl_singleton_iff] at y_ne
82+
apply CompleteSpace.complete
83+
have : (fun (x : K) => (↑x⁻¹: hat K)) =
84+
((fun (y : K) => (↑y: hat K))∘(fun (x : K) => (x⁻¹ : K))) := by
85+
unfold Function.comp
86+
simp
87+
rw [this, ← Filter.map_map]
88+
apply Cauchy.map _ (Completion.uniformContinuous_coe K)
89+
apply CompletableTopField.nice
90+
· haveI := denseInducing_coe.comap_nhds_neBot y
91+
apply cauchy_nhds.comap
92+
· rw [Completion.comap_coe_eq_uniformity]
93+
· have eq_bot : 𝓝 (0 : hat K) ⊓ 𝓝 y = ⊥ := by
94+
by_contra h
95+
exact y_ne (eq_of_nhds_neBot <| neBot_iff.mpr h).symm
96+
erw [denseInducing_coe.nhds_eq_comap (0 : K), ← Filter.comap_inf, eq_bot]
97+
exact comap_bot
98+
#align uniform_space.completion.continuous_hat_inv UniformSpace.Completion.continuous_hatInv
99+
100+
/-
101+
The value of `hat_inv` at zero is not really specified, although it's probably zero.
102+
Here we explicitly enforce the `inv_zero` axiom.
103+
-/
104+
instance : Inv (hat K) :=
105+
fun x => if x = 0 then 0 else hatInv x⟩
106+
107+
variable [TopologicalDivisionRing K]
108+
109+
theorem hatInv_extends {x : K} (h : x ≠ 0) : hatInv (x : hat K) = ↑(x⁻¹ : K) :=
110+
denseInducing_coe.extend_eq_at ((continuous_coe K).continuousAt.comp (continuousAt_inv₀ h))
111+
#align uniform_space.completion.hat_inv_extends UniformSpace.Completion.hatInv_extends
112+
113+
variable [CompletableTopField K]
114+
115+
@[norm_cast]
116+
theorem coe_inv (x : K) : (x : hat K)⁻¹ = ((x⁻¹ : K) : hat K) := by
117+
by_cases h : x = 0
118+
· rw [h, inv_zero]
119+
dsimp [Inv.inv]
120+
norm_cast
121+
simp
122+
· conv_lhs => dsimp [Inv.inv]
123+
rw [if_neg]
124+
· exact hatInv_extends h
125+
· exact fun H => h (denseEmbedding_coe.inj H)
126+
#align uniform_space.completion.coe_inv UniformSpace.Completion.coe_inv
127+
128+
variable [UniformAddGroup K]
129+
130+
theorem mul_hatInv_cancel {x : hat K} (x_ne : x ≠ 0) : x * hatInv x = 1 := by
131+
haveI : T1Space (hat K) := T2Space.t1Space
132+
let f := fun x : hat K => x * hatInv x
133+
let c := (fun (x : K) => (x : hat K))
134+
change f x = 1
135+
have cont : ContinuousAt f x :=
136+
by
137+
letI : TopologicalSpace (hat K × hat K) := instTopologicalSpaceProd
138+
have : ContinuousAt (fun y : hat K => ((y, hatInv y) : hat K × hat K)) x :=
139+
continuous_id.continuousAt.prod (continuous_hatInv x_ne)
140+
exact (_root_.continuous_mul.continuousAt.comp this : _)
141+
have clo : x ∈ closure (c '' {0}ᶜ) :=
142+
by
143+
have := denseInducing_coe.dense x
144+
rw [← image_univ, show (univ : Set K) = {0} ∪ {0}ᶜ from (union_compl_self _).symm,
145+
image_union] at this
146+
apply mem_closure_of_mem_closure_union this
147+
rw [image_singleton]
148+
exact compl_singleton_mem_nhds x_ne
149+
have fxclo : f x ∈ closure (f '' (c '' {0}ᶜ)) := mem_closure_image cont clo
150+
have : f '' (c '' {0}ᶜ) ⊆ {1} := by
151+
rw [image_image]
152+
rintro _ ⟨z, z_ne, rfl⟩
153+
rw [mem_singleton_iff]
154+
rw [mem_compl_singleton_iff] at z_ne
155+
dsimp
156+
rw [hatInv_extends z_ne, ← coe_mul]
157+
rw [mul_inv_cancel z_ne, coe_one]
158+
replace fxclo := closure_mono this fxclo
159+
rwa [closure_singleton, mem_singleton_iff] at fxclo
160+
#align uniform_space.completion.mul_hat_inv_cancel UniformSpace.Completion.mul_hatInv_cancel
161+
162+
instance : Field (hat K) :=
163+
{ Completion.instInvCompletion,
164+
(by infer_instance : CommRing (hat K)) with
165+
exists_pair_ne := ⟨0, 1, fun h => zero_ne_one ((uniformEmbedding_coe K).inj h)⟩
166+
mul_inv_cancel := fun x x_ne => by simp only [Inv.inv, if_neg x_ne, mul_hatInv_cancel x_ne]
167+
inv_zero := by simp only [Inv.inv, ite_true] }
168+
169+
instance : TopologicalDivisionRing (hat K) :=
170+
{ Completion.topologicalRing with
171+
continuousAt_inv₀ := by
172+
intro x x_ne
173+
have : { y | hatInv y = y⁻¹ } ∈ 𝓝 x :=
174+
haveI : {(0 : hat K)}ᶜ ⊆ { y : hat K | hatInv y = y⁻¹ } := by
175+
intro y y_ne
176+
rw [mem_compl_singleton_iff] at y_ne
177+
dsimp [Inv.inv]
178+
rw [if_neg y_ne]
179+
mem_of_superset (compl_singleton_mem_nhds x_ne) this
180+
exact ContinuousAt.congr (continuous_hatInv x_ne) this }
181+
182+
end Completion
183+
184+
end UniformSpace
185+
186+
variable (L : Type _) [Field L] [UniformSpace L] [CompletableTopField L]
187+
188+
instance Subfield.completableTopField (K : Subfield L) : CompletableTopField K :=
189+
{ Subtype.separatedSpace (K : Set L) with
190+
nice := by
191+
intro F F_cau inf_F
192+
let i : K →+* L := K.subtype
193+
have hi : UniformInducing i := uniformEmbedding_subtype_val.toUniformInducing
194+
rw [← hi.cauchy_map_iff] at F_cau⊢
195+
rw [map_comm
196+
(show (i ∘ fun x => x⁻¹) = (fun x => x⁻¹) ∘ i
197+
by
198+
ext
199+
rfl)]
200+
apply CompletableTopField.nice _ F_cau
201+
rw [← Filter.push_pull', ← map_zero i, ← hi.inducing.nhds_eq_comap, inf_F, Filter.map_bot] }
202+
#align subfield.completable_top_field Subfield.completableTopField
203+
204+
instance (priority := 100) completableTopField_of_complete (L : Type _) [Field L] [UniformSpace L]
205+
[TopologicalDivisionRing L] [SeparatedSpace L] [CompleteSpace L] : CompletableTopField L :=
206+
{ ‹SeparatedSpace L› with
207+
nice := fun F cau_F hF => by
208+
haveI : NeBot F := cau_F.1
209+
rcases CompleteSpace.complete cau_F with ⟨x, hx⟩
210+
have hx' : x ≠ 0 := by
211+
rintro rfl
212+
rw [inf_eq_right.mpr hx] at hF
213+
exact cau_F.1.ne hF
214+
exact
215+
Filter.Tendsto.cauchy_map
216+
(calc
217+
map (fun x => x⁻¹) F ≤ map (fun x => x⁻¹) (𝓝 x) := map_mono hx
218+
_ ≤ 𝓝 x⁻¹ := continuousAt_inv₀ hx'
219+
) }
220+
#align completable_top_field_of_complete completableTopField_of_complete

0 commit comments

Comments
 (0)