Skip to content

Commit f8fd74f

Browse files
committed
chore: remove unused instances (#41013)
Removes unused instances in theorems found by fixing the unused arguments linter to handle theorems in leanprover-community/batteries#1879.
1 parent 2da2220 commit f8fd74f

33 files changed

Lines changed: 53 additions & 62 deletions

File tree

Mathlib/Algebra/Module/Submodule/Map.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,8 @@ theorem map_restrict [RingHomSurjective σ₂₁] {p : Submodule R₂ M₂} {q :
697697
map (f.restrict h) p' = comap q.subtype (map f (map p.subtype p')) := by
698698
rw [restrict_eq_codRestrict_domRestrict, map_codRestrict, map_domRestrict]
699699

700-
theorem comap_restrict [RingHomSurjective σ₂₁] {p : Submodule R₂ M₂} {q : Submodule R M}
701-
{f : M₂ →ₛₗ[σ₂₁] M} (h : ∀ x ∈ p, f x ∈ q) (p') :
700+
theorem comap_restrict {p : Submodule R₂ M₂} {q : Submodule R M} {f : M₂ →ₛₗ[σ₂₁] M}
701+
(h : ∀ x ∈ p, f x ∈ q) (p') :
702702
comap (f.restrict h) p' = comap p.subtype (comap f (map q.subtype p')) := by
703703
rw [restrict_eq_codRestrict_domRestrict, comap_codRestrict, comap_domRestrict]
704704

Mathlib/Algebra/Module/Submodule/RestrictScalars.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ theorem restrictScalars_self (V : Submodule R M) : V.restrictScalars R = V :=
5656
SetLike.coe_injective rfl
5757

5858
@[simp] theorem restrictScalars_restrictScalars
59-
(T : Type*) [Semiring T] [SMul T R] [SMul S T] [IsScalarTower S T R]
59+
(T : Type*) [Semiring T] [SMul T R] [SMul S T]
6060
[Module T M] [IsScalarTower S T M] [IsScalarTower T R M]
6161
(V : Submodule R M) :
6262
(V.restrictScalars T).restrictScalars S = V.restrictScalars S :=

Mathlib/Algebra/Module/Torsion/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ theorem IsTorsionBy.mk_smul [(Ideal.span {r}).IsTwoSided] (hM : IsTorsionBy R M
577577
def IsTorsionBySet.module [I.IsTwoSided] (hM : IsTorsionBySet R M I) : Module (R ⧸ I) M :=
578578
letI := hM.hasSMul; fast_instance% I.mkQ_surjective.moduleLeft _ (IsTorsionBySet.mk_smul hM)
579579

580-
instance IsTorsionBySet.isScalarTower [I.IsTwoSided] (hM : IsTorsionBySet R M I)
580+
instance IsTorsionBySet.isScalarTower (hM : IsTorsionBySet R M I)
581581
{S : Type*} [SMul S R] [SMul S M] [IsScalarTower S R M] [IsScalarTower S R R] :
582582
@IsScalarTower S (R ⧸ I) M _ hM.hasSMul _ :=
583583
-- Porting note: still needed to be fed the Module R / I M instance

Mathlib/Algebra/Order/Ring/IsNonarchimedean.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ theorem add_eq_max_of_ne {F α : Type*} [AddGroup α] [FunLike F α R]
118118
/- TODO: Remove the funlike conditions on the lemmas required for add_max_of_ne, this will allow us
119119
to remove the CommGroup part in the below which is unnecessary. -/
120120

121-
lemma add_eq_max_of_ne' {α S : Type*} [Semiring S] [LinearOrder S] [AddCommGroup α]
121+
lemma add_eq_max_of_ne' {α S : Type*} [LinearOrder S] [AddCommGroup α]
122122
(f : α → S) (fna : IsNonarchimedean f) (Neg : ∀ a, f a = f (-a)) {a b : α}
123123
(hne : f a ≠ f b) : f (a + b) = max (f a) (f b) := by
124124
wlog hab : f a > f b generalizing a b with H
@@ -223,6 +223,7 @@ theorem finset_powerset_image_add [IsStrictOrderedRing R]
223223
g (powersetCard (s.card - m) s)
224224
exact ⟨⟨b, hb_in (powersetCard_nonempty.mpr (Nat.sub_le s.card m))⟩, hb⟩
225225

226+
omit [Semiring R] in
226227
lemma apply_sum_eq_of_lt {α β : Type*} [AddCommGroup α] {f : α → R} (fna : IsNonarchimedean f)
227228
(f_neg : ∀ a, f a = f (-a)) {s : Finset β} {l : β → α} {k : β} (hk : k ∈ s)
228229
(hmax : ∀ j ∈ s, j ≠ k → f (l j) < f (l k)) : f (∑ i ∈ s, l i) = f (l k) := by

Mathlib/Algebra/SkewPolynomial/Basic.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ def monomial : R →ₗ[R] SkewPolynomial R := lsingle R (ofAdd n)
173173

174174
lemma monomial_zero_right : monomial n (0 : R) = 0 := single_zero _
175175

176-
lemma monomial_zero_one [MulSemiringAction (Multiplicative ℕ) R] : monomial 0 (1 : R) = 1 :=
177-
rfl
176+
lemma monomial_zero_one : monomial 0 (1 : R) = 1 := rfl
178177

179178
lemma monomial_def (a : R) : monomial n a = single (ofAdd n) a := rfl
180179

@@ -348,8 +347,7 @@ lemma coeff_monomial : coeff (monomial n a) m = if n = m then a else 0 :=
348347

349348
@[simp] lemma coeff_zero (n : ℕ) : coeff (0 : SkewPolynomial R) n = 0 := rfl
350349

351-
@[simp] lemma coeff_one_zero [MulSemiringAction (Multiplicative ℕ) R] :
352-
coeff (1 : SkewPolynomial R) 0 = 1 := coeff_monomial
350+
@[simp] lemma coeff_one_zero : coeff (1 : SkewPolynomial R) 0 = 1 := coeff_monomial
353351

354352
lemma coeff_one [MulSemiringAction (Multiplicative ℕ) R] (n : ℕ) :
355353
coeff (1 : SkewPolynomial R) n = if 0 = n then 1 else 0 := by

Mathlib/AlgebraicGeometry/Morphisms/Finite.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ instance {U V X : Scheme.{u}} (f : U ⟶ X) (g : V ⟶ X) [IsFinite f] [IsFinite
154154

155155
end IsFinite
156156

157-
lemma Scheme.Hom.finite_appTop {X Y : Scheme.{u}} (f : X ⟶ Y) [IsAffine X] [IsAffine Y]
158-
[IsFinite f] :
157+
lemma Scheme.Hom.finite_appTop {X Y : Scheme.{u}} (f : X ⟶ Y) [IsAffine Y] [IsFinite f] :
159158
f.appTop.hom.Finite :=
160159
(HasAffineProperty.iff_of_isAffine (P := @IsFinite).mp inferInstance).2
161160

Mathlib/Analysis/LocallyConvex/HahnBanach.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ variable [TopologicalSpace E]
6868

6969
/-- **Hahn-Banach theorem** for linear functionals dominated by a continuous seminorm on
7070
polynormable spaces over `ℝ`. -/
71-
theorem Module.Dual.exists_continuous_extension_of_le_seminorm_real [IsTopologicalAddGroup E]
72-
[Module ℝ E] [ContinuousSMul ℝ E] [PolynormableSpace ℝ E] (S : Subspace ℝ E) (f : Dual ℝ S)
71+
theorem Module.Dual.exists_continuous_extension_of_le_seminorm_real
72+
[Module ℝ E] [PolynormableSpace ℝ E] (S : Subspace ℝ E) (f : Dual ℝ S)
7373
{p : Seminorm ℝ E} (hp_cont : Continuous p) (hp : ∀ x, f x ≤ p x) :
7474
∃ g : StrongDual ℝ E, (∀ x : S, g x = f x) ∧ ∀ x, |g x| ≤ p x := by
7575
obtain ⟨g, hg, hl⟩ := f.exists_extension_of_le_seminorm_real S hp

Mathlib/Analysis/Normed/Operator/NormedSpace.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ lemma ContinuousLinearMap.norm_inl [SeminormedAddCommGroup E] [NontrivialTopolog
438438
‖ContinuousLinearMap.inl 𝕜 E F‖ = 1 :=
439439
(LinearIsometry.inl 𝕜 E F).norm_toContinuousLinearMap
440440

441-
lemma ContinuousLinearMap.norm_inr [SeminormedAddCommGroup E] [NontrivialTopology E]
441+
lemma ContinuousLinearMap.norm_inr [SeminormedAddCommGroup E]
442442
[NormedSpace 𝕜 E] [SeminormedAddCommGroup F] [NormedSpace 𝕜 F] [NontrivialTopology F] :
443443
‖ContinuousLinearMap.inr 𝕜 E F‖ = 1 :=
444444
(LinearIsometry.inr 𝕜 E F).norm_toContinuousLinearMap

Mathlib/Analysis/Seminorm.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ theorem continuous_of_le [TopologicalSpace E] [IsTopologicalAddGroup E]
11751175
exact isOpen_lt hq continuous_const
11761176

11771177
/-- The sum over a finite set of continuous seminorms is continuous. -/
1178-
theorem continuous_finsetSum [TopologicalSpace E] [IsTopologicalAddGroup E]
1178+
theorem continuous_finsetSum [TopologicalSpace E]
11791179
{p : ι → Seminorm 𝕝 E} {s : Finset ι} (hp : ∀ i ∈ s, Continuous (p i)) :
11801180
Continuous ((∑ i ∈ s, p i : Seminorm 𝕝 E) : E → ℝ) := by
11811181
change Continuous (fun x ↦ coeFnAddMonoidHom _ _ (∑ i ∈ s, p i) x)

Mathlib/CategoryTheory/LiftingProperties/PushoutProduct.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ lemma hasLiftingProperty_mk_iff' [HasPushouts C] [HasPullbacks C]
6868

6969
set_option backward.defeqAttrib.useBackward true in
7070
/-- `(∅ ⟶ B) □ g` lifts against `X ⟶ Y` if and only if `g` lifts against `B ⟹ X ⟶ B ⟹ Y`. -/
71-
lemma hasLiftingProperty_mk_isInitial_iff [HasPushouts C] [HasPullbacks C]
71+
lemma hasLiftingProperty_mk_isInitial_iff [HasPushouts C]
7272
[CartesianMonoidalCategory C] [MonoidalClosed C] [BraidedCategory C]
7373
{A B K L X Y : C} {g : K ⟶ L} {h : X ⟶ Y}
7474
(i : IsInitial A) :
@@ -80,7 +80,7 @@ lemma hasLiftingProperty_mk_isInitial_iff [HasPushouts C] [HasPullbacks C]
8080
exact Adjunction.hasLiftingProperty_iff (ihom.adjunction B) g h
8181

8282
/-- `f □ (∅ ⟶ L)` lifts against `X ⟶ Y` if and only if `f` lifts against `L ⟹ X ⟶ L ⟹ Y`. -/
83-
lemma hasLiftingProperty_mk_isInitial_iff' [HasPushouts C] [HasPullbacks C]
83+
lemma hasLiftingProperty_mk_isInitial_iff' [HasPushouts C]
8484
[CartesianMonoidalCategory C] [MonoidalClosed C] [BraidedCategory C]
8585
{A B K L X Y : C} {f : A ⟶ B} {h : X ⟶ Y}
8686
(i : IsInitial K) :
@@ -100,7 +100,7 @@ lemma hasLiftingProperty_mk_isTerminal_iff [HasPushouts C] [HasPullbacks C]
100100
exact HasLiftingProperty.iff_of_arrow_iso_right g (PullbackHom.isTerminalIso _ t)
101101

102102
/-- `(∅ ⟶ B) □ g` lifts against `X ⟶ ⋆` if and only if `g` lifts against `(B ⟹ X) ⟶ ⋆`. -/
103-
lemma hasLiftingProperty_mk_isInitial_isTerminal_iff [HasPushouts C] [HasPullbacks C]
103+
lemma hasLiftingProperty_mk_isInitial_isTerminal_iff [HasPushouts C]
104104
[CartesianMonoidalCategory C] [MonoidalClosed C] [BraidedCategory C]
105105
{A B K L X Y : C} {g : K ⟶ L}
106106
(i : IsInitial A) (t : IsTerminal Y) :
@@ -112,7 +112,7 @@ lemma hasLiftingProperty_mk_isInitial_isTerminal_iff [HasPushouts C] [HasPullbac
112112
(t.hom_ext _ _))
113113

114114
/-- `f □ (∅ ⟶ L)` lifts against `X ⟶ ⋆` if and only if `f` lifts against `(L ⟹ X) ⟶ ⋆`. -/
115-
lemma hasLiftingProperty_mk_isInitial_isTerminal_iff' [HasPushouts C] [HasPullbacks C]
115+
lemma hasLiftingProperty_mk_isInitial_isTerminal_iff' [HasPushouts C]
116116
[CartesianMonoidalCategory C] [MonoidalClosed C] [BraidedCategory C]
117117
{A B K L X Y : C} {f : A ⟶ B}
118118
(i : IsInitial K) (t : IsTerminal Y) :

0 commit comments

Comments
 (0)