Polynomial Functors, Lens, and Charts #
This file defines polynomial functors, lenses, and charts. The goal is to provide basic definitions, with their properties and categories defined in later files.
dt: this file is getting long and should maybe be split up more.
The zero polynomial functor, defined as A = PEmpty and B _ = PEmpty, is the identity with
respect to sum (up to equivalence)
Equations
- PFunctor.instZero_toMathlib = { zero := { A := PEmpty.{?u.4 + 1}, B := fun (x : PEmpty.{?u.4 + 1}) => PEmpty.{?u.3 + 1} } }
The unit polynomial functor, defined as A = PUnit and B _ = PEmpty, is the identity with
respect to product (up to equivalence)
Equations
- PFunctor.instOne_toMathlib = { one := { A := PUnit.{?u.4 + 1}, B := fun (x : PUnit.{?u.4 + 1}) => PEmpty.{?u.3 + 1} } }
The variable y polynomial functor. This is the unit for composition.
Equations
- PFunctor.y = { A := PUnit.{?u.4 + 1}, B := fun (x : PUnit.{?u.4 + 1}) => PUnit.{?u.3 + 1} }
Instances For
Equations
The monomial functor, also written P(X) = A X^ B, has A as its head type and the constant
family B_a = B as the child type for each each shape a : A .
Equations
- PFunctor.monomial A B = { A := A, B := fun (x : A) => B }
Instances For
The monomial functor, also written P(X) = A X^ B, has A as its head type and the constant
family B_a = B as the child type for each each shape a : A .
Equations
- PFunctor.«term_X^_» = Lean.ParserDescr.trailingNode `PFunctor.«term_X^_» 80 81 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " X^ ") (Lean.ParserDescr.cat `term 80))
Instances For
The self monomial polynomial functor P(X) = S X^ S
Equations
Instances For
The pure power polynomial functor P(X) = X^ B
Equations
Instances For
A polynomial functor is representable if it is equivalent to X^A for some type A.
Equations
Instances For
Construct a polynomial functor from just a function B, with A derived implicitly.
Equations
- PFunctor.ofFn B = { A := A, B := B }
Instances For
Equations
Equations
Equations
The sum (coproduct) of two polynomial functors P and Q, written as P + Q.
Defined as the sum of the head types and the sum case analysis for the child types.
Note: requires the B universe levels to be the same.
Instances For
Addition of polynomial functors, defined as the sum construction.
Equations
- PFunctor.instHAdd_toMathlib = { hAdd := PFunctor.sum }
Equations
- PFunctor.instAdd_toMathlib = { add := PFunctor.sum }
Alias of PFunctor.sum.
The sum (coproduct) of two polynomial functors P and Q, written as P + Q.
Defined as the sum of the head types and the sum case analysis for the child types.
Note: requires the B universe levels to be the same.
Equations
Instances For
The generalized sum (sigma type) of an indexed family of polynomial functors.
Equations
Instances For
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
Multiplication of polynomial functors, defined as the product construction.
Equations
- PFunctor.instHMul_toMathlib = { hMul := PFunctor.prod }
Equations
- PFunctor.instMul_toMathlib = { mul := PFunctor.prod }
The generalized product (pi type) of an indexed family of polynomial functors.
Equations
Instances For
The tensor (also called parallel or Dirichlet) product of two polynomial functors P and Q.
Defined as the product of the head types and the product of the child types.
Instances For
Infix notation for tensor product P ⊗ Q
Equations
- PFunctor.«term_⊗_» = Lean.ParserDescr.trailingNode `PFunctor.«term_⊗_» 70 70 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊗ ") (Lean.ParserDescr.cat `term 71))
Instances For
The unit for the tensor product Y
Equations
Instances For
Infix notation for PFunctor.comp P Q
Equations
- PFunctor.«term_◃_» = Lean.ParserDescr.trailingNode `PFunctor.«term_◃_» 80 80 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ◃ ") (Lean.ParserDescr.cat `term 81))
Instances For
The unit for composition Y
Equations
Instances For
Repeated composition P ◃ P ◃ ... ◃ P (n times).
Instances For
Equations
Lift a polynomial functor P to a pair of larger universes.
Equations
- P.ulift = { A := ULift.{?u.8, ?u.10} P.A, B := fun (a : ULift.{?u.8, ?u.10} P.A) => ULift.{?u.7, ?u.9} (P.B a.down) }
Instances For
Exponential of polynomial functors P ^ Q
Equations
- P.exp Q = PFunctor.pi fun (a : Q.A) => P.comp (PFunctor.X + PFunctor.C (Q.B a))
Instances For
A polynomial functor is finitely branching if each of its branches is a finite type.
Instances
Equations
- PFunctor.instFintypeUlift = { fintype_B := fun (a : P.ulift.A) => id inferInstance }
Equations
Equations
- PFunctor.instFintypeOfNat = { fintype_B := fun (x : PFunctor.A 0) => Fintype.instPEmpty }
Equations
- PFunctor.instFintypeOfNat_1 = { fintype_B := fun (x : PFunctor.A 1) => Fintype.instPEmpty }
Instances
Equations
- PFunctor.instInhabitedUlift = { inhabited_B := fun (a : P.ulift.A) => id inferInstance }
- decidableEq_A : DecidableEq P.A
- decidableEq_B (a : P.A) : DecidableEq (P.B a)
Instances
Equations
- PFunctor.instDecidableEqUlift = { decidableEq_A := id inferInstance, decidableEq_B := fun (a : P.ulift.A) => id inferInstance }
Equations
- PFunctor.instDecidableEqOfNat = { decidableEq_A := inferInstanceAs (DecidableEq PEmpty.{?u.5 + 1}), decidableEq_B := fun (x : PFunctor.A 0) => inferInstanceAs (DecidableEq PEmpty.{?u.4 + 1}) }
Equations
- PFunctor.instDecidableEqOfNat_1 = { decidableEq_A := inferInstanceAs (DecidableEq PUnit.{?u.5 + 1}), decidableEq_B := fun (x : PFunctor.A 1) => inferInstanceAs (DecidableEq PEmpty.{?u.4 + 1}) }
PFunctor where the output type is constant over an arbitrary input type.
Equations
- PFunctor.ofConst A B = { A := A, B := fun (x : A) => B }
Instances For
Equations
- PFunctor.instFintypeOfConstOfFintype A B = { fintype_B := fun (x : (PFunctor.ofConst A B).A) => inferInstanceAs (Fintype B) }
Equations
- PFunctor.instDecidableEqOfConstOfDecidableEq A B = { decidableEq_A := inferInstanceAs (DecidableEq A), decidableEq_B := fun (x : (PFunctor.ofConst A B).A) => inferInstanceAs (DecidableEq B) }
Equations
- PFunctor.instInhabitedOfConstOfInhabited A B = { inhabited_B := fun (x : (PFunctor.ofConst A B).A) => inferInstanceAs (Inhabited B) }
An equivalence between two polynomial functors P and Q, written P ≃ₚ Q, is given by an
equivalence of the A types and an equivalence between the B types for each a : A.
An equivalence between the
AtypesAn equivalence between the
Btypes for eacha : A
Instances For
An equivalence between two polynomial functors P and Q, written P ≃ₚ Q, is given by an
equivalence of the A types and an equivalence between the B types for each a : A.
Equations
- PFunctor.«term_≃ₚ_» = Lean.ParserDescr.trailingNode `PFunctor.«term_≃ₚ_» 25 25 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≃ₚ ") (Lean.ParserDescr.cat `term 26))
Instances For
The identity equivalence between a polynomial functor P and itself.
Equations
- PFunctor.Equiv.refl P = { equivA := Equiv.refl P.A, equivB := fun (a : P.A) => Equiv.refl (P.B a) }
Instances For
The inverse of an equivalence between polynomial functors.
Equations
Instances For
The composition of two equivalences between polynomial functors.
Equations
Instances For
Equivalence between two polynomial functors P and Q that are equal.
Equations
- PFunctor.Equiv.cast hA hB = { equivA := Equiv.cast hA, equivB := fun (a : P.A) => Equiv.cast ⋯ }
Instances For
Cast-normalization helper for equivB under equal equivA images.
Cast-normalization helper for symm.equivB under equal symm.equivA images.
Specialized cast-normalization for e followed by e.symm.
Specialized cast-normalization for e.symm followed by e.
A lens between two polynomial functors P and Q is a pair of a function:
Instances For
Infix notation for constructing a lens toFunA ⇆ toFunB
Equations
- PFunctor.«term_⇆_» = Lean.ParserDescr.trailingNode `PFunctor.«term_⇆_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇆ ") (Lean.ParserDescr.cat `term 25))
Instances For
A chart between two polynomial functors P and Q is a pair of a function:
Instances For
Infix notation for constructing a chart toFunA ⇉ toFunB
Equations
- PFunctor.«term_⇉_» = Lean.ParserDescr.trailingNode `PFunctor.«term_⇉_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇉ ") (Lean.ParserDescr.cat `term 25))