Skip to content

Commit

Permalink
chore: classify simp can prove porting notes (#10930)
Browse files Browse the repository at this point in the history
Classify by adding issue number (#10618) to porting notes claiming anything semantically equivalent to 
- "`simp` can prove this"
- "`simp` can simplify this`"
- "was `@[simp]`, now can be proved by `simp`"
- "was `@[simp]`, but `simp` can prove it"
- "removed simp attribute as the equality can already be obtained by `simp`"
- "`simp` can already prove this"
- "`simp` already proves this"
- "`simp` can prove these"
  • Loading branch information
pitmonticone committed Feb 27, 2024
1 parent df231e4 commit d8fa853
Show file tree
Hide file tree
Showing 18 changed files with 82 additions and 81 deletions.
10 changes: 5 additions & 5 deletions Mathlib/Algebra/Order/Monoid/WithTop.lean
Expand Up @@ -163,12 +163,12 @@ theorem add_eq_coe :
| some a, some b, c => by norm_cast; simp
#align with_top.add_eq_coe WithTop.add_eq_coe

-- Porting note: simp can already prove this.
-- Porting note (#10618): simp can already prove this.
-- @[simp]
theorem add_coe_eq_top_iff {x : WithTop α} {y : α} : x + y = ⊤ ↔ x = ⊤ := by simp
#align with_top.add_coe_eq_top_iff WithTop.add_coe_eq_top_iff

-- Porting note: simp can already prove this.
-- Porting note (#10618): simp can already prove this.
-- @[simp]
theorem coe_add_eq_top_iff {y : WithTop α} : ↑x + y = ⊤ ↔ y = ⊤ := by simp
#align with_top.coe_add_eq_top_iff WithTop.coe_add_eq_top_iff
Expand Down Expand Up @@ -428,7 +428,7 @@ theorem zero_lt_top [OrderedAddCommMonoid α] : (0 : WithTop α) < ⊤ :=
coe_lt_top 0
#align with_top.zero_lt_top WithTop.zero_lt_top

-- Porting note: simp can already prove this.
-- Porting note (#10618): simp can already prove this.
-- @[simp]
@[norm_cast]
theorem zero_lt_coe [OrderedAddCommMonoid α] (a : α) : (0 : WithTop α) < a ↔ 0 < a :=
Expand Down Expand Up @@ -638,13 +638,13 @@ theorem add_eq_coe : a + b = x ↔ ∃ a' b' : α, ↑a' = a ∧ ↑b' = b ∧ a
WithTop.add_eq_coe
#align with_bot.add_eq_coe WithBot.add_eq_coe

-- Porting note: simp can already prove this.
-- Porting note (#10618): simp can already prove this.
-- @[simp]
theorem add_coe_eq_bot_iff : a + y = ⊥ ↔ a = ⊥ :=
WithTop.add_coe_eq_top_iff
#align with_bot.add_coe_eq_bot_iff WithBot.add_coe_eq_bot_iff

-- Porting note: simp can already prove this.
-- Porting note (#10618): simp can already prove this.
-- @[simp]
theorem coe_add_eq_bot_iff : ↑x + b = ⊥ ↔ b = ⊥ :=
WithTop.coe_add_eq_top_iff
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/BoxIntegral/Partition/Additive.lean
Expand Up @@ -78,7 +78,7 @@ theorem coe_injective : Injective fun (f : ι →ᵇᵃ[I₀] M) x => f x :=
DFunLike.coe_injective
#align box_integral.box_additive_map.coe_injective BoxIntegral.BoxAdditiveMap.coe_injective

-- porting note: was @[simp], now can be proved by `simp`
-- Porting note (#10618): was @[simp], now can be proved by `simp`
theorem coe_inj {f g : ι →ᵇᵃ[I₀] M} : (f : Box ι → M) = g ↔ f = g := DFunLike.coe_fn_eq
#align box_integral.box_additive_map.coe_inj BoxIntegral.BoxAdditiveMap.coe_inj

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/InnerProductSpace/TwoDim.lean
Expand Up @@ -283,7 +283,7 @@ theorem rightAngleRotation_symm :
exact LinearIsometryEquiv.toLinearIsometry_injective rfl
#align orientation.right_angle_rotation_symm Orientation.rightAngleRotation_symm

-- @[simp] -- Porting note: simp already proves this
-- @[simp] -- Porting note (#10618): simp already proves this
theorem inner_rightAngleRotation_self (x : E) : ⟪J x, x⟫ = 0 := by simp
#align orientation.inner_right_angle_rotation_self Orientation.inner_rightAngleRotation_self

Expand All @@ -308,7 +308,7 @@ theorem areaForm_rightAngleRotation_right (x y : E) : ω x (J y) = ⟪x, y⟫ :=
rw [← o.inner_rightAngleRotation_left, o.inner_comp_rightAngleRotation]
#align orientation.area_form_right_angle_rotation_right Orientation.areaForm_rightAngleRotation_right

-- @[simp] -- Porting note: simp already proves this
-- @[simp] -- Porting note (#10618): simp already proves this
theorem areaForm_comp_rightAngleRotation (x y : E) : ω (J x) (J y) = ω x y := by simp
#align orientation.area_form_comp_right_angle_rotation Orientation.areaForm_comp_rightAngleRotation

Expand Down
23 changes: 12 additions & 11 deletions Mathlib/Analysis/SpecialFunctions/Integrals.lean
Expand Up @@ -274,64 +274,65 @@ theorem intervalIntegrable_inv_one_add_sq :
/-! ### Integrals of the form `c * ∫ x in a..b, f (c * x + d)` -/


-- Porting note: was @[simp]; simpNF says LHS does not simplify when applying lemma on itself
-- Porting note (#10618): was @[simp];
-- simpNF says LHS does not simplify when applying lemma on itself
theorem mul_integral_comp_mul_right : (c * ∫ x in a..b, f (x * c)) = ∫ x in a * c..b * c, f x :=
smul_integral_comp_mul_right f c
#align interval_integral.mul_integral_comp_mul_right intervalIntegral.mul_integral_comp_mul_right

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem mul_integral_comp_mul_left : (c * ∫ x in a..b, f (c * x)) = ∫ x in c * a..c * b, f x :=
smul_integral_comp_mul_left f c
#align interval_integral.mul_integral_comp_mul_left intervalIntegral.mul_integral_comp_mul_left

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem inv_mul_integral_comp_div : (c⁻¹ * ∫ x in a..b, f (x / c)) = ∫ x in a / c..b / c, f x :=
inv_smul_integral_comp_div f c
#align interval_integral.inv_mul_integral_comp_div intervalIntegral.inv_mul_integral_comp_div

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem mul_integral_comp_mul_add :
(c * ∫ x in a..b, f (c * x + d)) = ∫ x in c * a + d..c * b + d, f x :=
smul_integral_comp_mul_add f c d
#align interval_integral.mul_integral_comp_mul_add intervalIntegral.mul_integral_comp_mul_add

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem mul_integral_comp_add_mul :
(c * ∫ x in a..b, f (d + c * x)) = ∫ x in d + c * a..d + c * b, f x :=
smul_integral_comp_add_mul f c d
#align interval_integral.mul_integral_comp_add_mul intervalIntegral.mul_integral_comp_add_mul

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem inv_mul_integral_comp_div_add :
(c⁻¹ * ∫ x in a..b, f (x / c + d)) = ∫ x in a / c + d..b / c + d, f x :=
inv_smul_integral_comp_div_add f c d
#align interval_integral.inv_mul_integral_comp_div_add intervalIntegral.inv_mul_integral_comp_div_add

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem inv_mul_integral_comp_add_div :
(c⁻¹ * ∫ x in a..b, f (d + x / c)) = ∫ x in d + a / c..d + b / c, f x :=
inv_smul_integral_comp_add_div f c d
#align interval_integral.inv_mul_integral_comp_add_div intervalIntegral.inv_mul_integral_comp_add_div

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem mul_integral_comp_mul_sub :
(c * ∫ x in a..b, f (c * x - d)) = ∫ x in c * a - d..c * b - d, f x :=
smul_integral_comp_mul_sub f c d
#align interval_integral.mul_integral_comp_mul_sub intervalIntegral.mul_integral_comp_mul_sub

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem mul_integral_comp_sub_mul :
(c * ∫ x in a..b, f (d - c * x)) = ∫ x in d - c * b..d - c * a, f x :=
smul_integral_comp_sub_mul f c d
#align interval_integral.mul_integral_comp_sub_mul intervalIntegral.mul_integral_comp_sub_mul

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem inv_mul_integral_comp_div_sub :
(c⁻¹ * ∫ x in a..b, f (x / c - d)) = ∫ x in a / c - d..b / c - d, f x :=
inv_smul_integral_comp_div_sub f c d
#align interval_integral.inv_mul_integral_comp_div_sub intervalIntegral.inv_mul_integral_comp_div_sub

-- Porting note: was @[simp]
-- Porting note (#10618): was @[simp]
theorem inv_mul_integral_comp_sub_div :
(c⁻¹ * ∫ x in a..b, f (d - x / c)) = ∫ x in d - b / c..d - a / c, f x :=
inv_smul_integral_comp_sub_div f c d
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/Analysis/SpecialFunctions/Trigonometric/Basic.lean
Expand Up @@ -396,22 +396,22 @@ theorem cos_int_mul_two_pi_sub (x : ℝ) (n : ℤ) : cos (n * (2 * π) - x) = co
cos_neg x ▸ cos_periodic.int_mul_sub_eq n
#align real.cos_int_mul_two_pi_sub Real.cos_int_mul_two_pi_sub

-- Porting note: was @[simp] but simp can prove it
-- Porting note (#10618): was @[simp], but simp can prove it
theorem cos_nat_mul_two_pi_add_pi (n : ℕ) : cos (n * (2 * π) + π) = -1 := by
simpa only [cos_zero] using (cos_periodic.nat_mul n).add_antiperiod_eq cos_antiperiodic
#align real.cos_nat_mul_two_pi_add_pi Real.cos_nat_mul_two_pi_add_pi

-- Porting note: was @[simp] but simp can prove it
-- Porting note (#10618): was @[simp], but simp can prove it
theorem cos_int_mul_two_pi_add_pi (n : ℤ) : cos (n * (2 * π) + π) = -1 := by
simpa only [cos_zero] using (cos_periodic.int_mul n).add_antiperiod_eq cos_antiperiodic
#align real.cos_int_mul_two_pi_add_pi Real.cos_int_mul_two_pi_add_pi

-- Porting note: was @[simp] but simp can prove it
-- Porting note (#10618): was @[simp], but simp can prove it
theorem cos_nat_mul_two_pi_sub_pi (n : ℕ) : cos (n * (2 * π) - π) = -1 := by
simpa only [cos_zero] using (cos_periodic.nat_mul n).sub_antiperiod_eq cos_antiperiodic
#align real.cos_nat_mul_two_pi_sub_pi Real.cos_nat_mul_two_pi_sub_pi

-- Porting note: was @[simp] but simp can prove it
-- Porting note (#10618): was @[simp], but simp can prove it
theorem cos_int_mul_two_pi_sub_pi (n : ℤ) : cos (n * (2 * π) - π) = -1 := by
simpa only [cos_zero] using (cos_periodic.int_mul n).sub_antiperiod_eq cos_antiperiodic
#align real.cos_int_mul_two_pi_sub_pi Real.cos_int_mul_two_pi_sub_pi
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Abelian/NonPreadditive.lean
Expand Up @@ -280,7 +280,7 @@ abbrev σ {A : C} : A ⨯ A ⟶ A :=

end

-- Porting note: simp can prove these
-- Porting note (#10618): simp can prove these
@[reassoc]
theorem diag_σ {X : C} : diag X ≫ σ = 0 := by rw [cokernel.condition_assoc, zero_comp]
#align category_theory.non_preadditive_abelian.diag_σ CategoryTheory.NonPreadditiveAbelian.diag_σ
Expand Down
16 changes: 8 additions & 8 deletions Mathlib/CategoryTheory/Limits/Opposites.lean
Expand Up @@ -633,12 +633,12 @@ def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
(Cocone.whisker walkingCospanOpEquiv.functor c))
#align category_theory.limits.pushout_cocone.unop CategoryTheory.Limits.PushoutCocone.unop

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem unop_fst {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
c.unop.fst = c.inl.unop := by simp
#align category_theory.limits.pushout_cocone.unop_fst CategoryTheory.Limits.PushoutCocone.unop_fst

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem unop_snd {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
c.unop.snd = c.inr.unop := by aesop_cat
#align category_theory.limits.pushout_cocone.unop_snd CategoryTheory.Limits.PushoutCocone.unop_snd
Expand All @@ -651,12 +651,12 @@ def op {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : Pullbac
(Cone.whisker walkingSpanOpEquiv.inverse (Cocone.op c))
#align category_theory.limits.pushout_cocone.op CategoryTheory.Limits.PushoutCocone.op

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem op_fst {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.op.fst = c.inl.op :=
by aesop_cat
#align category_theory.limits.pushout_cocone.op_fst CategoryTheory.Limits.PushoutCocone.op_fst

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem op_snd {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : c.op.snd = c.inr.op :=
by aesop_cat
#align category_theory.limits.pushout_cocone.op_snd CategoryTheory.Limits.PushoutCocone.op_snd
Expand All @@ -675,12 +675,12 @@ def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) :
(Cone.whisker walkingSpanOpEquiv.functor c))
#align category_theory.limits.pullback_cone.unop CategoryTheory.Limits.PullbackCone.unop

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem unop_inl {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) :
c.unop.inl = c.fst.unop := by aesop_cat
#align category_theory.limits.pullback_cone.unop_inl CategoryTheory.Limits.PullbackCone.unop_inl

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem unop_inr {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) :
c.unop.inr = c.snd.unop := by aesop_cat
#align category_theory.limits.pullback_cone.unop_inr CategoryTheory.Limits.PullbackCone.unop_inr
Expand All @@ -692,12 +692,12 @@ def op {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : PushoutC
(Cocone.whisker walkingCospanOpEquiv.inverse (Cone.op c))
#align category_theory.limits.pullback_cone.op CategoryTheory.Limits.PullbackCone.op

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem op_inl {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.op.inl = c.fst.op :=
by aesop_cat
#align category_theory.limits.pullback_cone.op_inl CategoryTheory.Limits.PullbackCone.op_inl

-- porting note: removed simp attribute as the equality can already be obtained by simp
-- Porting note (#10618): removed simp attribute as the equality can already be obtained by simp
theorem op_inr {X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) : c.op.inr = c.snd.op :=
by aesop_cat
#align category_theory.limits.pullback_cone.op_inr CategoryTheory.Limits.PullbackCone.op_inr
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean
Expand Up @@ -808,19 +808,19 @@ instance prod.map_mono {C : Type*} [Category C] {W X Y Z : C} (f : W ⟶ Y) (g :
simpa using congr_arg (fun f => f ≫ prod.snd) h⟩
#align category_theory.limits.prod.map_mono CategoryTheory.Limits.prod.map_mono

@[reassoc] -- Porting note: simp can prove these
@[reassoc] -- Porting note (#10618): simp can prove these
theorem prod.diag_map {X Y : C} (f : X ⟶ Y) [HasBinaryProduct X X] [HasBinaryProduct Y Y] :
diag X ≫ prod.map f f = f ≫ diag Y := by simp
#align category_theory.limits.prod.diag_map CategoryTheory.Limits.prod.diag_map
#align category_theory.limits.prod.diag_map_assoc CategoryTheory.Limits.prod.diag_map_assoc

@[reassoc] -- Porting note: simp can prove these
@[reassoc] -- Porting note (#10618): simp can prove these
theorem prod.diag_map_fst_snd {X Y : C} [HasBinaryProduct X Y] [HasBinaryProduct (X ⨯ Y) (X ⨯ Y)] :
diag (X ⨯ Y) ≫ prod.map prod.fst prod.snd = 𝟙 (X ⨯ Y) := by simp
#align category_theory.limits.prod.diag_map_fst_snd CategoryTheory.Limits.prod.diag_map_fst_snd
#align category_theory.limits.prod.diag_map_fst_snd_assoc CategoryTheory.Limits.prod.diag_map_fst_snd_assoc

@[reassoc] -- Porting note: simp can prove these
@[reassoc] -- Porting note (#10618): simp can prove these
theorem prod.diag_map_fst_snd_comp [HasLimitsOfShape (Discrete WalkingPair) C] {X X' Y Y' : C}
(g : X ⟶ Y) (g' : X' ⟶ Y') :
diag (X ⨯ X') ≫ prod.map (prod.fst ≫ g) (prod.snd ≫ g') = prod.map g g' := by simp
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean
Expand Up @@ -807,7 +807,7 @@ theorem biproduct.toSubtype_eq_desc [DecidablePred p] :
biproduct.hom_ext' _ _ (by simp)
#align category_theory.limits.biproduct.to_subtype_eq_desc CategoryTheory.Limits.biproduct.toSubtype_eq_desc

@[reassoc] -- Porting note: simp can prove both versions
@[reassoc] -- Porting note (#10618): simp can prove both versions
theorem biproduct.ι_toSubtype_subtype (j : Subtype p) :
biproduct.ι f j ≫ biproduct.toSubtype f p = biproduct.ι (Subtype.restrict p f) j := by
ext
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/PUnit.lean
Expand Up @@ -31,7 +31,7 @@ namespace Functor
def star : C ⥤ Discrete PUnit.{w + 1} :=
(Functor.const _).obj ⟨⟨⟩⟩
#align category_theory.functor.star CategoryTheory.Functor.star
-- Porting note: simp can simplify this
-- Porting note (#10618): simp can simplify this
attribute [nolint simpNF] star_map_down_down
variable {C}

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Set/Finite.lean
Expand Up @@ -547,7 +547,7 @@ theorem finite_toSet (s : Finset α) : (s : Set α).Finite :=
Set.toFinite _
#align finset.finite_to_set Finset.finite_toSet

-- porting note: was @[simp], now `simp` can prove it
-- Porting note (#10618): was @[simp], now `simp` can prove it
theorem finite_toSet_toFinset (s : Finset α) : s.finite_toSet.toFinset = s := by
rw [toFinite_toFinset, toFinset_coe]
#align finset.finite_to_set_to_finset Finset.finite_toSet_toFinset
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/GroupTheory/Perm/Sign.lean
Expand Up @@ -548,7 +548,7 @@ section SignType.sign

variable [Fintype α]

--@[simp] porting note: simp can prove
--@[simp] Porting note (#10618): simp can prove
theorem sign_mul (f g : Perm α) : sign (f * g) = sign f * sign g :=
MonoidHom.map_mul sign f g
#align equiv.perm.sign_mul Equiv.Perm.sign_mul
Expand All @@ -558,7 +558,7 @@ theorem sign_trans (f g : Perm α) : sign (f.trans g) = sign g * sign f := by
rw [← mul_def, sign_mul]
#align equiv.perm.sign_trans Equiv.Perm.sign_trans

--@[simp] porting note: simp can prove
--@[simp] Porting note (#10618): simp can prove
theorem sign_one : sign (1 : Perm α) = 1 :=
MonoidHom.map_one sign
#align equiv.perm.sign_one Equiv.Perm.sign_one
Expand All @@ -568,7 +568,7 @@ theorem sign_refl : sign (Equiv.refl α) = 1 :=
MonoidHom.map_one sign
#align equiv.perm.sign_refl Equiv.Perm.sign_refl

--@[simp] porting note: simp can prove
--@[simp] Porting note (#10618): simp can prove
theorem sign_inv (f : Perm α) : sign f⁻¹ = sign f := by
rw [MonoidHom.map_inv sign f, Int.units_inv_eq_self]
#align equiv.perm.sign_inv Equiv.Perm.sign_inv
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/LinearAlgebra/Dimension/Constructions.lean
Expand Up @@ -319,7 +319,7 @@ theorem FiniteDimensional.finrank_fintype_fun_eq_card : finrank R (η → R) = F
#align finite_dimensional.finrank_fintype_fun_eq_card FiniteDimensional.finrank_fintype_fun_eq_card

/-- The vector space of functions on `Fin n` has finrank equal to `n`. -/
-- @[simp] -- Porting note: simp already proves this
-- @[simp] -- Porting note (#10618): simp already proves this
theorem FiniteDimensional.finrank_fin_fun {n : ℕ} : finrank R (Fin n → R) = n := by simp
#align finite_dimensional.finrank_fin_fun FiniteDimensional.finrank_fin_fun

Expand Down

0 comments on commit d8fa853

Please sign in to comment.