Polynomial Functors #
Definitions of common PFunctor constructions:
monomial A B: constant directionBfor any shapea : AP + Q: shapes are a disjoint sum, directions are defined by sum elimination ona : P.A ⊕ Q.AP * Q: shapes are pairs of underlying shapes, directions are a disjoint sum over both shapes.
Special cases C, linear, selfMonomial, purePower, the indeterminate y,
and canonical choices of 0 and 1 are defined as abbreviations or instances over monomial.
The scoped notations A y^ B and y^ B denote monomial A B and purePower B, respectively.
The child-map API includes const, Unary, and DecidableEqChildren.
The monomial PFunctor with head type A and constant B for any a : A.
Equations
- PFunctor.monomial A B = { A := A, B := fun (x : A) => B }
Instances For
The monomial PFunctor with head type A and constant B for any a : A.
Equations
- PFunctor.«term_Y^_» = Lean.ParserDescr.trailingNode `PFunctor.«term_Y^_» 82 83 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " y^ ") (Lean.ParserDescr.cat `term 82))
Instances For
Equations
- PFunctor.instUniqueOneA = { default := PUnit.unit, uniq := ⋯ }
The self-monomial polynomial functor P(y) = S y^ S.
Equations
Instances For
The pure-power polynomial functor y^ B, representable on B.
Equations
Instances For
The pure-power polynomial functor y^ B, representable on B.
Equations
- PFunctor.«termY^_» = Lean.ParserDescr.node `PFunctor.«termY^_» 100 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "y^") (Lean.ParserDescr.cat `term 100))
Instances For
The indeterminate polynomial functor P(y) = y, the identity with respect to
composition and tensor product (up to equivalence).
Instances For
The sum of two polynomial functors P and Q, written as P + Q,
defined as the sum of the head types and the dependent sum recursor for the child types.
The child universes must agree. The named spelling P.add Q can elaborate in contexts where
P + Q fails to infer universes, such as under PFunctor.W; see CslibTests.PFunctor.
Instances For
Equations
- PFunctor.instHAddPFunctor = { hAdd := PFunctor.add }
The product of two polynomial functors P and Q, written as P * Q,
defined as the product of the head types and the sum of the child types.
Instances For
Equations
- PFunctor.instHMulPFunctor = { hMul := PFunctor.prod }
A polynomial functor is unary if all child types have exactly one element.
Instances
A polynomial functor has children with decidable equality.
- decidableEq (a : P.A) : DecidableEq (P.B a)
Instances
A unary polynomial functor has decidable child equality.
Constructs a unary polynomial functor.
Equations
- PFunctor.mkUnary A = { A := A, B := fun (x : A) => Unit }
Instances For
Equations
- PFunctor.instUnaryLinear A = { unary := fun (x : (PFunctor.linear A).A) => { toInhabited := instInhabitedPUnit, uniq := ⋯ } }