Shuffle multiplication
Lax825748.Shuffle · concepts/Lax825748/Shuffle.lean · lax-825748
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition and theorem
The coefficient of in the shuffle of and is the sum of over subsets of the positions of . Repeated letters retain their multiplicities. This product is associative and commutative, with unit the series supported at the empty word. No concatenation product on series is used here.
Concept map
Evidence
In the paper
- page 4 of this submission's paper
Lean source view on GitHub
| 1 | import Lax825748.Series |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Shuffle multiplication |
| 6 | type: definition and theorem |
| 7 | --- |
| 8 | The coefficient of in the shuffle of and is the sum of |
| 9 | over subsets of the positions of . Repeated letters retain |
| 10 | their multiplicities. This product is associative and commutative, with unit |
| 11 | the series supported at the empty word. No concatenation product on series |
| 12 | is used here. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | namespace Lax825748.Shuffle |
| 18 | |
| 19 | open Series |
| 20 | |
| 21 | def unshuffles {X : Type} : List X → List (List X × List X) |
| 22 | | [] => [([], [])] |
| 23 | | x :: w => (unshuffles w).flatMap fun p => |
| 24 | [(x :: p.1, p.2), (p.1, x :: p.2)] |
| 25 | |
| 26 | noncomputable def shuffle {X : Type} (S T : NCSeries X) : NCSeries X := |
| 27 | fun w => ((unshuffles w.toList).map fun p => |
| 28 | S (FreeMonoid.ofList p.1) * T (FreeMonoid.ofList p.2)).sum |
| 29 | |
| 30 | noncomputable def shuffleList {X : Type} : List (NCSeries X) → NCSeries X |
| 31 | | [] => constantSeries 1 |
| 32 | | S :: l => shuffle S (shuffleList l) |
| 33 | |
| 34 | noncomputable def shufflePow {X : Type} (S : NCSeries X) (n : ℕ) : NCSeries X := |
| 35 | shuffleList (List.replicate n S) |
| 36 | |
| 37 | axiom commutative {X : Type} (S T : NCSeries X) : shuffle S T = shuffle T S |
| 38 | |
| 39 | axiom associative {X : Type} (R S T : NCSeries X) : |
| 40 | shuffle (shuffle R S) T = shuffle R (shuffle S T) |
| 41 | |
| 42 | axiom unit {X : Type} (S : NCSeries X) : shuffle (constantSeries 1) S = S |
| 43 | |
| 44 | end Lax825748.Shuffle |
| 45 |
Builds on
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments