Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bump/v4.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcommelin committed Sep 24, 2024
2 parents 9f44540 + 60ff730 commit ca2ba72
Show file tree
Hide file tree
Showing 23 changed files with 115 additions and 70 deletions.
6 changes: 5 additions & 1 deletion .github/build.in.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# This is the master file for autogenerating `.github/workflows/{bors, build_fork, build }.yml`.
### NB: This is the master file for autogenerating
### NB: `.github/workflows/{bors, build_fork, build}.yml`.
### NB: If you need to edit any of those files, you should edit this file instead,
### NB: and regenerate those files by manually running
### NB: .github/workflows/mk_build_yml.sh

jobs:
# Cancels previous runs of jobs in this file
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/bors.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# DO NOT EDIT THIS FILE!!!

# This file is automatically generated by mk_build_yml.sh
# Edit .github/build.in.yml instead and run mk_build_yml.sh to update.
# Edit .github/build.in.yml instead and run
# .github/workflows/mk_build_yml.sh to update.

# Forks of mathlib and other projects should be able to use build_fork.yml directly
# The jobs in this file run on self-hosted workers and will not be run from external forks
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# DO NOT EDIT THIS FILE!!!

# This file is automatically generated by mk_build_yml.sh
# Edit .github/build.in.yml instead and run mk_build_yml.sh to update.
# Edit .github/build.in.yml instead and run
# .github/workflows/mk_build_yml.sh to update.

# Forks of mathlib and other projects should be able to use build_fork.yml directly
# The jobs in this file run on self-hosted workers and will not be run from external forks
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_fork.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# DO NOT EDIT THIS FILE!!!

# This file is automatically generated by mk_build_yml.sh
# Edit .github/build.in.yml instead and run mk_build_yml.sh to update.
# Edit .github/build.in.yml instead and run
# .github/workflows/mk_build_yml.sh to update.

# Forks of mathlib and other projects should be able to use build_fork.yml directly
# The jobs in this file run on GitHub-hosted workers and will only be run from external forks
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/mk_build_yml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ header() {
# DO NOT EDIT THIS FILE!!!
# This file is automatically generated by mk_build_yml.sh
# Edit .github/build.in.yml instead and run mk_build_yml.sh to update.
# Edit .github/build.in.yml instead and run
# .github/workflows/mk_build_yml.sh to update.
# Forks of mathlib and other projects should be able to use build_fork.yml directly
EOF
Expand Down Expand Up @@ -82,7 +83,7 @@ include() {
s/MAIN_OR_FORK/$3/g;
s/JOB_NAME/$4/g;
s/STYLE_LINT_RUNNER/$5/g;
/^#.*autogenerating/d
/^### NB/d
" ../build.in.yml
}

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Category/Grp/Kernels.lean
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def kernelCone : KernelFork f :=
/-- The kernel of a group homomorphism is a kernel in the categorical sense. -/
def kernelIsLimit : IsLimit <| kernelCone f :=
Fork.IsLimit.mk _
(fun s => (by exact Fork.ι s : _ →+ G).codRestrict _ fun c => f.mem_ker.mpr <|
(fun s => (by exact Fork.ι s : _ →+ G).codRestrict _ fun c => mem_ker.mpr <|
by exact DFunLike.congr_fun s.condition c)
(fun _ => by rfl)
(fun _ _ h => ext fun x => Subtype.ext_iff_val.mpr <| by exact DFunLike.congr_fun h x)
Expand Down
10 changes: 5 additions & 5 deletions Mathlib/Algebra/Group/Subgroup/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2134,8 +2134,8 @@ def ker (f : G →* M) : Subgroup G :=
f x⁻¹ = f x * f x⁻¹ := by rw [hx, one_mul]
_ = 1 := by rw [← map_mul, mul_inv_cancel, map_one] }

@[to_additive]
theorem mem_ker (f : G →* M) {x : G} : x ∈ f.ker ↔ f x = 1 :=
@[to_additive (attr := simp)]
theorem mem_ker {f : G →* M} {x : G} : x ∈ f.ker ↔ f x = 1 :=
Iff.rfl

@[to_additive]
Expand All @@ -2155,7 +2155,7 @@ theorem ker_toHomUnits {M} [Monoid M] (f : G →* M) : f.toHomUnits.ker = f.ker
theorem eq_iff (f : G →* M) {x y : G} : f x = f y ↔ y⁻¹ * x ∈ f.ker := by
constructor <;> intro h
· rw [mem_ker, map_mul, h, ← map_mul, inv_mul_cancel, map_one]
· rw [← one_mul x, ← mul_inv_cancel y, mul_assoc, map_mul, f.mem_ker.1 h, mul_one]
· rw [← one_mul x, ← mul_inv_cancel y, mul_assoc, map_mul, mem_ker.1 h, mul_one]

@[to_additive]
instance decidableMemKer [DecidableEq M] (f : G →* M) : DecidablePred (· ∈ f.ker) := fun x =>
Expand Down Expand Up @@ -2226,7 +2226,7 @@ theorem range_le_ker_iff (f : G →* G') (g : G' →* G'') : f.range ≤ g.ker
@[to_additive]
instance (priority := 100) normal_ker (f : G →* M) : f.ker.Normal :=
fun x hx y => by
rw [mem_ker, map_mul, map_mul, f.mem_ker.1 hx, mul_one, map_mul_eq_one f (mul_inv_cancel y)]⟩
rw [mem_ker, map_mul, map_mul, mem_ker.1 hx, mul_one, map_mul_eq_one f (mul_inv_cancel y)]⟩

@[to_additive (attr := simp)]
lemma ker_fst : ker (fst G G') = .prod ⊥ ⊤ := SetLike.ext fun _ => (iff_of_eq (and_true _)).symm
Expand Down Expand Up @@ -2599,7 +2599,7 @@ See `MonoidHom.eq_liftOfRightInverse` for the uniqueness lemma.
def liftOfRightInverse (hf : Function.RightInverse f_inv f) :
{ g : G₁ →* G₃ // f.ker ≤ g.ker } ≃ (G₂ →* G₃) where
toFun g := f.liftOfRightInverseAux f_inv hf g.1 g.2
invFun φ := ⟨φ.comp f, fun x hx => (mem_ker _).mpr <| by simp [(mem_ker _).mp hx]⟩
invFun φ := ⟨φ.comp f, fun x hx mem_ker.mpr <| by simp [mem_ker.mp hx]⟩
left_inv g := by
ext
simp only [comp_apply, liftOfRightInverseAux_comp_apply, Subtype.coe_mk]
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Algebra/Group/Submonoid/Operations.lean
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,8 @@ that `f x = 1` -/
def mker (f : F) : Submonoid M :=
(⊥ : Submonoid N).comap f

@[to_additive]
theorem mem_mker (f : F) {x : M} : x ∈ mker f ↔ f x = 1 :=
@[to_additive (attr := simp)]
theorem mem_mker {f : F} {x : M} : x ∈ mker f ↔ f x = 1 :=
Iff.rfl

@[to_additive]
Expand All @@ -875,7 +875,7 @@ theorem coe_mker (f : F) : (mker f : Set M) = (f : M → N) ⁻¹' {1} :=

@[to_additive]
instance decidableMemMker [DecidableEq N] (f : F) : DecidablePred (· ∈ mker f) := fun x =>
decidable_of_iff (f x = 1) (mem_mker f)
decidable_of_iff (f x = 1) mem_mker

@[to_additive]
theorem comap_mker (g : N →* P) (f : M →* N) : g.mker.comap f = mker (comp g f) :=
Expand Down
14 changes: 9 additions & 5 deletions Mathlib/Algebra/Lie/Submodule.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ theorem ker_le_comap : f.ker ≤ J.comap f :=
theorem ker_coeSubmodule : LieSubmodule.toSubmodule (ker f) = LinearMap.ker (f : L →ₗ[R] L') :=
rfl

variable {f} in
@[simp]
theorem mem_ker {x : L} : x ∈ ker f ↔ f x = 0 :=
show x ∈ LieSubmodule.toSubmodule (f.ker) ↔ _ by
Expand Down Expand Up @@ -1155,9 +1156,12 @@ theorem map_sup_ker_eq_map : LieIdeal.map f (I ⊔ f.ker) = LieIdeal.map f I :=
suffices LieIdeal.map f (I ⊔ f.ker) ≤ LieIdeal.map f I by
exact le_antisymm this (LieIdeal.map_mono le_sup_left)
apply LieSubmodule.lieSpan_mono
rintro x ⟨y, hy₁, hy₂⟩; rw [← hy₂]
erw [LieSubmodule.mem_sup] at hy₁;obtain ⟨z₁, hz₁, z₂, hz₂, hy⟩ := hy₁; rw [← hy]
rw [f.coe_toLinearMap, f.map_add, f.mem_ker.mp hz₂, add_zero]; exact ⟨z₁, hz₁, rfl⟩
rintro x ⟨y, hy₁, hy₂⟩
rw [← hy₂]
erw [LieSubmodule.mem_sup] at hy₁
obtain ⟨z₁, hz₁, z₂, hz₂, hy⟩ := hy₁
rw [← hy]
rw [f.coe_toLinearMap, f.map_add, LieHom.mem_ker.mp hz₂, add_zero]; exact ⟨z₁, hz₁, rfl⟩

@[simp]
theorem map_sup_ker_eq_map' :
Expand Down Expand Up @@ -1249,15 +1253,15 @@ theorem ker_eq_bot : f.ker = ⊥ ↔ Function.Injective f := by
variable {f}

@[simp]
theorem mem_ker (m : M) : m ∈ f.ker ↔ f m = 0 :=
theorem mem_ker {m : M} : m ∈ f.ker ↔ f m = 0 :=
Iff.rfl

@[simp]
theorem ker_id : (LieModuleHom.id : M →ₗ⁅R,L⁆ M).ker = ⊥ :=
rfl

@[simp]
theorem comp_ker_incl : f.comp f.ker.incl = 0 := by ext ⟨m, hm⟩; exact (mem_ker m).mp hm
theorem comp_ker_incl : f.comp f.ker.incl = 0 := by ext ⟨m, hm⟩; exact mem_ker.mp hm

theorem le_ker_iff_map (M' : LieSubmodule R L M) : M' ≤ f.ker ↔ LieSubmodule.map f M' = ⊥ := by
rw [ker, eq_bot_iff, LieSubmodule.map_le_iff_le_comap]
Expand Down
37 changes: 15 additions & 22 deletions Mathlib/Algebra/Order/Group/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,32 @@ variable {α M R : Type*}
section OrderedCommGroup
variable [OrderedCommGroup α] {m n : ℤ} {a b : α}

@[to_additive zsmul_pos] lemma one_lt_zpow' (ha : 1 < a) (hn : 0 < n) : 1 < a ^ n := by
obtain ⟨n, rfl⟩ := Int.eq_ofNat_of_zero_le hn.le
rw [zpow_natCast]
refine one_lt_pow' ha ?_
rintro rfl
simp at hn

@[to_additive zsmul_left_strictMono]
lemma zpow_right_strictMono (ha : 1 < a) : StrictMono fun n : ℤ ↦ a ^ n := fun m n h ↦
calc
a ^ m = a ^ m * 1 := (mul_one _).symm
_ < a ^ m * a ^ (n - m) := mul_lt_mul_left' (one_lt_zpow' ha <| Int.sub_pos_of_lt h) _
_ = a ^ n := by simp [← zpow_add, m.add_comm]
lemma zpow_right_strictMono (ha : 1 < a) : StrictMono fun n : ℤ ↦ a ^ n := by
refine strictMono_int_of_lt_succ fun n ↦ ?_
rw [zpow_add_one]
exact lt_mul_of_one_lt_right' (a ^ n) ha

@[deprecated (since := "2024-09-19")] alias zsmul_strictMono_left := zsmul_left_strictMono

@[to_additive zsmul_pos] lemma one_lt_zpow' (ha : 1 < a) (hn : 0 < n) : 1 < a ^ n := by
simpa using zpow_right_strictMono ha hn

@[to_additive zsmul_left_strictAnti]
lemma zpow_right_strictAnti (ha : a < 1) : StrictAnti fun n : ℤ ↦ a ^ n := fun m n h ↦ calc
a ^ n < a ^ n * a⁻¹ ^ (n - m) :=
lt_mul_of_one_lt_right' _ <| one_lt_zpow' (one_lt_inv'.2 ha) <| Int.sub_pos.2 h
_ = a ^ m := by
rw [inv_zpow', Int.neg_sub, ← zpow_add, Int.add_comm, Int.sub_add_cancel]
lemma zpow_right_strictAnti (ha : a < 1) : StrictAnti fun n : ℤ ↦ a ^ n := by
refine strictAnti_int_of_succ_lt fun n ↦ ?_
rw [zpow_add_one]
exact mul_lt_of_lt_one_right' (a ^ n) ha

@[to_additive zsmul_left_inj]
lemma zpow_right_inj (ha : 1 < a) {m n : ℤ} : a ^ m = a ^ n ↔ m = n :=
(zpow_right_strictMono ha).injective.eq_iff

@[to_additive zsmul_mono_left]
lemma zpow_mono_right (ha : 1 ≤ a) : Monotone fun n : ℤ ↦ a ^ n := fun m n h ↦
calc
a ^ m = a ^ m * 1 := (mul_one _).symm
_ ≤ a ^ m * a ^ (n - m) := mul_le_mul_left' (one_le_zpow ha <| Int.sub_nonneg_of_le h) _
_ = a ^ n := by simp [← zpow_add, m.add_comm]
lemma zpow_mono_right (ha : 1 ≤ a) : Monotone fun n : ℤ ↦ a ^ n := by
refine monotone_int_of_le_succ fun n ↦ ?_
rw [zpow_add_one]
exact le_mul_of_one_le_right' ha

@[to_additive (attr := gcongr)]
lemma zpow_le_zpow (ha : 1 ≤ a) (h : m ≤ n) : a ^ m ≤ a ^ n := zpow_mono_right ha h
Expand Down
40 changes: 40 additions & 0 deletions Mathlib/CategoryTheory/Whiskering.lean
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,46 @@ def Functor.FullyFaithful.whiskeringRight {F : D ⥤ E} (hF : F.FullyFaithful)
simp only [map_comp, map_preimage]
apply f.naturality }

theorem whiskeringLeft_obj_id : (whiskeringLeft C C E).obj (𝟭 _) = 𝟭 _ :=
rfl

/-- The isomorphism between left-whiskering on the identity functor and the identity of the functor
between the resulting functor categories. -/
def whiskeringLeftObjIdIso : (whiskeringLeft C C E).obj (𝟭 _) ≅ 𝟭 _ :=
Iso.refl _

theorem whiskeringLeft_obj_comp {D' : Type u₄} [Category.{v₄} D'] (F : C ⥤ D) (G : D ⥤ D') :
(whiskeringLeft C D' E).obj (F ⋙ G) =
(whiskeringLeft D D' E).obj G ⋙ (whiskeringLeft C D E).obj F :=
rfl

/-- The isomorphism between left-whiskering on the composition of functors and the composition
of two left-whiskering applications. -/
def whiskeringLeftObjCompIso {D' : Type u₄} [Category.{v₄} D'] (F : C ⥤ D) (G : D ⥤ D') :
(whiskeringLeft C D' E).obj (F ⋙ G) ≅
(whiskeringLeft D D' E).obj G ⋙ (whiskeringLeft C D E).obj F :=
Iso.refl _

theorem whiskeringRight_obj_id : (whiskeringRight E C C).obj (𝟭 _) = 𝟭 _ :=
rfl

/-- The isomorphism between right-whiskering on the identity functor and the identity of the functor
between the resulting functor categories. -/
def wiskeringRightObjIdIso : (whiskeringRight E C C).obj (𝟭 _) ≅ 𝟭 _ :=
Iso.refl _

theorem whiskeringRight_obj_comp {D' : Type u₄} [Category.{v₄} D'] (F : C ⥤ D) (G : D ⥤ D') :
(whiskeringRight E C D).obj F ⋙ (whiskeringRight E D D').obj G =
(whiskeringRight E C D').obj (F ⋙ G) :=
rfl

/-- The isomorphism between right-whiskering on the composition of functors and the composition
of two right-whiskering applications. -/
def whiskeringRightObjCompIso {D' : Type u₄} [Category.{v₄} D'] (F : C ⥤ D) (G : D ⥤ D') :
(whiskeringRight E C D).obj F ⋙ (whiskeringRight E D D').obj G ≅
(whiskeringRight E C D').obj (F ⋙ G) :=
Iso.refl _

instance full_whiskeringRight_obj {F : D ⥤ E} [F.Faithful] [F.Full] :
((whiskeringRight C D E).obj F).Full :=
((Functor.FullyFaithful.ofFullyFaithful F).whiskeringRight C).full
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/GroupTheory/Abelianization.lean
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ theorem commutator_subset_ker : commutator G ≤ f.ker := by
/-- If `f : G → A` is a group homomorphism to an abelian group, then `lift f` is the unique map
from the abelianization of a `G` to `A` that factors through `f`. -/
def lift : (G →* A) ≃ (Abelianization G →* A) where
toFun f := QuotientGroup.lift _ f fun _ h => f.mem_ker.2 <| commutator_subset_ker _ h
toFun f := QuotientGroup.lift _ f fun _ h => MonoidHom.mem_ker.2 <| commutator_subset_ker _ h
invFun F := F.comp of
left_inv _ := MonoidHom.ext fun _ => rfl
right_inv _ := MonoidHom.ext fun x => QuotientGroup.induction_on x fun _ => rfl
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/GroupTheory/PresentedGroup.lean
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ local notation "F" => FreeGroup.lift f

theorem closure_rels_subset_ker (h : ∀ r ∈ rels, FreeGroup.lift f r = 1) :
Subgroup.normalClosure rels ≤ MonoidHom.ker F :=
Subgroup.normalClosure_le_normal fun x w ↦ (MonoidHom.mem_ker _).2 (h x w)
Subgroup.normalClosure_le_normal fun x w ↦ MonoidHom.mem_ker.2 (h x w)

theorem to_group_eq_one_of_mem_closure (h : ∀ r ∈ rels, FreeGroup.lift f r = 1) :
∀ x ∈ Subgroup.normalClosure rels, F x = 1 :=
fun _ w ↦ (MonoidHom.mem_ker _).1 <| closure_rels_subset_ker h w
fun _ w ↦ MonoidHom.mem_ker.1 <| closure_rels_subset_ker h w

/-- The extension of a map `f : α → G` that satisfies the given relations to a group homomorphism
from `PresentedGroup rels → G`. -/
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/GroupTheory/QuotientGroup/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ open MonoidHom
/-- The induced map from the quotient by the kernel to the codomain. -/
@[to_additive "The induced map from the quotient by the kernel to the codomain."]
def kerLift : G ⧸ ker φ →* H :=
lift _ φ fun _g => φ.mem_ker.mp
lift _ φ fun _g => mem_ker.mp

@[to_additive (attr := simp)]
theorem kerLift_mk (g : G) : (kerLift φ) g = φ g :=
Expand All @@ -340,7 +340,7 @@ theorem kerLift_injective : Injective (kerLift φ) := fun a b =>
/-- The induced map from the quotient by the kernel to the range. -/
@[to_additive "The induced map from the quotient by the kernel to the range."]
def rangeKerLift : G ⧸ ker φ →* φ.range :=
lift _ φ.rangeRestrict fun g hg => (mem_ker _).mp <| by rwa [ker_rangeRestrict]
lift _ φ.rangeRestrict fun g hg => mem_ker.mp <| by rwa [ker_rangeRestrict]

@[to_additive]
theorem rangeKerLift_injective : Injective (rangeKerLift φ) := fun a b =>
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/GroupTheory/Torsion.lean
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ theorem IsTorsion.of_surjective {f : G →* H} (hf : Function.Surjective f) (tG
theorem IsTorsion.extension_closed {f : G →* H} (hN : N = f.ker) (tH : IsTorsion H)
(tN : IsTorsion N) : IsTorsion G := fun g => by
obtain ⟨ngn, ngnpos, hngn⟩ := (tH <| f g).exists_pow_eq_one
have hmem := f.mem_ker.mpr ((f.map_pow g ngn).trans hngn)
have hmem := MonoidHom.mem_ker.mpr ((f.map_pow g ngn).trans hngn)
lift g ^ ngn to N using hN.symm ▸ hmem with gn h
obtain ⟨nn, nnpos, hnn⟩ := (tN gn).exists_pow_eq_one
exact isOfFinOrder_iff_pow_eq_one.mpr <| ⟨ngn * nn, mul_pos ngnpos nnpos, by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Henselian.lean
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ theorem HenselianLocalRing.TFAE (R : Type u) [CommRing R] [LocalRing R] :
| hR, K, _K, φ, hφ, f, hf, a₀, h₁, h₂ => by
obtain ⟨a₀, rfl⟩ := hφ a₀
have H := HenselianLocalRing.is_henselian f hf a₀
simp only [← ker_eq_maximalIdeal φ hφ, eval₂_at_apply, RingHom.mem_ker φ] at H h₁ h₂
simp only [← ker_eq_maximalIdeal φ hφ, eval₂_at_apply, RingHom.mem_ker] at H h₁ h₂
obtain ⟨a, ha₁, ha₂⟩ := H h₁ (by
contrapose! h₂
rwa [← mem_nonunits_iff, ← LocalRing.mem_maximalIdeal, ← LocalRing.ker_eq_maximalIdeal φ hφ,
Expand Down
19 changes: 10 additions & 9 deletions Mathlib/RingTheory/Ideal/Maps.lean
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,9 @@ variable (f : F) (g : G)
def ker : Ideal R :=
Ideal.comap f ⊥

variable {f} in
/-- An element is in the kernel if and only if it maps to zero. -/
theorem mem_ker {r} : r ∈ ker f ↔ f r = 0 := by rw [ker, Ideal.mem_comap, Submodule.mem_bot]
@[simp] theorem mem_ker {r} : r ∈ ker f ↔ f r = 0 := by rw [ker, Ideal.mem_comap, Submodule.mem_bot]

theorem ker_eq : (ker f : Set R) = Set.preimage f {0} :=
rfl
Expand Down Expand Up @@ -623,13 +624,13 @@ theorem ker_isMaximal_of_surjective {R K F : Type*} [Ring R] [Field K]
(hf : Function.Surjective f) : (ker f).IsMaximal := by
refine
Ideal.isMaximal_iff.mpr
fun h1 => one_ne_zero' K <| map_one f ▸ (mem_ker f).mp h1, fun J x hJ hxf hxJ => ?_⟩
fun h1 => one_ne_zero' K <| map_one f ▸ mem_ker.mp h1, fun J x hJ hxf hxJ => ?_⟩
obtain ⟨y, hy⟩ := hf (f x)⁻¹
have H : 1 = y * x - (y * x - 1) := (sub_sub_cancel _ _).symm
rw [H]
refine J.sub_mem (J.mul_mem_left _ hxJ) (hJ ?_)
rw [mem_ker]
simp only [hy, map_sub, map_one, map_mul, inv_mul_cancel₀ (mt (mem_ker f).mpr hxf), sub_self]
simp only [hy, map_sub, map_one, map_mul, inv_mul_cancel₀ (mt mem_ker.mpr hxf :), sub_self]

end RingHom

Expand All @@ -645,7 +646,7 @@ theorem map_eq_bot_iff_le_ker {I : Ideal R} (f : F) : I.map f = ⊥ ↔ I ≤ Ri
rw [RingHom.ker, eq_bot_iff, map_le_iff_le_comap]

theorem ker_le_comap {K : Ideal S} (f : F) : RingHom.ker f ≤ comap f K := fun _ hx =>
mem_comap.2 (((RingHom.mem_ker f).1 hx).symm ▸ K.zero_mem)
mem_comap.2 (RingHom.mem_ker.1 hx ▸ K.zero_mem)

theorem map_isPrime_of_equiv {F' : Type*} [EquivLike F' R S] [RingEquivClass F' R S]
(f : F') {I : Ideal R} [IsPrime I] : IsPrime (map f I) := by
Expand Down Expand Up @@ -744,15 +745,15 @@ def liftOfRightInverseAux (hf : Function.RightInverse f_inv f) (g : A →+* C)
{ AddMonoidHom.liftOfRightInverse f.toAddMonoidHom f_inv hf ⟨g.toAddMonoidHom, hg⟩ with
toFun := fun b => g (f_inv b)
map_one' := by
rw [← map_one g, ← sub_eq_zero, ← map_sub g, ← mem_ker g]
rw [← map_one g, ← sub_eq_zero, ← map_sub g, ← mem_ker]
apply hg
rw [mem_ker f, map_sub f, sub_eq_zero, map_one f]
rw [mem_ker, map_sub f, sub_eq_zero, map_one f]
exact hf 1
map_mul' := by
intro x y
rw [← map_mul g, ← sub_eq_zero, ← map_sub g, ← mem_ker g]
rw [← map_mul g, ← sub_eq_zero, ← map_sub g, ← mem_ker]
apply hg
rw [mem_ker f, map_sub f, sub_eq_zero, map_mul f]
rw [mem_ker, map_sub f, sub_eq_zero, map_mul f]
simp only [hf _] }

@[simp]
Expand Down Expand Up @@ -782,7 +783,7 @@ See `RingHom.eq_liftOfRightInverse` for the uniqueness lemma.
def liftOfRightInverse (hf : Function.RightInverse f_inv f) :
{ g : A →+* C // RingHom.ker f ≤ RingHom.ker g } ≃ (B →+* C) where
toFun g := f.liftOfRightInverseAux f_inv hf g.1 g.2
invFun φ := ⟨φ.comp f, fun x hx => (mem_ker _).mpr <| by simp [(mem_ker _).mp hx]⟩
invFun φ := ⟨φ.comp f, fun x hx => mem_ker.mpr <| by simp [mem_ker.mp hx]⟩
left_inv g := by
ext
simp only [comp_apply, liftOfRightInverseAux_comp_apply, Subtype.coe_mk]
Expand Down
Loading

0 comments on commit ca2ba72

Please sign in to comment.