Skip to content

Commit

Permalink
Speed up inheritance by deprioritizing a duplicate instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Vierkantor committed Dec 12, 2023
1 parent 816edcc commit c9faf41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Counterexamples/HomogeneousPrimeNotPrime.lean
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def grading.decompose : R × R →+ DirectSum Two fun i => grading R i where
Option.casesOn i _ (fun (i_1 : Unit) => PUnit.casesOn i_1 _)) <;> rfl
map_add' := by
rintro ⟨a1, b1⟩ ⟨a2, b2⟩
-- HACK because `map_add` caused a timeout:
rw [add_add_add_comm, ← AddMonoidHom.map_add, ← AddMonoidHom.map_add]
rw [add_add_add_comm, ← map_add, ← map_add]
dsimp only [Prod.mk_add_mk]
simp_rw [add_sub_add_comm]
congr
Expand Down
3 changes: 3 additions & 0 deletions Mathlib/Algebra/Module/LinearMap.lean
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ instance (priority := 100) addMonoidHomClass [SemilinearMapClass F σ M M₃] :
rw [← zero_smul R (0 : M), map_smulₛₗ]
simp }

-- The following should go via SemilinearMapClass.addMonoidHomClass instead:
attribute [instance 0] SemilinearMapClass.toAddHomClass

instance (priority := 100) distribMulActionHomClass [LinearMapClass F R M M₂] :
DistribMulActionHomClass F R M M₂ :=
{ SemilinearMapClass.addMonoidHomClass F with
Expand Down

0 comments on commit c9faf41

Please sign in to comment.