Skip to content

Commit

Permalink
fix: use isSimp := false in simps (#5977)
Browse files Browse the repository at this point in the history
Lean 3 `@[simps { attrs := [] }]` should be translated to `@[simps (config := { isSimp := false })]` to avoid adding `@[simp]` attribute.
  • Loading branch information
urkud authored and semorrison committed Aug 14, 2023
1 parent 3359d90 commit d22f5ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Quaternion.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ section Field

variable [LinearOrderedField R] (a b : ℍ[R])

@[simps (config := { attrs := [] })]
@[simps (config := { isSimp := false })]
instance instInv : Inv ℍ[R] :=
fun a => (normSq a)⁻¹ • star a⟩

Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Analysis/NormedSpace/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ In many cases the actual implementation is not important, so we don't mark the p
See also `contDiff_homeomorphUnitBall` and `contDiffOn_homeomorphUnitBall_symm` for
smoothness properties that hold when `E` is an inner-product space. -/
@[simps (config := { attrs := [] })]
@[simps (config := { isSimp := false })]
noncomputable def homeomorphUnitBall [NormedSpace ℝ E] : E ≃ₜ ball (0 : E) 1 where
toFun x :=
⟨(1 + ‖x‖ ^ 2).sqrt⁻¹ • x, by
Expand Down Expand Up @@ -221,9 +221,9 @@ noncomputable def homeomorphUnitBall [NormedSpace ℝ E] : E ≃ₜ ball (0 : E)
nlinarith [norm_nonneg (y : E), (mem_ball_zero_iff.1 y.2 : ‖(y : E)‖ < 1)]
#align homeomorph_unit_ball homeomorphUnitBall

-- Porting note: simp can prove this; removed simp
@[simp]
theorem coe_homeomorphUnitBall_apply_zero [NormedSpace ℝ E] :
(homeomorphUnitBall (0 : E) : E) = 0 := by simp
(homeomorphUnitBall (0 : E) : E) = 0 := by simp [homeomorphUnitBall_apply_coe]
#align coe_homeomorph_unit_ball_apply_zero coe_homeomorphUnitBall_apply_zero

open NormedField
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/Derivation/ToSquareZero.lean
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ theorem derivationToSquareZeroOfLift_apply (f : A →ₐ[R] B)

/-- Given a tower of algebras `R → A → B`, and a square-zero `I : Ideal B`, each `R`-derivation
from `A` to `I` corresponds to a lift `A →ₐ[R] B` of the canonical map `A →ₐ[R] B ⧸ I`. -/
@[simps (config := { attrs := [] })]
@[simps (config := { isSimp := false })]
def liftOfDerivationToSquareZero (f : Derivation R A I) : A →ₐ[R] B :=
{ ((I.restrictScalars R).subtype.comp f.toLinearMap + (IsScalarTower.toAlgHom R A B).toLinearMap :
A →ₗ[R] B) with
Expand Down
12 changes: 6 additions & 6 deletions Mathlib/RingTheory/PowerBasis.lean
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ where "the same" means that `pb` is a root of `pb'`s minimal polynomial and vice
See also `PowerBasis.equivOfMinpoly` which takes the hypothesis that the
minimal polynomials are identical.
-/
@[simps! (config := { attrs := [] }) apply]
@[simps! (config := { isSimp := false }) apply]
noncomputable def equivOfRoot (pb : PowerBasis A S) (pb' : PowerBasis A S')
(h₁ : aeval pb.gen (minpoly A pb'.gen) = 0) (h₂ : aeval pb'.gen (minpoly A pb.gen) = 0) :
S ≃ₐ[A] S' :=
Expand All @@ -367,14 +367,14 @@ noncomputable def equivOfRoot (pb : PowerBasis A S) (pb' : PowerBasis A S')
simp)
#align power_basis.equiv_of_root PowerBasis.equivOfRoot

-- @[simp] -- Porting note: simp can prove this
@[simp]
theorem equivOfRoot_aeval (pb : PowerBasis A S) (pb' : PowerBasis A S')
(h₁ : aeval pb.gen (minpoly A pb'.gen) = 0) (h₂ : aeval pb'.gen (minpoly A pb.gen) = 0)
(f : A[X]) : pb.equivOfRoot pb' h₁ h₂ (aeval pb.gen f) = aeval pb'.gen f :=
pb.lift_aeval _ h₂ _
#align power_basis.equiv_of_root_aeval PowerBasis.equivOfRoot_aeval

-- @[simp] -- Porting note: simp can prove this
@[simp]
theorem equivOfRoot_gen (pb : PowerBasis A S) (pb' : PowerBasis A S')
(h₁ : aeval pb.gen (minpoly A pb'.gen) = 0) (h₂ : aeval pb'.gen (minpoly A pb.gen) = 0) :
pb.equivOfRoot pb' h₁ h₂ pb.gen = pb'.gen :=
Expand All @@ -394,20 +394,20 @@ where "the same" means that they have identical minimal polynomials.
See also `PowerBasis.equivOfRoot` which takes the hypothesis that each generator is a root of the
other basis' minimal polynomial; `PowerBasis.equivOfRoot` is more general if `A` is not a field.
-/
@[simps! (config := { attrs := [] }) apply]
@[simps! (config := { isSimp := false }) apply]
noncomputable def equivOfMinpoly (pb : PowerBasis A S) (pb' : PowerBasis A S')
(h : minpoly A pb.gen = minpoly A pb'.gen) : S ≃ₐ[A] S' :=
pb.equivOfRoot pb' (h ▸ minpoly.aeval _ _) (h.symm ▸ minpoly.aeval _ _)
#align power_basis.equiv_of_minpoly PowerBasis.equivOfMinpoly

-- @[simp] -- Porting note: simp can prove this
@[simp]
theorem equivOfMinpoly_aeval (pb : PowerBasis A S) (pb' : PowerBasis A S')
(h : minpoly A pb.gen = minpoly A pb'.gen) (f : A[X]) :
pb.equivOfMinpoly pb' h (aeval pb.gen f) = aeval pb'.gen f :=
pb.equivOfRoot_aeval pb' _ _ _
#align power_basis.equiv_of_minpoly_aeval PowerBasis.equivOfMinpoly_aeval

-- @[simp] -- Porting note: simp can prove this
@[simp]
theorem equivOfMinpoly_gen (pb : PowerBasis A S) (pb' : PowerBasis A S')
(h : minpoly A pb.gen = minpoly A pb'.gen) : pb.equivOfMinpoly pb' h pb.gen = pb'.gen :=
pb.equivOfRoot_gen pb' _ _
Expand Down

0 comments on commit d22f5ff

Please sign in to comment.