Skip to content

Commit 4b04f43

Browse files
committed
chore: spell results using PreservesFiniteProducts (#24293)
I believe these were written before `PreservesFiniteProducts` was a thing. Take the opportunity to make anonymous dot notation available. From Toric
1 parent 3d26669 commit 4b04f43

File tree

6 files changed

+42
-46
lines changed

6 files changed

+42
-46
lines changed

Mathlib/Algebra/Category/Ring/Under/Limits.lean

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,12 @@ instance (J : Type u) [Finite J] (f : J → Under R) :
9292
have hc : IsLimit c := Under.piFanIsLimit f
9393
preservesLimit_of_preserves_limit_cone hc (piFanTensorProductIsLimit f)
9494

95-
instance (J : Type) [Finite J] :
96-
PreservesLimitsOfShape (Discrete J) (tensorProd R S) :=
97-
let J' : Type u := ULift.{u} J
98-
have : PreservesLimitsOfShape (Discrete J') (tensorProd R S) :=
99-
preservesLimitsOfShape_of_discrete (tensorProd R S)
100-
let e : Discrete J' ≌ Discrete J := Discrete.equivalence Equiv.ulift
101-
preservesLimitsOfShape_of_equiv e (R.tensorProd S)
102-
10395
instance : PreservesFiniteProducts (tensorProd R S) where
104-
preserves J := { }
96+
preserves n :=
97+
let J : Type u := ULift.{u} (Fin n)
98+
have : PreservesLimitsOfShape (Discrete J) (tensorProd R S) :=
99+
preservesLimitsOfShape_of_discrete (tensorProd R S)
100+
preservesLimitsOfShape_of_equiv (Discrete.equivalence Equiv.ulift) (R.tensorProd S)
105101

106102
end Pi
107103

Mathlib/CategoryTheory/Closed/Cartesian.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ along the `prodComparison` isomorphism.
364364
-/
365365
noncomputable def cartesianClosedOfEquiv (e : C ≌ D) [CartesianClosed C] : CartesianClosed D :=
366366
letI := e.inverse.monoidalOfChosenFiniteProducts
367-
MonoidalClosed.ofEquiv (e.inverse) e.symm.toAdjunction
367+
MonoidalClosed.ofEquiv e.inverse e.symm.toAdjunction
368368

369369
end Functor
370370

Mathlib/CategoryTheory/Closed/Ideal.lean

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,13 @@ lemma preservesBinaryProducts_of_exponentialIdeal :
302302
/--
303303
If a reflective subcategory is an exponential ideal, then the reflector preserves finite products.
304304
-/
305-
lemma preservesFiniteProducts_of_exponentialIdeal (J : Type) [Finite J] :
306-
PreservesLimitsOfShape (Discrete J) (reflector i) := by
307-
letI := preservesBinaryProducts_of_exponentialIdeal i
308-
letI : PreservesLimitsOfShape _ (reflector i) := leftAdjoint_preservesTerminal_of_reflective.{0} i
309-
apply preservesFiniteProducts_of_preserves_binary_and_terminal (reflector i) J
305+
lemma Limits.PreservesFiniteProducts._of_exponentialIdeal : PreservesFiniteProducts (reflector i) :=
306+
have := preservesBinaryProducts_of_exponentialIdeal i
307+
have : PreservesLimitsOfShape _ (reflector i) := leftAdjoint_preservesTerminal_of_reflective.{0} i
308+
.of_preserves_binary_and_terminal _
309+
310+
@[deprecated (since := "2025-04-22")]
311+
alias preservesFiniteProducts_of_exponentialIdeal := PreservesFiniteProducts._of_exponentialIdeal
310312

311313
end
312314

Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ Copyright (c) 2020 Bhavik Mehta. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Bhavik Mehta
55
-/
6+
import Mathlib.CategoryTheory.Limits.Preserves.Finite
67
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts
78
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Products
8-
import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts
9-
import Mathlib.CategoryTheory.Limits.Shapes.FiniteProducts
109

1110
/-!
1211
# Constructing finite products from binary products and terminal.
@@ -145,22 +144,23 @@ lemma preservesFinOfPreservesBinaryAndTerminal :
145144
simp only [id_comp, ← F.map_comp]
146145
rfl
147146

148-
/-- If `F` preserves the terminal object and binary products, then it preserves limits of shape
149-
`Discrete (Fin n)`.
150-
-/
151-
lemma preservesShape_fin_of_preserves_binary_and_terminal (n : ℕ) :
152-
PreservesLimitsOfShape (Discrete (Fin n)) F where
153-
preservesLimit {K} := by
147+
/-- If `F` preserves the terminal object and binary products then it preserves finite products. -/
148+
lemma Limits.PreservesFiniteProducts.of_preserves_binary_and_terminal :
149+
PreservesFiniteProducts F where
150+
preserves n := by
151+
refine ⟨fun {K} ↦ ?_⟩
154152
let that : (Discrete.functor fun n => K.obj ⟨n⟩) ≅ K := Discrete.natIso fun ⟨i⟩ => Iso.refl _
155153
haveI := preservesFinOfPreservesBinaryAndTerminal F n fun n => K.obj ⟨n⟩
156154
apply preservesLimit_of_iso_diagram F that
157155

158-
/-- If `F` preserves the terminal object and binary products then it preserves finite products. -/
159-
lemma preservesFiniteProducts_of_preserves_binary_and_terminal (J : Type*) [Finite J] :
160-
PreservesLimitsOfShape (Discrete J) F :=
161-
let ⟨n, ⟨e⟩⟩ := Finite.exists_equiv_fin J
162-
have := preservesShape_fin_of_preserves_binary_and_terminal F n
163-
preservesLimitsOfShape_of_equiv (Discrete.equivalence e).symm _
156+
@[deprecated (since := "2025-04-20")]
157+
alias preservesFiniteProducts_of_preserves_binary_and_terminal :=
158+
PreservesFiniteProducts.of_preserves_binary_and_terminal
159+
160+
@[deprecated PreservesFiniteProducts.of_preserves_binary_and_terminal (since := "2025-04-22")]
161+
lemma preservesShape_fin_of_preserves_binary_and_terminal (n : ℕ) :
162+
PreservesLimitsOfShape (Discrete (Fin n)) F :=
163+
have : PreservesFiniteProducts F := .of_preserves_binary_and_terminal _; inferInstance
164164

165165
end Preserves
166166

Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,13 @@ theorem hasFiniteLimits_of_hasTerminal_and_pullbacks [HasTerminal C] [HasPullbac
266266
lemma preservesFiniteLimits_of_preservesTerminal_and_pullbacks [HasTerminal C]
267267
[HasPullbacks C] (G : C ⥤ D) [PreservesLimitsOfShape (Discrete.{0} PEmpty) G]
268268
[PreservesLimitsOfShape WalkingCospan G] : PreservesFiniteLimits G := by
269-
haveI : HasFiniteLimits C := hasFiniteLimits_of_hasTerminal_and_pullbacks
270-
haveI : PreservesLimitsOfShape (Discrete WalkingPair) G :=
269+
have : HasFiniteLimits C := hasFiniteLimits_of_hasTerminal_and_pullbacks
270+
have : PreservesLimitsOfShape (Discrete WalkingPair) G :=
271271
preservesBinaryProducts_of_preservesTerminal_and_pullbacks G
272-
haveI : PreservesLimitsOfShape WalkingParallelPair G :=
273-
preservesEqualizers_of_preservesPullbacks_and_binaryProducts G
274-
apply
275-
@preservesFiniteLimits_of_preservesEqualizers_and_finiteProducts _ _ _ _ _ _ G _ ?_
276-
refine ⟨fun n ↦ ?_⟩
277-
apply preservesFiniteProducts_of_preserves_binary_and_terminal G
272+
have : PreservesLimitsOfShape WalkingParallelPair G :=
273+
preservesEqualizers_of_preservesPullbacks_and_binaryProducts G
274+
have : PreservesFiniteProducts G := .of_preserves_binary_and_terminal _
275+
exact preservesFiniteLimits_of_preservesEqualizers_and_finiteProducts G
278276

279277
attribute [local instance] preservesFiniteLimits_of_preservesTerminal_and_pullbacks in
280278
/-- If a functor creates terminal objects and pullbacks, it creates finite limits.

Mathlib/CategoryTheory/Preadditive/LeftExact.lean

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ Copyright (c) 2022 Jakob von Raumer. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Markus Himmel, Jakob von Raumer
55
-/
6-
import Mathlib.CategoryTheory.Limits.Constructions.FiniteProductsOfBinaryProducts
7-
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels
86
import Mathlib.CategoryTheory.Limits.Constructions.LimitsOfProductsAndEqualizers
7+
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Kernels
98
import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor
109

1110
/-!
1211
# Left exactness of functors between preadditive categories
1312
1413
We show that a functor is left exact in the sense that it preserves finite limits, if it
1514
preserves kernels. The dual result holds for right exact functors and cokernels.
15+
1616
## Main results
17+
1718
* We first derive preservation of binary product in the lemma
1819
`preservesBinaryProductsOfPreservesKernels`,
1920
* then show the preservation of equalizers in `preservesEqualizerOfPreservesKernels`,
@@ -110,13 +111,12 @@ lemma preservesEqualizers_of_preservesKernels
110111
-/
111112
lemma preservesFiniteLimits_of_preservesKernels [HasFiniteProducts C] [HasEqualizers C]
112113
[HasZeroObject C] [HasZeroObject D] [∀ {X Y} (f : X ⟶ Y), PreservesLimit (parallelPair f 0) F] :
113-
PreservesFiniteLimits F := by
114-
letI := preservesEqualizers_of_preservesKernels F
115-
letI := preservesTerminalObject_of_preservesZeroMorphisms F
116-
letI := preservesLimitsOfShape_pempty_of_preservesTerminal F
117-
letI : PreservesFiniteProducts F :=
118-
fun _ ↦ preservesFiniteProducts_of_preserves_binary_and_terminal F _⟩
119-
exact preservesFiniteLimits_of_preservesEqualizers_and_finiteProducts F
114+
PreservesFiniteLimits F :=
115+
have := preservesEqualizers_of_preservesKernels F
116+
have := preservesTerminalObject_of_preservesZeroMorphisms F
117+
have := preservesLimitsOfShape_pempty_of_preservesTerminal F
118+
have : PreservesFiniteProducts F :=.of_preserves_binary_and_terminal F
119+
preservesFiniteLimits_of_preservesEqualizers_and_finiteProducts F
120120

121121
end FiniteLimits
122122

0 commit comments

Comments
 (0)