-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathPullback.lean
More file actions
166 lines (122 loc) · 6.92 KB
/
Pullback.lean
File metadata and controls
166 lines (122 loc) · 6.92 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
/-
Copyright (c) 2026 Bingyu Xia. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bingyu Xia
-/
module
public import Mathlib.Algebra.AddTorsor.Defs
public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic
/-!
# Local Ring Properties of Equalizers and Pullbacks
In this file we provide basic lemmas for the equalizers the pullbacks and of ring homomorphisms
and algebra homomorphisms. We show that they preserve the property of being a local ring
under suitable conditions.
## Main definitions
* `RingHom.pullback`: The pullback of two ring homomorphisms `f : R →+* T` and `g : S →+* T`,
defined as the subring of `R × S` consisting of pairs `(r, s)` such that `f r = g s`.
* `RingHom.pullbackFst`, `RingHom.pullbackSnd`: The canonical projection maps from the
pullback to `R` and `S`.
## Main results
* `RingHom.isLocalRing_eqLocus`: The equalizer of two ring homomorphisms from a local
ring is again a local ring.
* `RingHom.isLocalRing_pullback`: The pullback of `f : R →+* T` and `g : S →+* T` is a
local ring, provided that `R` is a local ring and `g` is a local homomorphism.
-/
@[expose] public section
namespace RingHom
variable {R S T : Type*} [Ring R] [Ring S] [Semiring T]
theorem isUnit_eqLocus_mk_iff (f g : R →+* T) {r : R} (r_in : r ∈ f.eqLocus g) :
IsUnit (⟨r, r_in⟩ : f.eqLocus g) ↔ IsUnit r := by
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
· simp [isUnit_iff_exists, ← Subtype.val_inj] at h ⊢
grind
rw [mem_eqLocus] at r_in
obtain ⟨s, hs⟩ := isUnit_iff_exists.mp h
suffices ∃ a, r * a = 1 ∧ f a = g a ∧ a * r = 1 by simpa [isUnit_iff_exists, ← Subtype.val_inj]
refine ⟨s, hs.left, ?_, hs.right⟩
rw [← mul_one (f s), ← map_one g, ← hs.left, map_mul, ← mul_assoc, ← r_in, ← map_mul, hs.right,
map_one, one_mul]
theorem isLocalRing_eqLocus [IsLocalRing R] (f g : R →+* T) : IsLocalRing (f.eqLocus g) :=
Subring.isLocalRing_of_unit _ fun _ h ↦ (RingHom.isUnit_eqLocus_mk_iff f g h).mpr
/-- The subring of pairs `(r, s) : R × S` such that `f r = g s`, i.e.,
the pullback of f and g as a subring of R × S. -/
abbrev pullback (f : R →+* T) (g : S →+* T) : Subring (R × S) :=
(f.comp (RingHom.fst R S)).eqLocus <| g.comp (RingHom.snd R S)
/-- The first projection from the pullback of `f` and `g` to `A`. -/
abbrev pullbackFst (f : R →+* T) (g : S →+* T) : f.pullback g →+* R :=
(RingHom.fst R S).comp (RingHom.pullback f g).subtype
/-- The second projection from the pullback of `f` and `g` to `B`. -/
abbrev pullbackSnd (f : R →+* T) (g : S →+* T) : f.pullback g →+* S :=
(RingHom.snd R S).comp (f.pullback g).subtype
theorem pullback_comm_sq (f : R →+* T) (g : S →+* T) :
f.comp (f.pullbackFst g) = g.comp (f.pullbackSnd g) := ext fun x ↦ x.prop
theorem isUnit_pullback_mk_iff (f : R →+* T) (g : S →+* T) {a : R × S} (a_in : a ∈ f.pullback g) :
IsUnit (⟨a, a_in⟩ : f.pullback g) ↔ IsUnit a.1 ∧ IsUnit a.2 := by
rw [isUnit_eqLocus_mk_iff, Prod.isUnit_iff]
theorem isLocalHom_pullbackFst (f : R →+* T) (g : S →+* T) [IsLocalHom g] :
IsLocalHom (f.pullbackFst g) where
map_nonunit a ha := by
rcases a with ⟨⟨r, s⟩, hrs⟩
exact (isUnit_pullback_mk_iff f g _).mpr ⟨ha, isUnit_of_map_unit g _ (hrs ▸ ha.map f)⟩
theorem isLocalHom_pullbackSnd (f : R →+* T) (g : S →+* T) [IsLocalHom f] :
IsLocalHom (f.pullbackSnd g) where
map_nonunit a ha := by
rcases a with ⟨⟨r, s⟩, hrs⟩
exact (isUnit_pullback_mk_iff f g _).mpr ⟨isUnit_of_map_unit f _ (hrs.symm ▸ ha.map g), ha⟩
theorem surjective_pullbackFst_of_surjective (f : R →+* T) (g : S →+* T)
(h : Function.Surjective g) : Function.Surjective (f.pullbackFst g) :=
fun r ↦ by simpa [eq_comm] using h (f r)
theorem surjective_pullbackSnd_of_surjective (f : R →+* T) (g : S →+* T)
(h : Function.Surjective f) : Function.Surjective (f.pullbackSnd g) :=
fun s ↦ by simpa [eq_comm] using h (g s)
theorem isLocalRing_pullback [IsLocalRing R] (f : R →+* T) (g : S →+* T) (hg : IsLocalHom g) :
IsLocalRing (f.pullback g) where
isUnit_or_isUnit_of_add_one {a b} h := by
rcases a with ⟨⟨u, v⟩, huv⟩; rcases b with ⟨⟨s, t⟩, hst⟩
simp only [AddMemClass.mk_add_mk, Prod.mk_add_mk, ← Subtype.val_inj, OneMemClass.coe_one,
Prod.mk_eq_one] at h
simp only [RingHom.mem_eqLocus, RingHom.coe_comp, RingHom.coe_fst, Function.comp_apply,
RingHom.coe_snd] at huv hst
rcases IsLocalRing.isUnit_or_isUnit_of_add_one h.left with hu | hs
· have : IsUnit (g v) := by rw [← huv]; exact IsUnit.map f hu
apply IsLocalHom.map_nonunit at this
left; simpa [isUnit_pullback_mk_iff] using ⟨hu, this⟩
have : IsUnit (g t) := by rw [← hst]; exact IsUnit.map f hs
apply IsLocalHom.map_nonunit at this
right; simpa [isUnit_pullback_mk_iff] using ⟨hs, this⟩
end RingHom
namespace AlgHom
variable {R A B C : Type*} [CommSemiring R]
section Semiring
variable [Semiring A] [Algebra R A] [Semiring B] [Algebra R B] [Semiring C] [Algebra R C]
/-- The subalgebra of pairs `(a, b) : A × B` such that `f a = g b`, i.e.,
the pullback of f and g as a subalgebra of A × B. -/
abbrev pullback (f : A →ₐ[R] C) (g : B →ₐ[R] C) : Subalgebra R (A × B) := equalizer
(f.comp (fst R A B)) (g.comp (snd R A B))
/-- The first projection from the pullback of `f` and `g` to `A`. -/
abbrev pullbackFst (f : A →ₐ[R] C) (g : B →ₐ[R] C) : pullback f g →ₐ[R] A :=
(fst R A B).comp (pullback f g).val
/-- The second projection from the pullback of `f` and `g` to `B`. -/
abbrev pullbackSnd (f : A →ₐ[R] C) (g : B →ₐ[R] C) : pullback f g →ₐ[R] B :=
(snd R A B).comp (pullback f g).val
theorem pullback_comm_sq (f : A →ₐ[R] C) (g : B →ₐ[R] C) :
f.comp (pullbackFst f g) = g.comp (pullbackSnd f g) :=
AlgHom.ext fun x ↦ x.prop
end Semiring
section Ring
variable [Ring A] [Algebra R A] [Ring B] [Algebra R B] [Semiring C] [Algebra R C]
theorem isUnit_pullback_mk_iff (f : A →ₐ[R] C) (g : B →ₐ[R] C) {a : A × B}
(a_in : a ∈ f.pullback g) : IsUnit (⟨a, a_in⟩ : f.pullback g) ↔
IsUnit a.1 ∧ IsUnit a.2 :=
RingHom.isUnit_pullback_mk_iff (f : A →+* C) (g : B →+* C) a_in
theorem surjective_pullbackFst_of_surjective (f : A →ₐ[R] C) (g : B →ₐ[R] C)
(h : Function.Surjective g) : Function.Surjective (pullbackFst f g) :=
RingHom.surjective_pullbackFst_of_surjective (f : A →+* C) (g : B →+* C) h
theorem surjective_pullbackSnd_of_surjective (f : A →ₐ[R] C) (g : B →ₐ[R] C)
(h : Function.Surjective f) : Function.Surjective (pullbackSnd f g) :=
RingHom.surjective_pullbackSnd_of_surjective (f : A →+* C) (g : B →+* C) h
theorem isLocalRing_pullback [IsLocalRing A] (f : A →ₐ[R] C) (g : B →ₐ[R] C) (hg : IsLocalHom g) :
IsLocalRing (f.pullback g) :=
RingHom.isLocalRing_pullback f.toRingHom g.toRingHom ⟨hg.map_nonunit⟩
end Ring
end AlgHom