Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: port CategoryTheory.Bicategory.CoherenceTactic #4610

Closed
wants to merge 14 commits into from
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2399,6 +2399,7 @@ import Mathlib.Tactic.Cache
import Mathlib.Tactic.CancelDenoms
import Mathlib.Tactic.Cases
import Mathlib.Tactic.CasesM
import Mathlib.Tactic.CategoryTheory.BicategoryCoherence
import Mathlib.Tactic.CategoryTheory.Coherence
import Mathlib.Tactic.CategoryTheory.Elementwise
import Mathlib.Tactic.CategoryTheory.Reassoc
Expand Down
4 changes: 4 additions & 0 deletions Mathlib/Algebra/Category/ModuleCat/Adjunctions.lean
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ end

namespace Free

open MonoidalCategory

variable [CommRing R]

attribute [local ext] TensorProduct.ext
Expand Down Expand Up @@ -214,6 +216,8 @@ instance : IsIso (@LaxMonoidal.ε _ _ _ _ _ _ (free R).obj _ _) := by

end Free

open MonoidalCategory

variable [CommRing R]

/-- The free functor `Type u ⥤ ModuleCat R`, as a monoidal functor. -/
Expand Down
2 changes: 2 additions & 0 deletions Mathlib/Algebra/Category/ModuleCat/Monoidal/Closed.lean
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ theorem ihom_map_apply {M N P : ModuleCat.{u} R} (f : N ⟶ P) (g : ModuleCat.of
set_option linter.uppercaseLean3 false in
#align Module.ihom_map_apply ModuleCat.ihom_map_apply

open MonoidalCategory

-- porting note: `CoeFun` was replaced by `FunLike`
-- I can't seem to express the function coercion here without writing `@FunLike.coe`.
@[simp]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic

universe v w x u

open CategoryTheory
open CategoryTheory MonoidalCategory

namespace ModuleCat

Expand Down
8 changes: 1 addition & 7 deletions Mathlib/CategoryTheory/Limits/Yoneda.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ We calculate the colimit of `Y ↦ (X ⟶ Y)`, which is just `PUnit`.
We also show the (co)yoneda embeddings preserve limits and jointly reflect them.
-/

-- import Mathlib.Tactic.AssertExists -- Porting note: see end of file

open Opposite

open CategoryTheory

open CategoryTheory.Limits
open Opposite CategoryTheory Limits

universe w v u

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Monoidal/Braided.lean
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ just requiring a property.
-/


open CategoryTheory
open CategoryTheory MonoidalCategory

universe v v₁ v₂ v₃ u u₁ u₂ u₃

Expand Down
55 changes: 12 additions & 43 deletions Mathlib/CategoryTheory/Monoidal/Category.lean
Original file line number Diff line number Diff line change
Expand Up @@ -137,42 +137,13 @@ class MonoidalCategory (C : Type u) [𝒞 : Category.{v} C] where
aesop_cat
#align category_theory.monoidal_category CategoryTheory.MonoidalCategory

-- Porting Note: `restate_axiom` doesn't seem to be necessary in Lean 4
-- restate_axiom MonoidalCategory.tensor_id'

attribute [simp] MonoidalCategory.tensor_id

-- Porting Note: same as above
-- restate_axiom MonoidalCategory.tensor_comp'

attribute [reassoc] MonoidalCategory.tensor_comp

-- This would be redundant in the simp set.
attribute [simp] MonoidalCategory.tensor_comp

-- Porting Note: same as above
-- restate_axiom MonoidalCategory.associator_naturality'

attribute [reassoc] MonoidalCategory.associator_naturality

-- Porting Note: same as above
-- restate_axiom MonoidalCategory.leftUnitor_naturality'

attribute [reassoc] MonoidalCategory.leftUnitor_naturality

-- Porting Note: same as above
-- restate_axiom MonoidalCategory.rightUnitor_naturality'

attribute [reassoc] MonoidalCategory.rightUnitor_naturality

-- Porting Note: same as above
-- restate_axiom MonoidalCategory.pentagon'

-- Porting Note: same as above
-- restate_axiom MonoidalCategory.triangle'

attribute [reassoc] MonoidalCategory.pentagon

attribute [reassoc (attr := simp)] MonoidalCategory.triangle

-- Porting Note: This is here to make `tensorUnit` explicitly depend on `C`, which was done in
Expand All @@ -182,31 +153,30 @@ open CategoryTheory.MonoidalCategory in
abbrev MonoidalCategory.tensorUnit (C : Type u) [Category.{v} C] [MonoidalCategory C] : C :=
tensorUnit' (C := C)

open MonoidalCategory
namespace MonoidalCategory

-- mathport name: tensor_obj
/-- Notation for `tensorObj`, the tensor product of objects in a monoidal category -/
infixr:70 " ⊗ " => tensorObj
scoped infixr:70 " ⊗ " => tensorObj

-- mathport name: tensor_hom
/-- Notation for `tensorHom`, the tensor product of morphisms in a monoidal category -/
infixr:70 " ⊗ " => tensorHom
scoped infixr:70 " ⊗ " => tensorHom

-- mathport name: «expr𝟙_»
/-- Notation for `tensorUnit`, the two-sided identity of `⊗` -/
notation "𝟙_" => tensorUnit
scoped notation "𝟙_" => tensorUnit

-- mathport name: exprα_
/-- Notation for the monoidal `associator`: `(X ⊗ Y) ⊗ Z) ≃ X ⊗ (Y ⊗ Z)` -/
notation "α_" => associator
scoped notation "α_" => associator

-- mathport name: «exprλ_»
/-- Notation for the `leftUnitor`: `𝟙_C ⊗ X ≃ X` -/
notation "λ_" => leftUnitor
scoped notation "λ_" => leftUnitor

-- mathport name: exprρ_
/-- Notation for the `rightUnitor`: `X ⊗ 𝟙_C ≃ X` -/
notation "ρ_" => rightUnitor
scoped notation "ρ_" => rightUnitor

end MonoidalCategory

open scoped MonoidalCategory
open MonoidalCategory

variable (C : Type u) [𝒞 : Category.{v} C] [MonoidalCategory C]

Expand All @@ -220,7 +190,6 @@ def tensorIso {C : Type u} {X Y X' Y' : C} [Category.{v} C] [MonoidalCategory.{v
inv_hom_id := by rw [← tensor_comp, Iso.inv_hom_id, Iso.inv_hom_id, ← tensor_id]
#align category_theory.tensor_iso CategoryTheory.tensorIso

-- mathport name: tensor_iso
/-- Notation for `tensorIso`, the tensor product of isomorphisms -/
infixr:70 " ⊗ " => tensorIso

Expand Down
4 changes: 1 addition & 3 deletions Mathlib/CategoryTheory/Monoidal/Discrete.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ Multiplicative morphisms induced monoidal functors.

universe u

open CategoryTheory

open CategoryTheory.Discrete
open CategoryTheory Discrete MonoidalCategory

variable (M : Type u) [Monoid M]

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/CategoryTheory/Monoidal/Rigid/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ rigid category, monoidal category
-/


open CategoryTheory
open CategoryTheory MonoidalCategory

universe v v₁ v₂ v₃ u u₁ u₂ u₃

Expand Down
2 changes: 2 additions & 0 deletions Mathlib/CategoryTheory/Monoidal/Rigid/OfEquivalence.lean
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ noncomputable section

namespace CategoryTheory

open MonoidalCategory

variable {C D : Type _} [Category C] [Category D] [MonoidalCategory C] [MonoidalCategory D]

variable (F : MonoidalFunctor C D)
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/CategoryTheory/Monoidal/Types/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import Mathlib.Logic.Equiv.Fin
-/


open CategoryTheory

open CategoryTheory.Limits
open CategoryTheory Limits MonoidalCategory

open Tactic

Expand Down
2 changes: 2 additions & 0 deletions Mathlib/CategoryTheory/Monoidal/Types/Symmetric.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ universe v u

namespace CategoryTheory

open MonoidalCategory

instance typesSymmetric : SymmetricCategory.{u} (Type u) :=
symmetricOfChosenFiniteProducts Types.terminalLimitCone Types.binaryProductLimitCone
#align category_theory.types_symmetric CategoryTheory.typesSymmetric
Expand Down
7 changes: 4 additions & 3 deletions Mathlib/RepresentationTheory/Action.lean
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,8 @@ end Abelian

section Monoidal

open MonoidalCategory

variable [MonoidalCategory V]

instance : MonoidalCategory (Action V G) :=
Expand Down Expand Up @@ -882,8 +884,8 @@ def diagonalOneIsoLeftRegular (G : Type u) [Monoid G] : diagonal G 1 ≅ leftReg
set_option linter.uppercaseLean3 false in
#align Action.diagonal_one_iso_left_regular Action.diagonalOneIsoLeftRegular

/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
open MonoidalCategory

/-- Given `X : Action (Type u) (Mon.of G)` for `G` a group, then `G × X` (with `G` acting as left
multiplication on the first factor and by `X.ρ` on the second) is isomorphic as a `G`-set to
`G × X` (with `G` acting as left multiplication on the first factor and trivially on the second).
Expand Down Expand Up @@ -923,7 +925,6 @@ noncomputable def leftRegularTensorIso (G : Type u) [Group G] (X : Action (Type
set_option linter.uppercaseLean3 false in
#align Action.left_regular_tensor_iso Action.leftRegularTensorIso

/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/-- The natural isomorphism of `G`-sets `Gⁿ⁺¹ ≅ G × Gⁿ`, where `G` acts by left multiplication on
each factor. -/
@[simps!]
Expand Down
1 change: 1 addition & 0 deletions Mathlib/Tactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Mathlib.Tactic.Cache
import Mathlib.Tactic.CancelDenoms
import Mathlib.Tactic.Cases
import Mathlib.Tactic.CasesM
import Mathlib.Tactic.CategoryTheory.BicategoryCoherence
import Mathlib.Tactic.CategoryTheory.Coherence
import Mathlib.Tactic.CategoryTheory.Elementwise
import Mathlib.Tactic.CategoryTheory.Reassoc
Expand Down