feat(CategoryTheory/Monoidal): tensorμ_braid_swap and tensor-product IsCommComonObj#38314
Conversation
…IsCommComonObj Adds two symmetric-monoidal coherence results in a new file `Mathlib.CategoryTheory.Monoidal.Symmetric.TensorBraidSwap`: * `MonoidalCategory.tensorμ_braid_swap` — the canonical rearrangement `tensorμ A A Y Y : (A ⊗ A) ⊗ (Y ⊗ Y) ⟶ (A ⊗ Y) ⊗ (A ⊗ Y)` intertwines the braiding on `A ⊗ Y` with the pair of braidings on `A` and `Y`. Sibling of `CategoryTheory.MonObj.mul_braiding` (`Mathlib.CategoryTheory.Monoidal.Mon_`, line 759) which closes a structurally adjacent equation by the same simp + slice recipe. * Tensor-product instance for `IsCommComonObj`: if `A` and `B` carry commutative comonoid structures in a symmetric monoidal category, so does `A ⊗ B`. Reduces commutativity of `Δ[A ⊗ B]` via `tensorμ_braid_swap` to the pointwise hypotheses on `A` and `B`. ## Placement rationale These live in a new `Symmetric/` subdirectory rather than being appended to `Braided/Basic.lean` because the latter's top-level `variable [BraidedCategory C]` creates an instance diamond with any locally-added `[SymmetricCategory C]`. On Lean v4.30.0-rc2 that diamond blocks `rw [SymmetricCategory.symmetry]` motive extraction through `A ◁ _ ▷ Y` — even though the pattern is literally present in the target, the two distinct `BraidedCategory C` instances (outer variable vs `SymmetricCategory.toBraidedCategory`) cause the rewrite to fail. A clean file with only `[SymmetricCategory C]` as its variable avoids this. ## Downstream consumers The tensor-product `IsCommComonObj` instance is load-bearing for the `markovcat` library (external, https://github.com/pedroscortes/markovcat) formalising Markov categories — specifically for proving symmetry of the Fritz-Klingler conditional-independence predicate. Refs: Fritz 2020 *Adv. Math.* 370; Fritz-Klingler, *JMLR* 24(46) (2023).
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary 0f2d2ac8baImport changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
Summary
Two symmetric-monoidal coherence results in a new file
Mathlib/CategoryTheory/Monoidal/Symmetric/TensorBraidSwap.lean:MonoidalCategory.tensorμ_braid_swap— canonical rearrangementtensorμ A A Y Yintertwines the braiding onA ⊗ Ywith thepair of braidings on
AandY. Sibling ofCategoryTheory.MonObj.mul_braiding(
Mathlib.CategoryTheory.Monoidal.Mon_, line 759).Tensor-product instance for
IsCommComonObj: ifA, Bcarrycommutative comonoid structures in a symmetric monoidal category,
so does
A ⊗ B. Reducescomul_commforΔ[A ⊗ B]viatensorμ_braid_swapto the pointwise hypotheses. Fills a gapin
Mathlib/CategoryTheory/Monoidal/CommComon_.lean, whichcurrently provides only the unit instance
(
instCommComonObjUnit) and the auto-instance for cartesiancategories (
instIsCommComonObjOfCartesian).Placement rationale
Placed in a new
Symmetric/subdirectory rather than appendedto
Braided/Basic.leanbecause the latter's top-levelvariable [BraidedCategory C]creates an instance diamondagainst any locally-added
[SymmetricCategory C]. On v4.30.0-rc2this diamond blocks
rw [SymmetricCategory.symmetry]motiveextraction through
A ◁ _ ▷ Y— the pattern is literally presentin the target, but the two distinct
BraidedCategory Cinstances(outer variable vs
SymmetricCategory.toBraidedCategory) causethe rewrite to fail. A new file with only
[SymmetricCategory C]as its variable avoids this.Downstream consumer
The
IsCommComonObjtensor-product instance is load-bearing forthe external library
markovcat (formalising
Fritz–Klingler Markov categories), specifically for symmetry of
the conditional-independence predicate on compound objects.
Checks
lake build Mathlib.CategoryTheory.Monoidal.Symmetric.TensorBraidSwap— green.lake exe lint-style— clean (exit 0).master; single commit; 72 insertions acrosstwo files (new file + one-line
Mathlib.leanregistration).Opening as draft to let CI run before requesting review.