Skip to content

Commit

Permalink
style: remove last isolated where (#13202)
Browse files Browse the repository at this point in the history
Discovered when tweaking the rewritten style linter in #13199.
  • Loading branch information
grunweg authored and callesonne committed Jun 4, 2024
1 parent 877b9f5 commit def132b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ open WalkingPair

/-- The equivalence swapping left and right.
-/
def WalkingPair.swap : WalkingPair ≃ WalkingPair
where
def WalkingPair.swap : WalkingPair ≃ WalkingPair where
toFun j := WalkingPair.recOn j right left
invFun j := WalkingPair.recOn j right left
left_inv j := by cases j; repeat rfl
Expand Down Expand Up @@ -80,8 +79,7 @@ theorem WalkingPair.swap_symm_apply_ff : WalkingPair.swap.symm right = left :=

/-- An equivalence from `WalkingPair` to `Bool`, sometimes useful when reindexing limits.
-/
def WalkingPair.equivBool : WalkingPair ≃ Bool
where
def WalkingPair.equivBool : WalkingPair ≃ Bool where
toFun j := WalkingPair.recOn j true false
-- to match equiv.sum_equiv_sigma_bool
invFun b := Bool.recOn b right left
Expand Down Expand Up @@ -1012,8 +1010,7 @@ variable {C}

/-- The braiding isomorphism which swaps a binary product. -/
@[simps]
def prod.braiding (P Q : C) [HasBinaryProduct P Q] [HasBinaryProduct Q P] : P ⨯ Q ≅ Q ⨯ P
where
def prod.braiding (P Q : C) [HasBinaryProduct P Q] [HasBinaryProduct Q P] : P ⨯ Q ≅ Q ⨯ P where
hom := prod.lift prod.snd prod.fst
inv := prod.lift prod.snd prod.fst
#align category_theory.limits.prod.braiding CategoryTheory.Limits.prod.braiding
Expand Down Expand Up @@ -1288,8 +1285,7 @@ theorem prodComparison_natural (f : A ⟶ A') (g : B ⟶ B') :
-/
@[simps]
def prodComparisonNatTrans [HasBinaryProducts C] [HasBinaryProducts D] (F : C ⥤ D) (A : C) :
prod.functor.obj A ⋙ F ⟶ F ⋙ prod.functor.obj (F.obj A)
where
prod.functor.obj A ⋙ F ⟶ F ⋙ prod.functor.obj (F.obj A) where
app B := prodComparison F A B
naturality f := by simp [prodComparison_natural]
#align category_theory.limits.prod_comparison_nat_trans CategoryTheory.Limits.prodComparisonNatTrans
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Tactic/CC/Addition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ partial def mkCongrProofCore (lhs rhs : Expr) (heqProofs : Bool) : CCM Expr := d
guard (← pureIsDefEq (← inferType lhsFn) (← inferType rhsFn))
/- Create `r`, a proof for
`lhsFn lhsArgs[0] ... lhsArgs[n-1] = lhsFn rhsArgs[0] ... rhsArgs[n-1]`
where
`n := lhsArgs.size` -/
where `n := lhsArgs.size` -/
let some specLemma ← mkCCHCongrTheorem lhsFn lhsArgs.size | failure
let mut kindsIt := specLemma.argKinds
let mut lemmaArgs : Array Expr := #[]
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Topology/Homotopy/Product.lean
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ variable {I A : Type*} {X : I → Type*} [∀ i, TopologicalSpace (X i)] [Topolo
-- Porting note: this definition is already in `Topology.Homotopy.Basic`
-- /-- The product homotopy of `homotopies` between functions `f` and `g` -/
-- @[simps]
-- def Homotopy.pi (homotopies : ∀ i, Homotopy (f i) (g i)) : Homotopy (pi f) (pi g)
-- where
-- def Homotopy.pi (homotopies : ∀ i, Homotopy (f i) (g i)) : Homotopy (pi f) (pi g) where
-- toFun t i := homotopies i t
-- map_zero_left t := by ext i; simp only [pi_eval, Homotopy.apply_zero]
-- map_one_left t := by ext i; simp only [pi_eval, Homotopy.apply_one]
Expand Down
6 changes: 2 additions & 4 deletions test/FBinop.lean
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ example (s : Finset α) (t : Finset β) :
structure SubObj (X : Type _) where
carrier : Set X

instance : SetLike (SubObj X) X
where
instance : SetLike (SubObj X) X where
coe s := s.carrier
coe_injective' p q h := by cases p; cases q; congr

Expand All @@ -79,8 +78,7 @@ def SubObj.prod (s : SubObj X) (t : SubObj Y) : SubObj (X × Y) where
structure DecSubObj (X : Type _) [DecidableEq X] where
carrier : Set X

instance [DecidableEq X] : SetLike (DecSubObj X) X
where
instance [DecidableEq X] : SetLike (DecSubObj X) X where
coe s := s.carrier
coe_injective' p q h := by cases p; cases q; congr

Expand Down

0 comments on commit def132b

Please sign in to comment.