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.
Lift a polynomial functor to a larger universe.
Equations
- P.ulift = { A := ULift.{?u.7, ?u.8} P.A, B := fun (a : ULift.{?u.7, ?u.8} P.A) => ULift.{?u.7, ?u.8} (P.B a.down) }
Instances For
The zero polynomial functor
Equations
- PFunctor.zero = { A := PEmpty.{?u.3 + 1}, B := fun (x : PEmpty.{?u.3 + 1}) => PEmpty.{?u.3 + 1} }
Instances For
The unit polynomial functor
Equations
- PFunctor.one = { A := PUnit.{?u.3 + 1}, B := fun (x : PUnit.{?u.3 + 1}) => PEmpty.{?u.3 + 1} }
Instances For
Equations
- PFunctor.instZero_toMathlib = { zero := PFunctor.zero }
Equations
- PFunctor.instOne_toMathlib = { one := PFunctor.one }
The variable y
polynomial functor. This is the unit for composition.
Equations
- PFunctor.y = { A := PUnit.{?u.3 + 1}, B := fun (x : PUnit.{?u.3 + 1}) => PUnit.{?u.3 + 1} }
Instances For
Equations
The monomial functor P(y) = A y^B
Instances For
The monomial functor P(y) = A y^B
Equations
- PFunctor.«term_Y^_» = Lean.ParserDescr.trailingNode `PFunctor.«term_Y^_» 80 81 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " y^") (Lean.ParserDescr.cat `term 80))
Instances For
The constant functor P(y) = A
Equations
Instances For
The pure power functor P(y) = y^B
Equations
Instances For
A polynomial functor is representable if it is equivalent to y^A
for some type A
.
Equations
Instances For
Coprod (sum) of polynomial functors P + Q
Instances For
Equations
- PFunctor.instAdd_toMathlib = { add := PFunctor.coprod }
Generalized coproduct (sigma type) of an indexed family of polynomial functors
Equations
- PFunctor.sigma F = { A := (i : I) × (F i).A, B := fun (x : (i : I) × (F i).A) => match x with | ⟨i, a⟩ => ULift.{?u.4, ?u.5} ((F i).B a) }
Instances For
Equations
- PFunctor.instMul_toMathlib = { mul := PFunctor.prod }
Generalized product (pi type) of an indexed family of polynomial functors
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
Exponential of polynomial functors P ^ Q
Equations
- P.exp Q = PFunctor.pi fun (a : Q.A) => P ◂ (PFunctor.y + PFunctor.C (Q.B a))
Instances For
Equations
- PFunctor.instPow_toMathlib = { pow := PFunctor.exp }
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
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
Infix notation for constructing a lens mapPos ⇆ mapDir
Equations
- PFunctor.«term_⇆_» = Lean.ParserDescr.trailingNode `PFunctor.«term_⇆_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇆ ") (Lean.ParserDescr.cat `term 25))
Instances For
The identity lens
Instances For
Composition of lenses
Equations
- PFunctor.Lens.«term_∘ₗ_» = Lean.ParserDescr.trailingNode `PFunctor.Lens.«term_∘ₗ_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ∘ₗ ") (Lean.ParserDescr.cat `term 76))
Instances For
An equivalence between two polynomial functors P
and Q
, using lenses.
This corresponds to an isomorphism in the category PFunctor
with Lens
morphisms.
Equations
- PFunctor.Lens.«term_≃ₗ_» = Lean.ParserDescr.trailingNode `PFunctor.Lens.«term_≃ₗ_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≃ₗ ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- PFunctor.Lens.Equiv.refl P = { toLens := PFunctor.Lens.id P, invLens := PFunctor.Lens.id P, left_inv := ⋯, right_inv := ⋯ }
Instances For
The (unique) initial lens from the zero functor to any functor P
.
Equations
- PFunctor.Lens.initial = (PEmpty.elim ⇆ fun (a : PFunctor.A 0) => PEmpty.elim a)
Instances For
The (unique) terminal lens from any functor P
to the unit functor 1
.
Equations
- PFunctor.Lens.terminal = ((fun (x : P.A) => PUnit.unit) ⇆ fun (x : P.A) => PEmpty.elim)
Instances For
Alias of PFunctor.Lens.initial
.
The (unique) initial lens from the zero functor to any functor P
.
Equations
Instances For
Alias of PFunctor.Lens.terminal
.
The (unique) terminal lens from any functor P
to the unit functor 1
.
Equations
Instances For
Left injection lens inl : P → P + Q
Instances For
Right injection lens inr : Q → P + Q
Instances For
Copairing of lenses [l₁, l₂]ₗ : P + Q → R
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parallel application of lenses for coproduct l₁ ⊎ l₂ : P + Q → R + W
Equations
- One or more equations did not get rendered due to their size.
Instances For
Projection lens fst : P * Q → P
Instances For
Projection lens snd : P * Q → Q
Instances For
Parallel application of lenses for product l₁ ×ₗ l₂ : P * Q → R * W
Equations
Instances For
Apply lenses to both sides of a composition: l₁ ◂ₗ l₂ : (P ◂ Q ⇆ R ◂ W)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply lenses to both sides of a tensor / parallel product: l₁ ⊗ₗ l₂ : (P ⊗ₚ Q ⇆ R ⊗ₚ W)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lens from P ◂ y
to P
Equations
- PFunctor.Lens.invTildeR = ((fun (a : (P ◂ PFunctor.y).A) => a.fst) ⇆ fun (x : (P ◂ PFunctor.y).A) (b : P.B ((fun (a : (P ◂ PFunctor.y).A) => a.fst) x)) => ⟨b, PUnit.unit⟩)
Instances For
Lens from y ◂ P
to P
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply lenses to both sides of a composition: l₁ ◂ₗ l₂ : (P ◂ Q ⇆ R ◂ W)
Equations
- PFunctor.Lens.«term_◂ₗ_» = Lean.ParserDescr.trailingNode `PFunctor.Lens.«term_◂ₗ_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ◂ₗ ") (Lean.ParserDescr.cat `term 76))
Instances For
Parallel application of lenses for product l₁ ×ₗ l₂ : P * Q → R * W
Equations
- PFunctor.Lens.«term_×ₗ_» = Lean.ParserDescr.trailingNode `PFunctor.Lens.«term_×ₗ_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ×ₗ ") (Lean.ParserDescr.cat `term 76))
Instances For
Parallel application of lenses for coproduct l₁ ⊎ l₂ : P + Q → R + W
Equations
- PFunctor.Lens.«term_⊎ₗ_» = Lean.ParserDescr.trailingNode `PFunctor.Lens.«term_⊎ₗ_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊎ₗ ") (Lean.ParserDescr.cat `term 76))
Instances For
Apply lenses to both sides of a tensor / parallel product: l₁ ⊗ₗ l₂ : (P ⊗ₚ Q ⇆ R ⊗ₚ W)
Equations
- PFunctor.Lens.«term_⊗ₗ_» = Lean.ParserDescr.trailingNode `PFunctor.Lens.«term_⊗ₗ_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊗ₗ ") (Lean.ParserDescr.cat `term 76))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Helper lens for speedup
Equations
- One or more equations did not get rendered due to their size.
Instances For
The speedup
lens operation: Lens (S y^S) P → Lens (S y^S) (P ◂ P)
Equations
- l.speedup = l ◂ₗ l ∘ₗ PFunctor.Lens.fixState
Instances For
Infix notation for constructing a chart mapPos ⇉ mapDir
Equations
- PFunctor.«term_⇉_» = Lean.ParserDescr.trailingNode `PFunctor.«term_⇉_» 25 26 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⇉ ") (Lean.ParserDescr.cat `term 25))
Instances For
The identity chart
Instances For
Infix notation for chart composition c' ∘c c
Equations
- PFunctor.Chart.«term_∘c_» = Lean.ParserDescr.trailingNode `PFunctor.Chart.«term_∘c_» 75 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ∘c ") (Lean.ParserDescr.cat `term 76))
Instances For
Infix notation for chart equivalence P ≃c Q
Equations
- PFunctor.Chart.«term_≃c_» = Lean.ParserDescr.trailingNode `PFunctor.Chart.«term_≃c_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≃c ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- PFunctor.Chart.Equiv.refl P = { toChart := PFunctor.Chart.id P, invChart := PFunctor.Chart.id P, left_inv := ⋯, right_inv := ⋯ }
Instances For
The (unique) initial chart from the zero functor to any functor P
.
Equations
- PFunctor.Chart.initial = (PEmpty.elim ⇉ fun (x : PFunctor.A 0) => PEmpty.elim)
Instances For
The (unique) terminal chart from any functor P
to the functor Y
.
Equations
- PFunctor.Chart.terminal = ((fun (x : P.A) => PUnit.unit) ⇉ fun (x : P.A) (x : P.B x) => PUnit.unit)
Instances For
Alias of PFunctor.Chart.initial
.
The (unique) initial chart from the zero functor to any functor P
.
Equations
Instances For
Alias of PFunctor.Chart.terminal
.
The (unique) terminal chart from any functor P
to the functor Y
.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Commutativity of coproduct
Equations
- PFunctor.Lens.Equiv.coprodComm P Q = { toLens := [PFunctor.Lens.inr,PFunctor.Lens.inl]ₗ, invLens := [PFunctor.Lens.inr,PFunctor.Lens.inl]ₗ, left_inv := ⋯, right_inv := ⋯ }
Instances For
Associativity of coproduct
Equations
- One or more equations did not get rendered due to their size.
Instances For
Coproduct with 0
is identity (right)
Equations
- PFunctor.Lens.Equiv.coprodZero = { toLens := [PFunctor.Lens.id P,PFunctor.Lens.initial]ₗ, invLens := PFunctor.Lens.inl, left_inv := ⋯, right_inv := ⋯ }
Instances For
Coproduct with 0
is identity (left)
Equations
- PFunctor.Lens.Equiv.zeroCoprod = { toLens := [PFunctor.Lens.initial,PFunctor.Lens.id P]ₗ, invLens := PFunctor.Lens.inr, left_inv := ⋯, right_inv := ⋯ }
Instances For
Commutativity of product
Equations
- One or more equations did not get rendered due to their size.
Instances For
Associativity of product
Equations
- One or more equations did not get rendered due to their size.
Instances For
Product with 1
is identity (right)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Product with 1
is identity (left)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Product with 0
is zero (right)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Product with 0
is zero (left)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Left distributive law for product over coproduct
Equations
- One or more equations did not get rendered due to their size.
Instances For
Right distributive law for coproduct over product
Equations
- One or more equations did not get rendered due to their size.
Instances For
Associativity of composition
Equations
- One or more equations did not get rendered due to their size.
Instances For
Composition with y
is identity (right)
Equations
- PFunctor.Lens.Equiv.compY = { toLens := PFunctor.Lens.invTildeR, invLens := PFunctor.Lens.tildeR, left_inv := ⋯, right_inv := ⋯ }
Instances For
Composition with y
is identity (left)
Equations
- PFunctor.Lens.Equiv.yComp = { toLens := PFunctor.Lens.invTildeL, invLens := PFunctor.Lens.tildeL, left_inv := ⋯, right_inv := ⋯ }
Instances For
Distributivity of composition over coproduct on the right
Equations
- One or more equations did not get rendered due to their size.
Instances For
Commutativity of tensor product
Equations
Instances For
Associativity of tensor product
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tensor product with y
is identity (right)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tensor product with y
is identity (left)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tensor product with 0
is zero (left)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Tensor product with 0
is zero (right)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Left distributivity of tensor product over coproduct
Equations
- One or more equations did not get rendered due to their size.
Instances For
Right distributivity of tensor product over coproduct
Equations
- One or more equations did not get rendered due to their size.
Instances For
Sigma of an empty family is the zero functor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Sigma of a PUnit
-indexed family is equivalent to the functor itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Sigma of an I
-indexed family, where I
is unique, is equivalent to the functor itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Left distributivity of product over sigma.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Right distributivity of product over sigma.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Left distributivity of tensor product over sigma.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Right distributivity of tensor product over sigma.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pi over a PUnit
-indexed family is equivalent to the functor itself.
Equations
- One or more equations did not get rendered due to their size.