Skip to content

[Merged by Bors] - refactor(CategoryTheory/Monoidal/Braided): use monoidalComp in the proofs#10078

Closed
yuma-mizuno wants to merge 9 commits intomasterfrom
ymizuno-braided
Closed

[Merged by Bors] - refactor(CategoryTheory/Monoidal/Braided): use monoidalComp in the proofs#10078
yuma-mizuno wants to merge 9 commits intomasterfrom
ymizuno-braided

Conversation

@yuma-mizuno
Copy link
Copy Markdown
Collaborator

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

@yuma-mizuno yuma-mizuno added the t-category-theory Category theory label Jan 28, 2024
@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jan 28, 2024
@ghost ghost added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels Jan 29, 2024
@ghost
Copy link
Copy Markdown

ghost commented Jan 31, 2024

@ghost ghost added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Jan 31, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) 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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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.

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
Copy Markdown
Contributor

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.

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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.

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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

@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 labels Feb 1, 2024
@yuma-mizuno yuma-mizuno added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Feb 1, 2024
@joelriou
Copy link
Copy Markdown
Contributor

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 labels Feb 2, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 2, 2024
@mathlib-bors
Copy link
Copy Markdown
Contributor

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
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.

2 participants