Symmetric algebraic branching programs
Lax461425.SymmetricABPs · concepts/Lax461425/SymmetricABPs.lean · lax-461425
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
An algebraic branching program (ABP) is a finite simple directed acyclic graph with affine edge labels, a unique source and a unique sink; it computes the sum over all source-to-sink paths of the product of the edge labels. An ABP in matrix variables is matrix-symmetric if every row and column permutation extends to an ABP automorphism, and its vertex orbits range over all such extending automorphisms. is the class of families computed by matrix-symmetric ABPs with polynomial vertex orbits.
Concept map
Lean source view on GitHub
| 1 | import Lax461425.MatrixSymmetry |
| 2 | import Lax461425.SymmetricFamilies |
| 3 | import Lax461425.SymmetricClasses |
| 4 | import Lax461425.SymmetricVNP |
| 5 | import Lax461425.HomomorphismPolynomials |
| 6 | import Mathlib.LinearAlgebra.Span.Defs |
| 7 | import Mathlib.Data.Fintype.Pi |
| 8 | import Mathlib.Algebra.MvPolynomial.Rename |
| 9 | |
| 10 | /-! |
| 11 | --- |
| 12 | title: Symmetric algebraic branching programs |
| 13 | type: definition |
| 14 | --- |
| 15 | An algebraic branching program (ABP) is a finite simple directed acyclic graph with |
| 16 | affine edge labels, a unique source and a unique sink; it computes the sum over all |
| 17 | source-to-sink paths of the product of the edge labels. An ABP in matrix variables is |
| 18 | matrix-symmetric if every row and column permutation extends to an ABP automorphism, and |
| 19 | its vertex orbits range over all such extending automorphisms. `symVBP` is the class of |
| 20 | families computed by matrix-symmetric ABPs with polynomial vertex orbits. |
| 21 | -/ |
| 22 | |
| 23 | namespace Lax461425.SymmetricABPs |
| 24 | |
| 25 | open Circuits MatrixSymmetry HomomorphismPolynomials |
| 26 | |
| 27 | /-- An affine linear form, with an explicit coefficient for every variable. -/ |
| 28 | structure AffineForm (V K : Type*) where |
| 29 | constant : K |
| 30 | coeff : V → K |
| 31 | |
| 32 | /-- The polynomial represented by an affine form. -/ |
| 33 | noncomputable def AffineForm.polynomial {V K : Type*} [Fintype V] [CommSemiring K] |
| 34 | (a : AffineForm V K) : MvPolynomial V K := |
| 35 | MvPolynomial.C a.constant + ∑ x, MvPolynomial.C (a.coeff x) * MvPolynomial.X x |
| 36 | |
| 37 | /-- A finite directed acyclic ABP. Every vertex occurs on a source-to-sink path. -/ |
| 38 | structure ABP (V K : Type*) where |
| 39 | Vertex : Type |
| 40 | [fintypeVertex : Fintype Vertex] |
| 41 | [decEqVertex : DecidableEq Vertex] |
| 42 | edge : Vertex → Vertex → Prop |
| 43 | [decEdge : DecidableRel edge] |
| 44 | label : Vertex → Vertex → AffineForm V K |
| 45 | source : Vertex |
| 46 | sink : Vertex |
| 47 | source_no_incoming : ∀ v, ¬ edge v source |
| 48 | sink_no_outgoing : ∀ v, ¬ edge sink v |
| 49 | acyclic : ∀ v, ¬ Relation.TransGen edge v v |
| 50 | source_reaches : ∀ v, Relation.ReflTransGen edge source v |
| 51 | reaches_sink : ∀ v, Relation.ReflTransGen edge v sink |
| 52 | |
| 53 | attribute [instance] ABP.fintypeVertex ABP.decEqVertex ABP.decEdge |
| 54 | |
| 55 | namespace ABP |
| 56 | |
| 57 | variable {V K : Type*} (G : ABP V K) |
| 58 | |
| 59 | /-- A bounded vertex sequence. Acyclic paths have fewer edges than there are vertices. -/ |
| 60 | abbrev PathData := (l : Fin (Fintype.card G.Vertex)) × (Fin (l.val + 1) → G.Vertex) |
| 61 | |
| 62 | /-- A vertex sequence traverses directed edges from the source to `v`. -/ |
| 63 | def IsPathTo (v : G.Vertex) (p : G.PathData) : Prop := |
| 64 | p.2 0 = G.source ∧ p.2 (Fin.last p.1.val) = v ∧ |
| 65 | ∀ i : Fin p.1.val, G.edge (p.2 i.castSucc) (p.2 i.succ) |
| 66 | |
| 67 | /-- All directed paths from the source to a specified vertex. -/ |
| 68 | abbrev PathTo (v : G.Vertex) := {p : G.PathData // G.IsPathTo v p} |
| 69 | |
| 70 | /-- A vertex sequence traverses directed edges from the source to the sink. -/ |
| 71 | abbrev IsPath := G.IsPathTo G.sink |
| 72 | |
| 73 | /-- All source-to-sink paths, including the empty path when source and sink coincide. -/ |
| 74 | abbrev Path := G.PathTo G.sink |
| 75 | |
| 76 | noncomputable instance (v : G.Vertex) : Fintype (G.PathTo v) := Fintype.ofFinite _ |
| 77 | |
| 78 | /-- The product of the labels along a path with any endpoint. -/ |
| 79 | noncomputable def pathWeightTo [Fintype V] [CommSemiring K] {v : G.Vertex} |
| 80 | (p : G.PathTo v) : MvPolynomial V K := |
| 81 | ∏ i : Fin p.1.1.val, |
| 82 | (G.label (p.1.2 i.castSucc) (p.1.2 i.succ)).polynomial |
| 83 | |
| 84 | /-- The product of the labels along a source-to-sink path. -/ |
| 85 | noncomputable def pathWeight [Fintype V] [CommSemiring K] (p : G.Path) : MvPolynomial V K := |
| 86 | G.pathWeightTo p |
| 87 | |
| 88 | /-- The sum of all source-to-`v` path weights. -/ |
| 89 | noncomputable def polynomialAt [Fintype V] [CommSemiring K] (v : G.Vertex) : |
| 90 | MvPolynomial V K := ∑ p : G.PathTo v, G.pathWeightTo p |
| 91 | |
| 92 | /-- The sum of the weights of all source-to-sink paths. -/ |
| 93 | noncomputable def polynomial [Fintype V] [CommSemiring K] : MvPolynomial V K := |
| 94 | G.polynomialAt G.sink |
| 95 | |
| 96 | /-- The ABP computes the given polynomial. -/ |
| 97 | def Computes [Fintype V] [CommSemiring K] (p : MvPolynomial V K) : Prop := |
| 98 | G.polynomial = p |
| 99 | |
| 100 | /-- An ABP automorphism extending a renaming of the variables. Values of labels on |
| 101 | nonedges are immaterial. -/ |
| 102 | def Extends [Fintype V] [CommSemiring K] (σ : G.Vertex ≃ G.Vertex) (π : V → V) : Prop := |
| 103 | σ G.source = G.source ∧ σ G.sink = G.sink ∧ |
| 104 | (∀ u v, G.edge (σ u) (σ v) ↔ G.edge u v) ∧ |
| 105 | ∀ u v, G.edge u v → |
| 106 | (G.label (σ u) (σ v)).polynomial = MvPolynomial.rename π (G.label u v).polynomial |
| 107 | |
| 108 | variable {n : ℕ} (G : ABP (Fin n × Fin n) K) |
| 109 | |
| 110 | /-- Every matrix-variable permutation extends to an ABP automorphism. -/ |
| 111 | def IsMatrixSymmetric [CommSemiring K] : Prop := |
| 112 | ∀ γ : Γ n, ∃ σ : G.Vertex ≃ G.Vertex, G.Extends σ (actVar γ) |
| 113 | |
| 114 | /-- The vertex orbit under all extending ABP automorphisms. -/ |
| 115 | def orbit [CommSemiring K] (v : G.Vertex) : Set G.Vertex := |
| 116 | {w | ∃ (γ : Γ n) (σ : G.Vertex ≃ G.Vertex), G.Extends σ (actVar γ) ∧ σ v = w} |
| 117 | |
| 118 | /-- The largest vertex orbit under all extending ABP automorphisms. -/ |
| 119 | noncomputable def orbitSize [CommSemiring K] : ℕ := |
| 120 | Finset.univ.sup fun v => (G.orbit v).ncard |
| 121 | |
| 122 | end ABP |
| 123 | |
| 124 | open SymmetricFamilies SymmetricClasses SymmetricVNP |
| 125 | |
| 126 | /-- Families computed by matrix-symmetric ABPs of polynomial vertex-orbit size. No bound on |
| 127 | the total size or the degree is imposed. -/ |
| 128 | def InSymVBP {K : Type*} [CommSemiring K] (f : MatrixFamily K) : Prop := |
| 129 | ∃ b : ℕ → ℕ, PolynomiallyBounded b ∧ ∀ n, ∃ G : ABP (Fin n × Fin n) K, |
| 130 | G.Computes (f n) ∧ G.IsMatrixSymmetric ∧ G.orbitSize ≤ b n |
| 131 | |
| 132 | end Lax461425.SymmetricABPs |
| 133 |
Builds on
Used by
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments