Documentation

CslibFrontier.Computability.Automata.Weighted.Rep

Linear representations of series on words #

A series is a function List Ω → F. A linear representation of dimension n gives the value of the series at a word as (row vector) · (product of matrices, one for each letter) · (column vector). Sums, products, and stars (over non-empty factors) of represented series are represented, and dimensions add up.

From VP ≠ VNP over every field [Ant26], module Nc.Tape.Rep.

Main definitions #

Main results #

@[reducible, inline]
abbrev Cslib.Automata.Weighted.Series (F : Type u_3) (Ω : Type u_4) :
Type (max u_3 u_4)

A formal power series on words over alphabet Ω with coefficients in F.

def Cslib.Automata.Weighted.Series.mul {F : Type u_1} [CommRing F] {Ω : Type u_2} (f g : Series F Ω) :
Series F Ω

The Cauchy product of two series on words.

def Cslib.Automata.Weighted.Series.one {F : Type u_1} [CommRing F] {Ω : Type u_2} :
Series F Ω

The unit series: 1 at the empty word and 0 elsewhere.

@[irreducible]
def Cslib.Automata.Weighted.Series.kstar {F : Type u_1} [CommRing F] {Ω : Type u_2} (f : Series F Ω) :
Series F Ω

The star over non-empty factors: the sum over all cuts of a word into non-empty factors.

theorem Cslib.Automata.Weighted.Series.kstar_nil {F : Type u_1} [CommRing F] {Ω : Type u_2} (f : Series F Ω) :
f.kstar [] = 1
theorem Cslib.Automata.Weighted.Series.kstar_cons {F : Type u_1} [CommRing F] {Ω : Type u_2} (f : Series F Ω) (a : Ω) (o : List Ω) :
f.kstar (a :: o) = ∑ k ∈ Finset.range (o.length + 1), f (a :: List.take k o) * f.kstar (List.drop k o)
structure Cslib.Automata.Weighted.Rep (F : Type u_3) (Ω : Type u_4) (Q : Type u_5) :
Type (max (max u_3 u_4) u_5)

A linear representation (weighted finite automaton) with state space Q.

  • lam : Q → F

    initial weights

  • mu : Ω → Matrix Q Q F

    transition weights

  • gam : Q → F

    final weights

def Cslib.Automata.Weighted.Rep.tail {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q : Type u_3} [Fintype Q] (r : Rep F Ω Q) :
List Ω → Q → F

The weights from each state to acceptance along a word.

def Cslib.Automata.Weighted.Rep.series {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q : Type u_3} [Fintype Q] (r : Rep F Ω Q) :
Series F Ω

The series realized by a linear representation.

def Cslib.Automata.Weighted.Rep.add {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q₁ : Type u_4} {Q₂ : Type u_5} (r₁ : Rep F Ω Q₁) (r₂ : Rep F Ω Q₂) :
Rep F Ω (Q₁ ⊕ Q₂)

Sum of two linear representations.

theorem Cslib.Automata.Weighted.Rep.add_tail {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q₁ : Type u_4} {Q₂ : Type u_5} [Fintype Q₁] [Fintype Q₂] (r₁ : Rep F Ω Q₁) (r₂ : Rep F Ω Q₂) (o : List Ω) :
(r₁.add r₂).tail o = Sum.elim (r₁.tail o) (r₂.tail o)
theorem Cslib.Automata.Weighted.Rep.add_series {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q₁ : Type u_4} {Q₂ : Type u_5} [Fintype Q₁] [Fintype Q₂] (r₁ : Rep F Ω Q₁) (r₂ : Rep F Ω Q₂) (o : List Ω) :
(r₁.add r₂).series o = r₁.series o + r₂.series o
def Cslib.Automata.Weighted.Rep.mul {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q₁ : Type u_4} {Q₂ : Type u_5} [Fintype Q₁] (r₁ : Rep F Ω Q₁) (r₂ : Rep F Ω Q₂) :
Rep F Ω (Q₁ ⊕ Q₂)

Cauchy product of two linear representations.

theorem Cslib.Automata.Weighted.Rep.mul_tail {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q₁ : Type u_4} {Q₂ : Type u_5} [Fintype Q₁] [Fintype Q₂] (r₁ : Rep F Ω Q₁) (r₂ : Rep F Ω Q₂) (o : List Ω) :
(r₁.mul r₂).tail o = Sum.elim (∑ k ∈ Finset.range o.length, r₂.series (List.drop (k + 1) o) • r₁.tail (List.take (k + 1) o)) (r₂.tail o)
theorem Cslib.Automata.Weighted.Rep.mul_series {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q₁ : Type u_4} {Q₂ : Type u_5} [Fintype Q₁] [Fintype Q₂] (r₁ : Rep F Ω Q₁) (r₂ : Rep F Ω Q₂) (o : List Ω) :
(r₁.mul r₂).series o = r₁.series.mul r₂.series o
def Cslib.Automata.Weighted.Rep.star {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q : Type u_3} [Fintype Q] (r : Rep F Ω Q) :
Rep F Ω (Unit ⊕ Q)

Star of a linear representation (over non-empty factors).

theorem Cslib.Automata.Weighted.Rep.star_tail {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q : Type u_3} [Fintype Q] (r : Rep F Ω Q) (o : List Ω) :
r.star.tail o = Sum.elim (fun (x : Unit) => r.series.kstar o) (∑ k ∈ Finset.range o.length, r.series.kstar (List.drop (k + 1) o) • r.tail (List.take (k + 1) o))
theorem Cslib.Automata.Weighted.Rep.star_series {F : Type u_1} [CommRing F] {Ω : Type u_2} {Q : Type u_3} [Fintype Q] (r : Rep F Ω Q) (o : List Ω) :