@@ -17,6 +17,18 @@ also contains unrelated results about `Units` that depend on `MonoidHom`.
17
17
* `Units.map`: Turn a homomorphism from `α` to `β` monoids into a homomorphism from `αˣ` to `βˣ`.
18
18
* `MonoidHom.toHomUnits`: Turn a homomorphism from a group `α` to `β` into a homomorphism from
19
19
`α` to `βˣ`.
20
+ * `IsLocalRingHom`: A predicate on monoid maps, requiring that it maps nonunits
21
+ to nonunits. For local rings, this means that the image of the unique maximal ideal is again
22
+ contained in the unique maximal ideal. This is developed earlier, and in the generality of
23
+ monoids, as it allows its use in non-local-ring related contexts, but it does have the
24
+ strange consequence that it does not require local rings, or even rings.
25
+
26
+ ## TODO
27
+
28
+ The results that don't mention homomorphisms should be proved (earlier?) in a different file and be
29
+ used to golf the basic `Group` lemmas.
30
+
31
+ Add a `@[to_additive]` version of `IsLocalRingHom`.
20
32
-/
21
33
22
34
assert_not_exists MonoidWithZero
@@ -167,6 +179,7 @@ theorem of_leftInverse [MonoidHomClass G N M] {f : F} {x : M} (g : G)
167
179
(hfg : Function.LeftInverse g f) (h : IsUnit (f x)) : IsUnit x := by
168
180
simpa only [hfg x] using h.map g
169
181
182
+ /-- Prefer `IsLocalRingHom.of_leftInverse`, but we can't get rid of this because of `ToAdditive`. -/
170
183
@[to_additive]
171
184
theorem _root_.isUnit_map_of_leftInverse [MonoidHomClass F M N] [MonoidHomClass G N M]
172
185
{f : F} {x : M} (g : G) (hfg : Function.LeftInverse g f) :
@@ -194,3 +207,49 @@ theorem liftRight_inv_mul (f : M →* N) (h : ∀ x, IsUnit (f x)) (x) :
194
207
195
208
end Monoid
196
209
end IsUnit
210
+
211
+ section IsLocalRingHom
212
+
213
+ variable {G R S T F : Type *}
214
+
215
+ variable [Monoid R] [Monoid S] [Monoid T] [FunLike F R S]
216
+
217
+ /-- A local ring homomorphism is a map `f` between monoids such that `a` in the domain
218
+ is a unit if `f a` is a unit for any `a`. See `LocalRing.local_hom_TFAE` for other equivalent
219
+ definitions in the local ring case - from where this concept originates, but it is useful in
220
+ other contexts, so we allow this generalisation in mathlib. -/
221
+ class IsLocalRingHom (f : F) : Prop where
222
+ /-- A local ring homomorphism `f : R ⟶ S` will send nonunits of `R` to nonunits of `S`. -/
223
+ map_nonunit : ∀ a, IsUnit (f a) → IsUnit a
224
+
225
+ @[simp]
226
+ theorem IsUnit.of_map (f : F) [IsLocalRingHom f] (a : R) (h : IsUnit (f a)) : IsUnit a :=
227
+ IsLocalRingHom.map_nonunit a h
228
+
229
+ -- TODO : remove alias, change the parenthesis of `f` and `a`
230
+ alias isUnit_of_map_unit := IsUnit.of_map
231
+
232
+ variable [MonoidHomClass F R S]
233
+
234
+ @[simp]
235
+ theorem isUnit_map_iff (f : F) [IsLocalRingHom f] (a : R) : IsUnit (f a) ↔ IsUnit a :=
236
+ ⟨IsLocalRingHom.map_nonunit a, IsUnit.map f⟩
237
+
238
+ theorem isLocalRingHom_of_leftInverse [FunLike G S R] [MonoidHomClass G S R]
239
+ {f : F} (g : G) (hfg : Function.LeftInverse g f) : IsLocalRingHom f where
240
+ map_nonunit a ha := by rwa [isUnit_map_of_leftInverse g hfg] at ha
241
+
242
+ instance MonoidHom.isLocalRingHom_comp (g : S →* T) (f : R →* S) [IsLocalRingHom g]
243
+ [IsLocalRingHom f] : IsLocalRingHom (g.comp f) where
244
+ map_nonunit a := IsLocalRingHom.map_nonunit a ∘ IsLocalRingHom.map_nonunit (f := g) (f a)
245
+
246
+ -- see note [lower instance priority]
247
+ instance (priority := 100 ) isLocalRingHom_toMonoidHom (f : F) [IsLocalRingHom f] :
248
+ IsLocalRingHom (f : R →* S) :=
249
+ ⟨IsLocalRingHom.map_nonunit (f := f)⟩
250
+
251
+ theorem MonoidHom.isLocalRingHom_of_comp (f : R →* S) (g : S →* T) [IsLocalRingHom (g.comp f)] :
252
+ IsLocalRingHom f :=
253
+ ⟨fun _ ha => (isUnit_map_iff (g.comp f) _).mp (ha.map g)⟩
254
+
255
+ end IsLocalRingHom
0 commit comments