Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a12d5a1

Browse files
committed
feat(linear_algebra,ring_theory): refactoring modules (#456)
Co-authored with Kenny Lau. See also https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/module.20refactoring for discussion. Major changes made: - `semimodule α β` and `module α β` and `vector_space α β` now take one more argument, that `β` is an `add_comm_group`, i.e. before making an instance of a module, you need to prove that it's an abelian group first. - vector space is no longer over a field, but a discrete field. - The idiom for making an instance `module α β` (after proving that `β` is an abelian group) is `module.of_core { smul := sorry, smul_add := sorry, add_smul := sorry, mul_smul := sorry, one_smul := sorry }`. - `is_linear_map` and `linear_map` are now both structures, and they are independent, meaning that `linear_map` is no longer defined as `subtype is_linear_map`. The idiom for making `linear_map` from `is_linear_map` is `is_linear_map.mk' (f : M -> N) (sorry : is_linear_map f)`, and the idiom for making `is_linear_map` from `linear_map` is `f.is_linear` (i.e. `linear_map.is_linear f`). - `is_linear_map.add` etc no longer exist. instead, you can now add two linear maps together, etc. - the class`is_submodule` is gone, replaced by the structure `submodule` which contains a carrier, i.e. if `N : submodule R M` then `N.carrier` is a type. And there is an instance `module R N` in the same situation. - similarly, the class `is_ideal` is gone, replaced by the structure `ideal`, which also contains a carrier. - endomorphism ring and general linear group are defined. - submodules form a complete lattice. the trivial ideal is now idiomatically the bottom element, and the universal ideal the top element. - `linear_algebra/quotient_module.lean` is deleted, and it's now `submodule.quotient` (so if `N : submodule R M` then `submodule R N.quotient`) Similarly, `quotient_ring.quotient` is replaced by `ideal.quotient`. The canonical map from `N` to `N.quotient` is `submodule.quotient.mk`, and the canonical map from the ideal `I` to `I.quotient` is `ideal.quotient.mk I`. - `linear_equiv` is now based on a linear map and an equiv, and the difference being that now you need to prove that the inverse is also linear, and there is currently no interface to get around that. - Everything you want to know about linear independence and basis is now in the newly created file `linear_algebra/basis.lean`. - Everything you want to know about linear combinations is now in the newly created file `linear_algebra/lc.lean`. - `linear_algebra/linear_map_module.lean` and `linear_algebra/prod_module.lean` and `linear_algebra/quotient_module.lean` and `linear_algebra/submodule.lean` and `linear_algebra/subtype_module.lean` are deleted (with their contents placed elsewhere). squashed commits: * feat(linear_algebra/basic): product modules, cat/lat structure * feat(linear_algebra/basic): refactoring quotient_module * feat(linear_algebra/basic): merge in submodule.lean * feat(linear_algebra/basic): merge in linear_map_module.lean * refactor(linear_algebra/dimension): update for new modules * feat(ring_theory/ideals): convert ideals * refactor tensor product * simplify local ring proof for Zp * refactor(ring_theory/noetherian) * refactor(ring_theory/localization) * refactor(linear_algebra/tensor_product) * feat(data/polynomial): lcoeff
1 parent 37c0d53 commit a12d5a1

38 files changed

+2957
-2551
lines changed

algebra/module.lean

Lines changed: 173 additions & 158 deletions
Large diffs are not rendered by default.

algebra/order.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ lt_of_le_not_le h₁ $ mt (le_antisymm h₁) h₂
2222
lemma lt_iff_le_and_ne [partial_order α] {a b : α} : a < b ↔ a ≤ b ∧ a ≠ b :=
2323
⟨λ h, ⟨le_of_lt h, ne_of_lt h⟩, λ ⟨h1, h2⟩, lt_of_le_of_ne h1 h2⟩
2424

25+
lemma eq_iff_le_not_lt [partial_order α] {a b : α} : a = b ↔ a ≤ b ∧ ¬ a < b :=
26+
⟨λ h, ⟨le_of_eq h, h ▸ lt_irrefl _⟩, λ ⟨h₁, h₂⟩, le_antisymm h₁ $
27+
classical.by_contradiction $ λ h₃, h₂ (lt_of_le_not_le h₁ h₃)⟩
28+
2529
lemma eq_or_lt_of_le [partial_order α] {a b : α} (h : a ≤ b) : a = b ∨ a < b :=
2630
(lt_or_eq_of_le h).symm
2731

algebra/pi_instances.lean

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ instance add_comm_group [∀ i, add_comm_group $ f i] : add_comm_group
6161
instance ring [∀ i, ring $ f i] : ring (Π i : I, f i) := by pi_instance
6262
instance comm_ring [∀ i, comm_ring $ f i] : comm_ring (Π i : I, f i) := by pi_instance
6363

64-
instance semimodule (α) {r : semiring α} [∀ i, semimodule α $ f i] : semimodule α (Π i : I, f i) := by pi_instance
65-
instance module (α) {r : ring α} [∀ i, module α $ f i] : module α (Π i : I, f i) := {..pi.semimodule α}
66-
instance vector_space (α) {r : field α} [∀ i, vector_space α $ f i] : vector_space α (Π i : I, f i) := {..pi.module α}
64+
instance semimodule (α) {r : semiring α} [∀ i, add_comm_monoid $ f i] [∀ i, semimodule α $ f i] : semimodule α (Π i : I, f i) := by pi_instance
65+
instance module (α) {r : ring α} [∀ i, add_comm_group $ f i] [∀ i, module α $ f i] : module α (Π i : I, f i) := {..pi.semimodule α}
66+
instance vector_space (α) {r : discrete_field α} [∀ i, add_comm_group $ f i] [∀ i, vector_space α $ f i] : vector_space α (Π i : I, f i) := {..pi.module α}
6767

6868
instance left_cancel_semigroup [∀ i, left_cancel_semigroup $ f i] : left_cancel_semigroup (Π i : I, f i) :=
6969
by pi_instance
@@ -113,7 +113,6 @@ variables {α : Type*} {β : Type*} {γ : Type*} {δ : Type*} {p q : α × β}
113113

114114
instance [has_add α] [has_add β] : has_add (α × β) :=
115115
⟨λp q, (p.1 + q.1, p.2 + q.2)⟩
116-
117116
@[to_additive prod.has_add]
118117
instance [has_mul α] [has_mul β] : has_mul (α × β) :=
119118
⟨λp q, (p.1 * q.1, p.2 * q.2)⟩
@@ -122,26 +121,31 @@ instance [has_mul α] [has_mul β] : has_mul (α × β) :=
122121
lemma fst_mul [has_mul α] [has_mul β] : (p * q).1 = p.1 * q.1 := rfl
123122
@[simp, to_additive prod.snd_add]
124123
lemma snd_mul [has_mul α] [has_mul β] : (p * q).2 = p.2 * q.2 := rfl
124+
@[simp, to_additive prod.mk_add_mk]
125+
lemma mk_mul_mk [has_mul α] [has_mul β] (a₁ a₂ : α) (b₁ b₂ : β) :
126+
(a₁, b₁) * (a₂, b₂) = (a₁ * a₂, b₁ * b₂) := rfl
125127

126128
instance [has_zero α] [has_zero β] : has_zero (α × β) := ⟨(0, 0)⟩
127-
128129
@[to_additive prod.has_zero]
129130
instance [has_one α] [has_one β] : has_one (α × β) := ⟨(1, 1)⟩
130131

131132
@[simp, to_additive prod.fst_zero]
132133
lemma fst_one [has_one α] [has_one β] : (1 : α × β).1 = 1 := rfl
133134
@[simp, to_additive prod.snd_zero]
134135
lemma snd_one [has_one α] [has_one β] : (1 : α × β).2 = 1 := rfl
136+
@[to_additive prod.zero_eq_mk]
137+
lemma one_eq_mk [has_one α] [has_one β] : (1 : α × β) = (1, 1) := rfl
135138

136139
instance [has_neg α] [has_neg β] : has_neg (α × β) := ⟨λp, (- p.1, - p.2)⟩
137-
138140
@[to_additive prod.has_neg]
139141
instance [has_inv α] [has_inv β] : has_inv (α × β) := ⟨λp, (p.1⁻¹, p.2⁻¹)⟩
140142

141143
@[simp, to_additive prod.fst_neg]
142144
lemma fst_inv [has_inv α] [has_inv β] : (p⁻¹).1 = (p.1)⁻¹ := rfl
143145
@[simp, to_additive prod.snd_neg]
144146
lemma snd_inv [has_inv α] [has_inv β] : (p⁻¹).2 = (p.2)⁻¹ := rfl
147+
@[to_additive prod.neg_mk]
148+
lemma inv_mk [has_inv α] [has_inv β] (a : α) (b : β) : (a, b)⁻¹ = (a⁻¹, b⁻¹) := rfl
145149

146150
instance [add_semigroup α] [add_semigroup β] : add_semigroup (α × β) :=
147151
{ add_assoc := assume a b c, mk.inj_iff.mpr ⟨add_assoc _ _ _, add_assoc _ _ _⟩,
@@ -252,14 +256,28 @@ by constructor; simp [inl, inr] {contextual := tt}
252256

253257
instance [has_scalar α β] [has_scalar α γ] : has_scalar α (β × γ) := ⟨λa p, (a • p.1, a • p.2)⟩
254258

255-
instance {r : ring α} [module α β] [module α γ] : module α (β × γ) :=
256-
{ smul_add := assume a p₁ p₂, mk.inj_iff.mpr ⟨smul_add, smul_add⟩,
257-
add_smul := assume a p₁ p₂, mk.inj_iff.mpr ⟨add_smul, add_smul⟩,
258-
mul_smul := assume a₁ a₂ p, mk.inj_iff.mpr ⟨mul_smul, mul_smul⟩,
259-
one_smul := assume ⟨b, c⟩, mk.inj_iff.mpr ⟨one_smul, one_smul⟩,
259+
@[simp] theorem smul_fst [has_scalar α β] [has_scalar α γ]
260+
(a : α) (x : β × γ) : (a • x).1 = a • x.1 := rfl
261+
@[simp] theorem smul_snd [has_scalar α β] [has_scalar α γ]
262+
(a : α) (x : β × γ) : (a • x).2 = a • x.2 := rfl
263+
@[simp] theorem smul_mk [has_scalar α β] [has_scalar α γ]
264+
(a : α) (b : β) (c : γ) : a • (b, c) = (a • b, a • c) := rfl
265+
266+
instance {r : semiring α} [add_comm_monoid β] [add_comm_monoid γ]
267+
[semimodule α β] [semimodule α γ] : semimodule α (β × γ) :=
268+
{ smul_add := assume a p₁ p₂, mk.inj_iff.mpr ⟨smul_add _ _ _, smul_add _ _ _⟩,
269+
add_smul := assume a p₁ p₂, mk.inj_iff.mpr ⟨add_smul _ _ _, add_smul _ _ _⟩,
270+
mul_smul := assume a₁ a₂ p, mk.inj_iff.mpr ⟨mul_smul _ _ _, mul_smul _ _ _⟩,
271+
one_smul := assume ⟨b, c⟩, mk.inj_iff.mpr ⟨one_smul _, one_smul _⟩,
272+
zero_smul := assume ⟨b, c⟩, mk.inj_iff.mpr ⟨zero_smul _, zero_smul _⟩,
273+
smul_zero := assume a, mk.inj_iff.mpr ⟨smul_zero _, smul_zero _⟩,
260274
.. prod.has_scalar }
261275

262-
instance {r : field α} [vector_space α β] [vector_space α γ] : vector_space α (β × γ) := {}
276+
instance {r : ring α} [add_comm_group β] [add_comm_group γ]
277+
[module α β] [module α γ] : module α (β × γ) := {}
278+
279+
instance {r : discrete_field α} [add_comm_group β] [add_comm_group γ]
280+
[vector_space α β] [vector_space α γ] : vector_space α (β × γ) := {}
263281

264282
end prod
265283

@@ -271,4 +289,4 @@ lemma prod_mk_prod {α β γ : Type*} [comm_monoid α] [comm_monoid β] (s : fin
271289
by haveI := classical.dec_eq γ; exact
272290
finset.induction_on s rfl (by simp [prod.ext_iff] {contextual := tt})
273291

274-
end finset
292+
end finset

analysis/bounded_linear_maps.lean

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mul_inv_eq hb ha
1717
noncomputable theory
1818
local attribute [instance] classical.prop_decidable
1919

20-
local notation f `→_{`:50 a `}`:0 b := filter.tendsto f (nhds a) (nhds b)
20+
local notation f ` →_{`:50 a `} `:0 b := filter.tendsto f (nhds a) (nhds b)
2121

2222
open filter (tendsto)
2323

@@ -44,13 +44,13 @@ lemma is_linear_map.with_bound
4444
namespace is_bounded_linear_map
4545

4646
lemma zero : is_bounded_linear_map (λ (x:E), (0:F)) :=
47-
is_linear_map.map_zero.with_bound 0 $ by simp [le_refl]
47+
(0 : E →ₗ F).is_linear.with_bound 0 $ by simp [le_refl]
4848

4949
lemma id : is_bounded_linear_map (λ (x:E), x) :=
50-
is_linear_map.id.with_bound 1 $ by simp [le_refl]
50+
linear_map.id.is_linear.with_bound 1 $ by simp [le_refl]
5151

5252
lemma smul {f : E → F} (c : k) : is_bounded_linear_map f → is_bounded_linear_map (λ e, c • f e)
53-
| ⟨hf, ⟨M, hM, h⟩⟩ := hf.map_smul_right.with_bound (∥c∥ * M) $ assume x,
53+
| ⟨hf, ⟨M, hM, h⟩⟩ := (c • hf.mk' f).is_linear.with_bound (∥c∥ * M) $ assume x,
5454
calc ∥c • f x∥ = ∥c∥ * ∥f x∥ : norm_smul c (f x)
5555
... ≤ ∥c∥ * (M * ∥x∥) : mul_le_mul_of_nonneg_left (h x) (norm_nonneg c)
5656
... = (∥c∥ * M) * ∥x∥ : (mul_assoc _ _ _).symm
@@ -63,7 +63,7 @@ end
6363

6464
lemma add {f : E → F} {g : E → F} :
6565
is_bounded_linear_map f → is_bounded_linear_map g → is_bounded_linear_map (λ e, f e + g e)
66-
| ⟨hlf, Mf, hMf, hf⟩ ⟨hlg, Mg, hMg, hg⟩ := (hlf.map_add hlg).with_bound (Mf + Mg) $ assume x,
66+
| ⟨hlf, Mf, hMf, hf⟩ ⟨hlg, Mg, hMg, hg⟩ := (hlf.mk' _ + hlg.mk' _).is_linear.with_bound (Mf + Mg) $ assume x,
6767
calc ∥f x + g x∥ ≤ ∥f x∥ + ∥g x∥ : norm_triangle _ _
6868
... ≤ Mf * ∥x∥ + Mg * ∥x∥ : add_le_add (hf x) (hg x)
6969
... ≤ (Mf + Mg) * ∥x∥ : by rw add_mul
@@ -73,15 +73,15 @@ lemma sub {f : E → F} {g : E → F} (hf : is_bounded_linear_map f) (hg : is_bo
7373

7474
lemma comp {f : E → F} {g : F → G} :
7575
is_bounded_linear_map g → is_bounded_linear_map f → is_bounded_linear_map (g ∘ f)
76-
| ⟨hlg, Mg, hMg, hg⟩ ⟨hlf, Mf, hMf, hf⟩ := (hlg.comp hlf).with_bound (Mg * Mf) $ assume x,
76+
| ⟨hlg, Mg, hMg, hg⟩ ⟨hlf, Mf, hMf, hf⟩ := ((hlg.mk' _).comp (hlf.mk' _)).is_linear.with_bound (Mg * Mf) $ assume x,
7777
calc ∥g (f x)∥ ≤ Mg * ∥f x∥ : hg _
7878
... ≤ Mg * (Mf * ∥x∥) : mul_le_mul_of_nonneg_left (hf _) (le_of_lt hMg)
7979
... = Mg * Mf * ∥x∥ : (mul_assoc _ _ _).symm
8080

81-
lemma tendsto {L : E → F} (x : E) : is_bounded_linear_map L → tendsto L (nhds x) (nhds (L x))
81+
lemma tendsto {L : E → F} (x : E) : is_bounded_linear_map L → L →_{x} (L x)
8282
| ⟨hL, M, hM, h_ineq⟩ := tendsto_iff_norm_tendsto_zero.2 $
8383
squeeze_zero (assume e, norm_nonneg _)
84-
(assume e, calc ∥L e - L x∥ = ∥L (e - x)∥ : by rw hL.sub e x
84+
(assume e, calc ∥L e - L x∥ = ∥hL.mk' L (e - x)∥ : by rw (hL.mk' _).map_sub e x; refl
8585
... ≤ M*∥e-x∥ : h_ineq (e-x))
8686
(suffices (λ (e : E), M * ∥e - x∥) →_{x} (M * 0), by simpa,
8787
tendsto_mul tendsto_const_nhds (lim_norm _))
@@ -90,7 +90,7 @@ lemma continuous {L : E → F} (hL : is_bounded_linear_map L) : continuous L :=
9090
continuous_iff_tendsto.2 $ assume x, hL.tendsto x
9191

9292
lemma lim_zero_bounded_linear_map {L : E → F} (H : is_bounded_linear_map L) : (L →_{0} 0) :=
93-
by simpa [H.to_is_linear_map.zero] using continuous_iff_tendsto.1 H.continuous 0
93+
(H.1.mk' _).map_zero ▸ continuous_iff_tendsto.1 H.continuous 0
9494

9595
end is_bounded_linear_map
9696

@@ -99,9 +99,10 @@ lemma bounded_continuous_linear_map
9999
{E : Type*} [normed_space ℝ E] {F : Type*} [normed_space ℝ F] {L : E → F}
100100
(lin : is_linear_map L) (cont : continuous L) : is_bounded_linear_map L :=
101101
let ⟨δ, δ_pos, hδ⟩ := exists_delta_of_continuous cont zero_lt_one 0 in
102-
have H : ∀{a}, ∥a∥ ≤ δ → ∥L a∥ < 1, by simpa [lin.zero, dist_zero_right] using hδ,
102+
have HL0 : L 0 = 0, from (lin.mk' _).map_zero,
103+
have H : ∀{a}, ∥a∥ ≤ δ → ∥L a∥ < 1, by simpa only [HL0, dist_zero_right] using hδ,
103104
lin.with_bound (δ⁻¹) $ assume x,
104-
classical.by_cases (assume : x = 0, by simp [this, lin.zero]) $
105+
classical.by_cases (assume : x = 0, by simp only [this, HL0, norm_zero, mul_zero]) $
105106
assume h : x ≠ 0,
106107
let p := ∥x∥ * δ⁻¹, q := p⁻¹ in
107108
have p_inv : p⁻¹ = δ*∥x∥⁻¹, by simp,

analysis/normed_space.lean

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Authors: Patrick Massot, Johannes Hölzl
77
-/
88

99
import algebra.pi_instances
10-
import linear_algebra.prod_module
10+
import linear_algebra.basic
1111
import analysis.nnreal
1212
variables {α : Type*} {β : Type*} {γ : Type*} {ι : Type*}
1313

@@ -285,25 +285,17 @@ end normed_field
285285
section normed_space
286286

287287
class normed_space (α : out_param $ Type*) (β : Type*) [out_param $ normed_field α]
288-
extends has_norm β , vector_space α β, metric_space β :=
289-
(dist_eq : ∀ x y, dist x y = norm (x - y))
288+
extends normed_group β, vector_space α β :=
290289
(norm_smul : ∀ a b, norm (a • b) = has_norm.norm a * norm b)
291290

292291
variables [normed_field α]
293292

294-
instance normed_space.to_normed_group [i : normed_space α β] : normed_group β :=
295-
by refine { add := (+),
296-
dist_eq := normed_space.dist_eq,
297-
zero := 0,
298-
neg := λ x, -x,
299-
..i, .. }; simp
300-
301293
instance normed_field.to_normed_space : normed_space α α :=
302294
{ dist_eq := normed_field.dist_eq,
303295
norm_smul := normed_field.norm_mul }
304296

305297
lemma norm_smul [normed_space α β] (s : α) (x : β) : ∥s • x∥ = ∥s∥ * ∥x∥ :=
306-
normed_space.norm_smul _ _
298+
normed_space.norm_smul s x
307299

308300
lemma nnnorm_smul [normed_space α β] (s : α) (x : β) : nnnorm (s • x) = nnnorm s * nnnorm x :=
309301
nnreal.eq $ norm_smul s x

analysis/topology/quotient_topological_structures.lean

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ attribute [instance] topological_add_group_quotient
113113
end topological_group
114114

115115
section ideal_is_add_subgroup
116-
variables [comm_ring α] {M : Type*} [module α M] (N : set α) [is_submodule N]
116+
variables [comm_ring α] {M : Type*} [add_comm_group M] [module α M] (N : submodule α M)
117117

118-
instance submodule_is_add_subgroup : is_add_subgroup N :=
119-
{ zero_mem := is_submodule.zero,
120-
add_mem := λ a b, is_submodule.add,
121-
neg_mem := λ a, is_submodule.neg}
118+
instance submodule_is_add_subgroup : is_add_subgroup N :=
119+
{ zero_mem := N.zero,
120+
add_mem := N.add,
121+
neg_mem := λ _, N.neg_mem }
122122

123123
end ideal_is_add_subgroup
124124

@@ -129,34 +129,34 @@ instance normal_subgroup_of_comm [comm_group α] (s : set α) [hs : is_subgroup
129129
attribute [instance] normal_add_subgroup_of_comm
130130

131131
section topological_ring
132-
variables [topological_space α] [comm_ring α] [topological_ring α] (N : set α) [is_ideal N]
133-
open quotient_ring
132+
variables [topological_space α] [comm_ring α] [topological_ring α] (N : ideal α)
133+
open ideal.quotient
134134

135-
instance topological_ring_quotient_topology : topological_space (quotient N) :=
136-
by dunfold quotient_ring.quotient ; apply_instance
135+
instance topological_ring_quotient_topology : topological_space N.quotient :=
136+
by dunfold ideal.quotient submodule.quotient; apply_instance
137137

138138
-- this should be quotient_add_saturate ...
139139
lemma quotient_ring_saturate (s : set α) :
140-
(coe : α → quotient N) ⁻¹' ((coe : α → quotient N) '' s) = (⋃ x : N, (λ y, x.1 + y) '' s) :=
140+
mk N ⁻¹' (mk N '' s) = (⋃ x : N, (λ y, x.1 + y) '' s) :=
141141
begin
142142
ext x,
143-
simp only [mem_preimage_eq, mem_image, mem_Union, quotient_ring.eq],
143+
simp only [mem_preimage_eq, mem_image, mem_Union, ideal.quotient.eq],
144144
split,
145-
{ exact assume ⟨a, a_in, h⟩, ⟨⟨_, is_ideal.neg_iff.1 h⟩, a, a_in, by simp⟩ },
145+
{ exact assume ⟨a, a_in, h⟩, ⟨⟨_, N.neg_mem h⟩, a, a_in, by simp⟩ },
146146
{ exact assume ⟨⟨i, hi⟩, a, ha, eq⟩, ⟨a, ha,
147-
by simp only [eq.symm, -sub_eq_add_neg, add_comm i a, sub_add_eq_sub_sub, sub_self, zero_sub,
148-
is_ideal.neg_iff.symm, hi]⟩ }
147+
by rw [← eq, sub_add_eq_sub_sub_swap, sub_self, zero_sub];
148+
exact N.neg_mem hi⟩ }
149149
end
150150

151-
lemma quotient_ring.is_open_map_coe : is_open_map (coe : α → quotient N) :=
151+
lemma quotient_ring.is_open_map_coe : is_open_map (mk N) :=
152152
begin
153153
assume s s_op,
154-
show is_open ((coe : α → quotient N) ⁻¹' (coe '' s)),
154+
show is_open (mk N ⁻¹' (mk N '' s)),
155155
rw quotient_ring_saturate N s,
156156
exact is_open_Union (assume ⟨n, _⟩, is_open_map_add_left n s s_op)
157157
end
158158

159-
lemma quotient_ring.quotient_map_coe_coe : quotient_map (λ p : α × α, ((p.1:quotient N), (p.2:quotient N))) :=
159+
lemma quotient_ring.quotient_map_coe_coe : quotient_map (λ p : α × α, (mk N p.1, mk N p.2)) :=
160160
begin
161161
apply is_open_map.to_quotient_map,
162162
{ exact is_open_map.prod (quotient_ring.is_open_map_coe N) (quotient_ring.is_open_map_coe N) },
@@ -167,14 +167,14 @@ begin
167167
exact ⟨(x, y), rfl⟩ }
168168
end
169169

170-
instance topological_ring_quotient : topological_ring (quotient N) :=
170+
instance topological_ring_quotient : topological_ring N.quotient :=
171171
{ continuous_add :=
172-
have cont : continuous ((coe : α → quotient N) ∘ (λ (p : α × α), p.fst + p.snd)) :=
172+
have cont : continuous (mk N ∘ (λ (p : α × α), p.fst + p.snd)) :=
173173
continuous.comp continuous_add' continuous_quot_mk,
174174
(quotient_map.continuous_iff (quotient_ring.quotient_map_coe_coe N)).2 cont,
175175
continuous_neg := continuous_quotient_lift _ (continuous.comp continuous_neg' continuous_quot_mk),
176176
continuous_mul :=
177-
have cont : continuous ((coe : α → quotient N) ∘ (λ (p : α × α), p.fst * p.snd)) :=
177+
have cont : continuous (mk N ∘ (λ (p : α × α), p.fst * p.snd)) :=
178178
continuous.comp continuous_mul' continuous_quot_mk,
179179
(quotient_map.continuous_iff (quotient_ring.quotient_map_coe_coe N)).2 cont }
180180

@@ -183,16 +183,16 @@ end topological_ring
183183
namespace uniform_space
184184

185185
lemma ring_sep_rel (α) [comm_ring α] [uniform_space α] [uniform_add_group α] [topological_ring α] :
186-
separation_setoid α = quotient_ring.quotient_rel (closure $ is_ideal.trivial α) :=
186+
separation_setoid α = submodule.quotient_rel (ideal.closure ) :=
187187
setoid.ext $ assume x y, group_separation_rel x y
188188

189189
lemma ring_sep_quot (α) [r : comm_ring α] [uniform_space α] [uniform_add_group α] [topological_ring α] :
190-
quotient (separation_setoid α) = quotient_ring.quotient (closure $ is_ideal.trivial α) :=
190+
quotient (separation_setoid α) = (⊥ : ideal α).closure.quotient :=
191191
by rw [@ring_sep_rel α r]; refl
192192

193193
def sep_quot_equiv_ring_quot (α)
194194
[r : comm_ring α] [uniform_space α] [uniform_add_group α] [topological_ring α] :
195-
quotient (separation_setoid α) ≃ quotient_ring.quotient (closure $ is_ideal.trivial α) :=
195+
quotient (separation_setoid α) ≃ (⊥ : ideal α).closure.quotient :=
196196
quotient.congr $ assume x y, group_separation_rel x y
197197

198198
/- TODO: use a form of transport a.k.a. lift definition a.k.a. transfer -/
@@ -203,7 +203,7 @@ by rw ring_sep_quot α; apply_instance
203203
instance [comm_ring α] [uniform_space α] [uniform_add_group α] [topological_ring α] :
204204
topological_ring (quotient (separation_setoid α)) :=
205205
begin
206-
convert topological_ring_quotient (closure (is_ideal.trivial α)),
206+
convert topological_ring_quotient (⊥ : ideal α).closure,
207207
{ apply ring_sep_rel },
208208
{ dsimp [topological_ring_quotient_topology, quotient.topological_space, to_topological_space],
209209
congr,

analysis/topology/topological_structures.lean

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,19 @@ end topological_ring
406406

407407
section topological_comm_ring
408408
universe u'
409-
variables (α) [topological_space α] [comm_ring α] [topological_ring α]
409+
variables [topological_space α] [comm_ring α] [topological_ring α]
410410

411-
instance ideal_closure (S : set α) [is_ideal S] : is_ideal (closure S) :=
412-
{ zero_ := subset_closure (is_ideal.zero S),
413-
add_ := assume x y hx hy,
414-
mem_closure2 continuous_add' hx hy $ assume a b, is_ideal.add,
411+
def ideal.closure (S : ideal α) : ideal α :=
412+
{ carrier := closure S,
413+
zero := subset_closure S.zero_mem,
414+
add := assume x y hx hy,
415+
mem_closure2 continuous_add' hx hy $ assume a b, S.add_mem,
415416
smul := assume c x hx,
416417
have continuous (λx:α, c * x) := continuous_mul continuous_const continuous_id,
417-
mem_closure this hx $ assume a, is_ideal.mul_left }
418+
mem_closure this hx $ assume a, S.mul_mem_left }
419+
420+
@[simp] lemma ideal.coe_closure (S : ideal α) :
421+
(S.closure : set α) = closure S := rfl
418422

419423
end topological_comm_ring
420424

0 commit comments

Comments
 (0)