Skip to content
Closed
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Mathlib/RingTheory/LocalRing/RingHom/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,27 @@ theorem RingHom.domain_isLocalRing {R S : Type*} [Semiring R] [CommSemiring S] [
simp_rw [← map_mem_nonunits_iff f, f.map_add]
exact IsLocalRing.nonunits_add

section AlgHom

variable {A : Type*} [CommSemiring A] [Algebra A R] [Algebra A S] [Algebra A T]

variable (A) in
@[instance]
theorem isLocalHom_algHomId : IsLocalHom (AlgHom.id A R) := ⟨fun _ ↦ id⟩

@[instance]
theorem AlgHom.isLocalHom_comp (f : R →ₐ[A] S) (g : S →ₐ[A] T) [IsLocalHom f] [IsLocalHom g] :
IsLocalHom (g.comp f) where
map_nonunit a := IsLocalHom.map_nonunit a ∘ IsLocalHom.map_nonunit (f := g) (f a)
Comment on lines +60 to +65
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you say why you want these to be instances? I know there are reasons for RingHoms, but I'm not sure about AlgHoms. Also, note that we generally write instance foo ... instead of @[instance] theorem foo ....

Copy link
Copy Markdown
Contributor Author

@BryceT233 BryceT233 Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the advice! I am trying to design the category of local algebras with a fixed residue field, which will eventually lead to the base category used in deformation theory (see https://stacks.math.columbia.edu/tag/06GC for the definition of a base category). It is still a work-in-progress, but you can view a one-file version of it here: https://github.com/BryceT233/deformation_theory_basics

Since the morphisms in this category are local AlgHoms, I thought it would be better to have IsLocalHom instances directly for AlgHom. I could try to work around this by coercing the AlgHoms to RingHoms, but I'm worried that might not lead to the ideal shape for the definition.

About the style issue, I think I was just copying the existing style from RingHom part of the code above in the same file, usually I used instance too :)


-- see note [lower instance priority]
@[instance 100]
theorem isLocalHom_toAlgHom {F : Type*} [FunLike F R S]
[AlgHomClass F A R S] (f : F) [IsLocalHom f] : IsLocalHom (f : R →ₐ[A] S) :=
⟨IsLocalHom.map_nonunit (f := f)⟩

end AlgHom

end

section
Expand Down
Loading