The commutativity problem
Lax619925.Commutativity · concepts/Lax619925/Commutativity.lean · lax-619925
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
The commutativity problem asks whether a series is commutative, i.e. constant on words with the same Parikh image. The key observation (paper §3) is that commutativity is characterised by two finite families of equations, swap and rotate, which makes it decidable for effective prevarieties (the meta-theorem). Conversely, the zeroness problem reduces to commutativity: given , one builds a series over a two-letter-enlarged alphabet, supported on words beginning with the two fresh letters, such that is commutative exactly when .
Concept map
Evidence
This concept declares 3 statements. Each proof establishes one of them relative to its assumptions.
1 AntiDerivativeCommutativeIffZero proven
2 EffectivePrevarietyCommutativityDecidable proven
3 FiniteAxiomatisation proven
In the paper
- page 9 of this submission's paper
Lean source view on GitHub
| 1 | import Lax619925.Series |
| 2 | import Lax619925.Prevariety |
| 3 | import Mathlib.Data.Real.Basic |
| 4 | import Mathlib.Data.Fintype.Basic |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: The commutativity problem |
| 9 | type: theorem |
| 10 | --- |
| 11 | The commutativity problem asks whether a series is commutative, i.e. constant on |
| 12 | words with the same Parikh image. The key observation (paper §3) is that |
| 13 | commutativity is characterised by two finite families of equations, *swap* and |
| 14 | *rotate*, which makes it decidable for effective prevarieties (the meta-theorem). |
| 15 | Conversely, the zeroness problem reduces to commutativity: given `f`, one builds |
| 16 | a series `g` over a two-letter-enlarged alphabet, supported on words beginning |
| 17 | with the two fresh letters, such that `g` is commutative exactly when `f = 0`. |
| 18 | -/ |
| 19 | |
| 20 | namespace Lax619925.Commutativity |
| 21 | |
| 22 | open Lax619925.Series Lax619925.Prevariety |
| 23 | |
| 24 | /-- The *swap* equation: for all letters `a, b`, |
| 25 | `leftDeriv a (leftDeriv b f) = leftDeriv b (leftDeriv a f)`. |
| 26 | It expresses that exchanging the first two letters of a word does not change |
| 27 | the coefficient. -/ |
| 28 | def SatisfiesSwap (α : Type*) (f : Series α) : Prop := |
| 29 | ∀ a b, leftDeriv α a (leftDeriv α b f) = leftDeriv α b (leftDeriv α a f) |
| 30 | |
| 31 | /-- The *rotate* equation: for all letters `a`, |
| 32 | `leftDeriv a f = rightDeriv a f`. |
| 33 | It expresses that moving the first letter to the end does not change the |
| 34 | coefficient. -/ |
| 35 | def SatisfiesRotate (α : Type*) (f : Series α) : Prop := |
| 36 | ∀ a, leftDeriv α a f = rightDeriv α a f |
| 37 | |
| 38 | /-- A series `g` is a *left anti-derivative* of the tuple of series `f` if |
| 39 | `leftDeriv a g = f a` for every letter `a`. Once the value `g ε` is fixed, |
| 40 | left anti-derivatives are unique. -/ |
| 41 | def IsLeftAntiDerivative (α : Type*) (g : Series α) (f : α → Series α) : Prop := |
| 42 | ∀ a, leftDeriv α a g = f a |
| 43 | |
| 44 | /-- The alphabet `α` extended by two fresh letters `fresh0` and `fresh1`, modelling |
| 45 | the paper's enlarged alphabet `Γ = Σ ∪ {a, b}`. -/ |
| 46 | inductive Fresh2 (α : Type*) where |
| 47 | | letter : α → Fresh2 α |
| 48 | | fresh0 : Fresh2 α |
| 49 | | fresh1 : Fresh2 α |
| 50 | |
| 51 | /-- Lift a word over the extended alphabet back to a word over `α`, returning |
| 52 | `some` of the original word when no fresh letter occurs and `none` otherwise. -/ |
| 53 | def liftWordOpt (α : Type*) (w : List (Fresh2 α)) : Option (List α) := |
| 54 | match w with |
| 55 | | [] => some [] |
| 56 | | s :: w' => |
| 57 | match s with |
| 58 | | .letter a => (liftWordOpt α w').map (fun rest => a :: rest) |
| 59 | | .fresh0 | .fresh1 => none |
| 60 | |
| 61 | /-- The extension of a series over `α` to the extended alphabet `Fresh2 α`, by zero |
| 62 | on words containing one of the two fresh letters. -/ |
| 63 | def extendSeries (α : Type*) (f : Series α) : Series (Fresh2 α) := fun w => |
| 64 | match liftWordOpt α w with |
| 65 | | some rest => f rest |
| 66 | | none => 0 |
| 67 | |
| 68 | /-- The series `g` over the extended alphabet associated to `f` in the paper's |
| 69 | equality-reduces-to-commutativity construction: `g` is zero except on words |
| 70 | beginning with the two fresh letters, where `g (fresh0 :: fresh1 :: rest) = f (rest)` |
| 71 | (with `f` extended by zero). Hence `leftDeriv b (leftDeriv a g) = extendSeries f` |
| 72 | for `a = fresh0`, `b = fresh1`, while every other second left derivative vanishes; |
| 73 | in particular `g ε = g x = 0` for every letter `x`. -/ |
| 74 | def antiDerivativeSeries (α : Type*) (f : Series α) : Series (Fresh2 α) := fun w => |
| 75 | match w with |
| 76 | | .fresh0 :: .fresh1 :: rest => extendSeries α f rest |
| 77 | | _ => 0 |
| 78 | |
| 79 | /-- A series is commutative if and only if it satisfies the swap and rotate equations |
| 80 | for all letters (paper §3, lemma `commutativity`). Swaps and rotations generate |
| 81 | all commutatively equivalent words, so the two finite families of equations |
| 82 | characterise commutativity. -/ |
| 83 | axiom FiniteAxiomatisation (α : Type*) (f : Series α) : |
| 84 | IsCommutative α f ↔ SatisfiesSwap α f ∧ SatisfiesRotate α f |
| 85 | |
| 86 | /-- The commutativity problem is decidable for effective prevarieties of series |
| 87 | (paper §3, theorem `commutativity for effective prevarieties`): over a finite |
| 88 | alphabet, there is a procedure that, given a presentation `r`, decides whether |
| 89 | `sem r` is commutative — it returns `true` exactly when `sem r` is commutative. |
| 90 | By the finite axiomatisation this reduces to finitely many equality tests on |
| 91 | presentations, decided by the prevariety's `decEq`. -/ |
| 92 | axiom EffectivePrevarietyCommutativityDecidable (α : Type*) [Fintype α] |
| 93 | (P : EffectivePrevariety α) : |
| 94 | ∃ d : P.Rep → Bool, ∀ r, d r = true ↔ IsCommutative α (P.sem r) |
| 95 | |
| 96 | /-- The series `antiDerivativeSeries f` is commutative if and only if `f = 0` |
| 97 | (paper §3, lemma `equality reduces to commutativity`). If `f ≠ 0` with |
| 98 | `f (w) ≠ 0` for some word `w`, then `g (fresh0 · fresh1 · w) = f (w) ≠ 0` while |
| 99 | `g (fresh1 · fresh0 · w) = 0`, and the two words are commutatively equivalent, |
| 100 | so `g` is not commutative; conversely `f = 0` forces `g = 0`. -/ |
| 101 | axiom AntiDerivativeCommutativeIffZero (α : Type*) (f : Series α) : |
| 102 | IsCommutative (Fresh2 α) (antiDerivativeSeries α f) ↔ f = 0 |
| 103 | |
| 104 | end Lax619925.Commutativity |
| 105 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments