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] - refactor(CategoryTheory/Monoidal/Braided): use monoidalComp in the proofs #10078

Closed
wants to merge 9 commits into from

Conversation

yuma-mizuno
Copy link
Collaborator

@yuma-mizuno yuma-mizuno commented Jan 28, 2024

@yuma-mizuno yuma-mizuno added the t-category-theory Category theory label Jan 28, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. label Jan 28, 2024
@yuma-mizuno yuma-mizuno added the awaiting-review The author would like community review of the PR label Jan 28, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. labels Jan 29, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added merge-conflict The PR has a merge conflict with master, and needs manual merging. and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. labels Jan 31, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Feb 1, 2024

#align category_theory.braiding_left_unitor_aux₂ CategoryTheory.braiding_leftUnitor_aux₂

@[simp]
theorem braiding_leftUnitor (X : C) : (β_ X (𝟙_ C)).hom ≫ (λ_ X).hom = (ρ_ X).hom := by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add the reassoc attribute here.

Comment on lines 260 to 272
theorem braiding_rightUnitor (X : C) : (β_ (𝟙_ C) X).hom ≫ (ρ_ X).hom = (λ_ X).hom := by
rw [← tensor_left_iff, id_tensor_comp, braiding_rightUnitor_aux₂]
rw [← whiskerLeft_iff, MonoidalCategory.whiskerLeft_comp, braiding_rightUnitor_aux₂]
#align category_theory.braiding_right_unitor CategoryTheory.braiding_rightUnitor

@[simp]
theorem braiding_tensorUnit_left (X : C) : (β_ (𝟙_ C) X).hom = (λ_ X).hom ≫ (ρ_ X).inv := by
simp [← braiding_rightUnitor]

theorem leftUnitor_inv_braiding (X : C) : (λ_ X).inv ≫ (β_ (𝟙_ C) X).hom = (ρ_ X).inv := by
apply (cancel_mono (ρ_ X).hom).1
simp only [assoc, braiding_rightUnitor, Iso.inv_hom_id]
simp
#align category_theory.left_unitor_inv_braiding CategoryTheory.leftUnitor_inv_braiding

@[simp]
theorem rightUnitor_inv_braiding (X : C) : (ρ_ X).inv ≫ (β_ X (𝟙_ C)).hom = (λ_ X).inv := by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lemmas braiding_rightUnitor, braiding_tensorUnit_left, leftUnitor_inv_braiding and rightUnitor_inv_braiding should have the reassoc attr, as well as braiding_tensorUnit_right below.

(𝟙 X₁ ⊗ (β_ X₂ Y₁).hom ⊗ 𝟙 Y₂) ≫ (𝟙 X₁ ⊗ (α_ Y₁ X₂ Y₂).hom) ≫ (α_ X₁ Y₁ (X₂ ⊗ Y₂)).inv :=
by dsimp [tensor_μ]; simp
#align category_theory.tensor_μ_def₂ CategoryTheory.tensor_μ_def₂

theorem tensor_μ_natural {X₁ X₂ Y₁ Y₂ U₁ U₂ V₁ V₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : U₁ ⟶ V₁)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reassoc could be useful here also.

convert tensor_μ_natural C (𝟙 Z₁) (𝟙 Z₂) f₁ f₂ using 1; simp
(Z₁ ⊗ Z₂) (f₁ ⊗ f₂) ≫ tensor_μ C (Z₁, Z₂) (Y₁, Y₂) =
tensor_μ C (Z₁, Z₂) (X₁, X₂) ≫ (Z₁ f₁ ⊗ Z₂ f₂) := by
convert tensor_μ_natural C (𝟙 Z₁) (𝟙 Z₂) f₁ f₂ using 1 <;> simp

theorem tensor_left_unitality (X₁ X₂ : C) :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reassoc should also be added to lemmas tensor_left_unitality, tensor_right_unitality, tensor_associativity, leftUnitor_monoidal, rightUnitor_monoidal, associator_monoidal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding reassoc to tensor_associativity and associator_monoidal seems to give errors unless we increase the maxHeartbeats. Do you think it's OK to do this, or should we postpone adding reassoc until some optimization is done?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the line attribute [reassoc] tensor_associativity associator_monoidal after the declarations seem to work without increasing maxHeartbeats.

@[reassoc]
theorem leftUnitor_inv_naturality' {X Y : C} (f : X ⟶ Y) :
f ≫ (λ_ Y).inv = (λ_ X).inv ≫ (_ ◁ f) := by simp
f ≫ (λ_ Y).inv = (λ_ X).inv ≫ _ ◁ f := by simp

theorem id_whiskerLeft_symm {X X' : C} (f : X ⟶ X') :
Copy link
Collaborator

@joelriou joelriou Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reassoc can be added to id_whiskerLeft_symm and whiskerRight_id_symm

Copy link
Collaborator

@joelriou joelriou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this great work! Apart from the reassoc attribute which shoud be added to some lemmas, this looks good to me.

@joelriou joelriou added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Feb 1, 2024
@yuma-mizuno yuma-mizuno added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Feb 1, 2024
@joelriou
Copy link
Collaborator

joelriou commented Feb 2, 2024

Thanks!

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Feb 2, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 2, 2024
@mathlib-bors
Copy link

mathlib-bors bot commented Feb 2, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title refactor(CategoryTheory/Monoidal/Braided): use monoidalComp in the proofs [Merged by Bors] - refactor(CategoryTheory/Monoidal/Braided): use monoidalComp in the proofs Feb 2, 2024
@mathlib-bors mathlib-bors bot closed this Feb 2, 2024
@mathlib-bors mathlib-bors bot deleted the ymizuno-braided branch February 2, 2024 06:57
mathlib-bors bot pushed a commit that referenced this pull request Feb 26, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 26, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 26, 2024
Louddy pushed a commit that referenced this pull request Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-category-theory Category theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants