Skip to content

Commit 35b3519

Browse files
JovanGerbReemMelamed
authored andcommitted
perf: another shortcut instance for Semiring (leanprover-community#40153)
This PR adds another shortcut instance for Semiring that I had missed in leanprover-community#39719, because I assumed that it had already been tagged as an instance automatically.
1 parent 1182dcc commit 35b3519

8 files changed

Lines changed: 13 additions & 12 deletions

File tree

Mathlib/Algebra/Ring/Defs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class Ring (R : Type u) extends Semiring R, AddCommGroup R, AddGroupWithOne R
151151
instance [Semiring α] : Distrib α := inferInstance
152152
instance [Semiring α] : MulZeroClass α := inferInstance
153153
instance [Semiring α] : MulZeroOneClass α := inferInstance
154-
attribute [instance] Semiring.toMonoid
154+
attribute [instance] Semiring.toAddCommMonoid Semiring.toMonoid
155155

156156
/-!
157157
### Semirings

Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,8 @@ theorem spectralNorm_unique [CompleteSpace K] {f : AlgebraNorm K L} (hf_pm : IsP
697697
apply eq_of_powMul_faithful f hf_pm _ spectralAlgNorm_isPowMul
698698
intro x
699699
let E : Type v := id K⟮x⟯
700-
let : Field E := show Field K⟮x⟯ by infer_instance
701-
let : Module K E := show Module K K⟮x⟯ by infer_instance
700+
let : Field E := id <| show Field K⟮x⟯ by infer_instance
701+
let : Module K E := id <| show Module K K⟮x⟯ by infer_instance
702702
let id1 : K⟮x⟯ →ₗ[K] E := LinearMap.id
703703
let id2 : E →ₗ[K] K⟮x⟯ := LinearMap.id
704704
set hs_norm : RingNorm E :=

Mathlib/FieldTheory/PurelyInseparable/Tower.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ theorem LinearIndependent.map_of_isPurelyInseparable_of_isSeparable [IsPurelyIns
8181
contrapose
8282
refine fun hs ↦ (injective_iff_map_eq_zero _).mp (algebraMap F E).injective _ ?_
8383
rw [hlF, Finsupp.notMem_support_iff.1 hs, zero_pow this]
84-
replace h := linearIndependent_iff.1 (h.map_pow_expChar_pow_of_isSeparable' q n hsep) lF₀ <| by
84+
replace h := linearIndependent_iff.1 (h.map_pow_expChar_pow_of_isSeparable' q n hsep :) lF₀ <| by
8585
replace hl := congr($hl ^ q ^ n)
8686
rw [Finsupp.linearCombination_apply, Finsupp.sum, sum_pow_char_pow, zero_pow this] at hl
8787
rw [← hl, Finsupp.linearCombination_apply,

Mathlib/LinearAlgebra/QuadraticForm/Basic.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,10 @@ theorem associated_linMulLin [Invertible (2 : R)] (f g : M →ₗ[R] R) :
10271027

10281028
open LinearMap in
10291029
@[simp]
1030-
lemma associated_sq [Invertible (2 : R)] : associated (R := R) sq = mul R R :=
1031-
(associated_linMulLin (id) (id)).trans <|
1032-
by simp only [smul_add, invOf_two_smul_add_invOf_two_smul]; rfl
1030+
lemma associated_sq [Invertible (2 : R)] : associated (R := R) sq = mul R R := by
1031+
rw [sq, associated_linMulLin]
1032+
simp only [smul_add, invOf_two_smul_add_invOf_two_smul]
1033+
rfl
10331034

10341035
end Associated
10351036

Mathlib/NumberTheory/TsumDivisorsAntidiagonal.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ theorem tsum_prod_pow_eq_tsum_sigma (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) :
109109
∑' e : ℕ+, σ k e * r ^ (e : ℕ) by rwa [← (summable_prod_mul_pow k hr).tsum_prod]
110110
simp only [← sigmaAntidiagonalEquivProd.tsum_eq, sigmaAntidiagonalEquivProd,
111111
divisorsAntidiagonalFactors, PNat.mk_coe, Equiv.coe_fn_mk, sigma_eq_sum_div, cast_sum,
112-
cast_pow, Summable.tsum_sigma (summable_divisorsAntidiagonal_aux k hr)]
112+
cast_pow, Summable.tsum_sigma (summable_divisorsAntidiagonal_aux k hr :)]
113113
refine tsum_congr fun n ↦ ?_
114114
simpa [tsum_fintype, Finset.sum_mul,
115115
(n : ℕ).divisorsAntidiagonal.sum_attach fun x : ℕ × ℕ ↦ x.2 ^ k * r ^ (x.1 * x.2),
@@ -134,7 +134,7 @@ lemma tendsto_zero_geometric_tsum_pnat {r : 𝕜} (hr : ‖r‖ < 1) :
134134
rwa [norm_pow, pow_lt_one_iff_of_nonneg (norm_nonneg _) (NeZero.ne _)]
135135
have h2 (m : ℕ+) : ∑' n : ℕ+, r ^ (n * m : ℕ) = (1 - r ^ (m : ℕ))⁻¹ - 1 := by
136136
have := tsum_geometric_of_norm_lt_one (h1 m)
137-
rw [← tsum_zero_pnat_eq_tsum_nat (summable_geometric_of_norm_lt_one (h1 m))] at this
137+
rw [← tsum_zero_pnat_eq_tsum_nat (summable_geometric_of_norm_lt_one (h1 m) :)] at this
138138
simp_rw [← this, pow_zero, add_sub_cancel_left, mul_comm, pow_mul]
139139
rw [funext h2, (by simp : 𝓝 (0 : 𝕜) = 𝓝 ((1 - 0)⁻¹ - 1)), tendsto_sub_const_iff,
140140
tendsto_inv_iff₀ (by simp), tendsto_const_sub_iff]

Mathlib/RingTheory/HahnSeries/Cardinal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ theorem cardSupp_hsum_powers_le [AddCommMonoid Γ] [IsOrderedCancelAddMonoid Γ]
133133
theorem cardSupp_inv_le [AddCommGroup Γ] [IsOrderedAddMonoid Γ] [Field R] (x : R⟦Γ⟧) :
134134
x⁻¹.cardSupp ≤ max ℵ₀ x.cardSupp := by
135135
obtain rfl | hx := eq_or_ne x 0; · simp
136-
apply (cardSupp_single_mul_le ..).trans <| (cardSupp_hsum_powers_le ..).trans _
136+
apply (cardSupp_single_mul_le ..).trans (cardSupp_hsum_powers_le ..) |>.trans
137137
gcongr
138138
refine (cardSupp_single_mul_le _ (-x.order) x.leadingCoeff⁻¹).trans' <| cardSupp_mono fun _ ↦ ?_
139139
aesop (add simp [coeff_single_mul])

Mathlib/RingTheory/LocalRing/ResidueField/Fiber.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ instance [IsLocalRing R] [IsLocalRing S] [IsLocalHom (algebraMap R S)] :
3434
IsLocalRing (ResidueField R ⊗[R] S) :=
3535
let eSp : ResidueField R ⊗[R] S ≃ₐ[R] S ⧸ (maximalIdeal R).map (algebraMap R S) :=
3636
(Algebra.TensorProduct.comm _ _ _).trans
37-
((TensorProduct.quotIdealMapEquivTensorQuot _ _).symm.restrictScalars _)
37+
((TensorProduct.quotIdealMapEquivTensorQuot S (maximalIdeal R)).symm.restrictScalars _)
3838
have : Nontrivial (IsLocalRing.ResidueField R ⊗[R] S) := by
3939
rw [eSp.nontrivial_congr, Ideal.Quotient.nontrivial_iff]
4040
exact ((((local_hom_TFAE (algebraMap R S)).out 0 2 rfl rfl).mp inferInstance).trans_lt

Mathlib/RingTheory/QuasiFinite/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private lemma finite_of_isArtinianRing_of_isLocalRing
125125
(Algebra.TensorProduct.congr (.symm <| .ofBijective _
126126
(Ideal.bijective_algebraMap_quotient_residueField (maximalIdeal R))) .refl).trans <|
127127
(Algebra.TensorProduct.comm _ _ _).trans
128-
((Algebra.TensorProduct.quotIdealMapEquivTensorQuot _ _).symm.restrictScalars _)
128+
((Algebra.TensorProduct.quotIdealMapEquivTensorQuot S (maximalIdeal R)).symm.restrictScalars _)
129129
have : Module.Finite R (S ⧸ (maximalIdeal R).map (algebraMap R S)) :=
130130
have : Module.Finite R ((maximalIdeal R).Fiber S) :=
131131
.trans (maximalIdeal R).ResidueField _

0 commit comments

Comments
 (0)