Skip to content

Commit

Permalink
perf: speedup using Submodule.restrictScalars_mem instead of relyin…
Browse files Browse the repository at this point in the history
…g on defeq (#19711)
  • Loading branch information
alreadydone committed Dec 4, 2024
1 parent ea51583 commit da0cfc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Mathlib/RingTheory/Ideal/Cotangent.lean
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def mapCotangent (I₁ : Ideal A) (I₂ : Ideal B) (f : A →ₐ[R] B) (h : I₁
((I₂ • ⊤ : Submodule B I₂).restrictScalars R) ?_ ?_
· exact f.toLinearMap.restrict (p := I₁.restrictScalars R) (q := I₂.restrictScalars R) h
· intro x hx
rw [Submodule.restrictScalars_mem] at hx
refine Submodule.smul_induction_on hx ?_ (fun _ _ ↦ add_mem)
rintro a ha ⟨b, hb⟩ -
simp only [SetLike.mk_smul_mk, smul_eq_mul, Submodule.mem_comap, Submodule.restrictScalars_mem]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Kaehler/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def Derivation.liftKaehlerDifferential (D : Derivation R S M) : Ω[S⁄R] →ₗ
· exact D.tensorProductTo.comp ((KaehlerDifferential.ideal R S).subtype.restrictScalars S)
· intro x hx
rw [LinearMap.mem_ker]
refine Submodule.smul_induction_on hx ?_ ?_
refine Submodule.smul_induction_on ((Submodule.restrictScalars_mem _ _ _).mp hx) ?_ ?_
· rintro x hx y -
rw [RingHom.mem_ker] at hx
dsimp
Expand Down

0 comments on commit da0cfc4

Please sign in to comment.