Documentation

PolyFun.PFunctor.Lens.Coherence

Coherence of the parallel and composition products #

The parallel product ⊗ with unit y is a symmetric monoidal structure on lenses (Niu–Spivak §3.10, p. 65), and the composition product ◃ with unit y is a monoidal structure (Niu–Spivak §6.1–§6.3, pp. 177–213). This file states the coherence laws for the structural lenses of Lens/Basic.lean at independent universes:

The naturality of the ⊗ associator and unitors is in Lens/Basic.lean. Every law holds definitionally. Unitor naturality across universes compares the two copies of y along unitComparison.

The composition product of polynomials is the composite of their actions: Obj.compEquiv : (P ◃ Q).Obj X ≃ P.Obj (Q.Obj X) (Prop 6.2, p. 178), and ◃ₗ acts as the horizontal composite of natural transformations (Obj.compEquiv_mapObj_compMap). Lens.Equiv.compCongr composes lens equivalences, and Lens.Equiv.compNthAdd splits a composition power, P ◃^ (m + l) ≃ₗ P ◃^ l ◃ P ◃^ m.

The parallel product #

Naturality of the braiding P ⊗ Q ⇆ Q ⊗ P.

The composition product #

Naturality of the ◃ associator across lenses whose source and target polynomials occupy six independent universe pairs.

Naturality of the right ◃ unitor. The unit component is the canonical comparison between the independently instantiated copies of y.

Composing lens equivalences #

The composition product of two lens equivalences.

Equations
Instances For

    A composition power splits along a sum of exponents: P ◃^ (m + l) ≃ₗ P ◃^ l ◃ P ◃^ m.

    Equations
    Instances For

      The composition product as a composite of actions #

      def PFunctor.Obj.compEquiv (P : PFunctor.{uA₁, uB₁}) (Q : PFunctor.{uA₂, uB₂}) (X : Type v) :
      ↑(P.comp Q) X ≃ ↑P (↑Q X)

      The action of P ◃ Q is the composite of the actions (Niu–Spivak Prop 6.2).

      Equations
      Instances For
        theorem PFunctor.Obj.compEquiv_mapObj_compMap {P : PFunctor.{uA₁, uB₁}} {Q : PFunctor.{uA₂, uB₂}} {R : PFunctor.{uA₃, uB₃}} {W : PFunctor.{uA₄, uB₄}} (f : P.Lens R) (g : Q.Lens W) {X : Type v} (x : ↑(P.comp Q) X) :
        (compEquiv R W X) ((f.compMap g).mapObj x) = f.mapObj (P.map g.mapObj ((compEquiv P Q X) x))

        The composition product of lenses acts as the horizontal composite of their natural transformations: first g inside, then f outside.