Rational hitting lists: affine #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/RationalHitting/Affine.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical arguments are retained.
A constant coefficient and one rational coefficient per variable.
Instances For
The affine form with the given constant and zero variable coefficients.
Equations
Instances For
Evaluate an affine form in a rational algebra, with coefficients on the left.
Equations
- Complexity.RationalHitting.Affine.eval c X = { toFun := fun (a : Complexity.RationalHitting.Affine.Form n) => c a.1 + ∑ i : Fin n, c (a.2 i) * X i, map_zero' := ⋯, map_add' := ⋯ }
Instances For
The finite row and column index type of the formula's linear realization.
Equations
Instances For
Equations
- (Complexity.RationalHitting.Formula.var a).indexFintype = { elems := Finset.univ.disjSum Finset.univ, complete := ⋯ }
- (Complexity.RationalHitting.Formula.const a).indexFintype = { elems := Finset.univ.disjSum Finset.univ, complete := ⋯ }
- (f.add g).indexFintype = { elems := Finset.univ.disjSum Finset.univ, complete := ⋯ }
- (f.mul g).indexFintype = { elems := Finset.univ.disjSum Finset.univ, complete := ⋯ }
- f.inv.indexFintype = { elems := Finset.univ.disjSum Finset.univ, complete := ⋯ }
Equations
- (Complexity.RationalHitting.Formula.var a).indexDecidableEq = fun (a b : Unit ⊕ Unit) => instDecidableEqSum a b
- (Complexity.RationalHitting.Formula.const a).indexDecidableEq = fun (a b : Unit ⊕ Unit) => instDecidableEqSum a b
- (f.add g).indexDecidableEq = fun (a b : f.Index ⊕ g.Index) => instDecidableEqSum a b
- (f.mul g).indexDecidableEq = fun (a b : f.Index ⊕ g.Index) => instDecidableEqSum a b
- f.inv.indexDecidableEq = fun (a b : f.Index ⊕ Unit) => instDecidableEqSum a b
The left row of the formula's linear realization.
Equations
- (Complexity.RationalHitting.Formula.var a).row = Matrix.fromCols 1 0
- (Complexity.RationalHitting.Formula.const a).row = Matrix.fromCols 1 0
- (f.add g).row = f.row.fromCols g.row
- (f.mul g).row = f.row.fromCols 0
- f.inv.row = Matrix.fromCols 0 (-1)
Instances For
The right column of the formula's linear realization.
Equations
- (Complexity.RationalHitting.Formula.var a).col = Matrix.fromRows 0 1
- (Complexity.RationalHitting.Formula.const a).col = Matrix.fromRows 0 1
- (f.add g).col = f.col.fromRows g.col
- (f.mul g).col = Matrix.fromRows 0 g.col
- f.inv.col = Matrix.fromRows 0 1
Instances For
The affine matrix pencil built recursively from a rational formula.
Equations
- One or more equations did not get rendered due to their size.
- (f.add g).pencil = Matrix.fromBlocks f.pencil 0 0 g.pencil
- (f.mul g).pencil = Matrix.fromBlocks f.pencil (-Complexity.RationalHitting.Affine.constMatrix (f.col * g.row)) 0 g.pencil
- f.inv.pencil = Matrix.fromBlocks f.pencil (Complexity.RationalHitting.Affine.constMatrix f.col) (Complexity.RationalHitting.Affine.constMatrix f.row) 0
Instances For
Represent a scalar as a one-by-one matrix.
Instances For
The list retains occurrences, not just distinct subexpressions.
Equations
Instances For
.inv f here denotes the root augmentation pencil, not a new counted gate.
Equations
- f.certificates = f.inverseNodes ++ [f.inv]
Instances For
The homogeneous coefficient, with index zero reserved for the constant term.
Equations
- Complexity.RationalHitting.Affine.coeff a i = Fin.cases a.1 a.2 i
Instances For
Evaluate the homogeneous form on an extra constant coordinate.
Equations
- Complexity.RationalHitting.Affine.homogeneous c Z a = ∑ i : Fin (n + 1), c (Complexity.RationalHitting.Affine.coeff a i) * Z i
Instances For
Reindexing a pencil's coefficients does not alter its matrix evaluation.
Homogeneous affine coefficients give exactly the ordinary Kronecker pencil.