Documentation

ToMathlib.PFunctor.Equiv.Basic

Equivalences of Polynomial Functors #

This file defines equivalences between polynomial functors and proves basic properties about them.

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.

We provide various canonical equivalences for operations on polynomial functors, such as:

Main definitions #

Main results #

instance instIsEmptySigma {α : Sort u} {β : αSort v} [inst : IsEmpty α] :
IsEmpty ((a : α) ×' β a)

Addition with the zero functor on the left is equivalent to the original functor

Instances For
    @[simp]
    theorem PFunctor.Equiv.sumZero_equivB (P : PFunctor.{uA₁, uB}) (x✝ : (P + 0).A) :
    (sumZero P).equivB x✝ = Sum.casesOn x✝ (fun (x : P.A) => _root_.Equiv.refl ((P + 0).B (Sum.inl x))) fun (a : A 0) => PEmpty.elim a

    Addition with the zero functor on the right is equivalent to the original functor

    Instances For
      @[simp]
      theorem PFunctor.Equiv.zeroSum_equivB (P : PFunctor.{uA₁, uB}) (x✝ : (0 + P).A) :
      (zeroSum P).equivB x✝ = Sum.casesOn x✝ (fun (a : A 0) => PEmpty.elim a) fun (x : P.A) => _root_.Equiv.refl ((0 + P).B (Sum.inr x))

      Sum of polynomial functors is commutative up to equivalence

      Instances For
        @[simp]
        theorem PFunctor.Equiv.sumComm_equivB (P : PFunctor.{uA₁, uB}) (Q : PFunctor.{uA₂, uB}) (x✝ : (P + Q).A) :
        (sumComm P Q).equivB x✝ = Sum.casesOn x✝ (fun (x : P.A) => _root_.Equiv.refl ((P + Q).B (Sum.inl x))) fun (x : Q.A) => _root_.Equiv.refl ((P + Q).B (Sum.inr x))

        Sum of polynomial functors is associative up to equivalence

        Instances For
          @[simp]
          theorem PFunctor.Equiv.sumAssoc_equivB (P : PFunctor.{uA₁, uB}) (Q : PFunctor.{uA₂, uB}) (R : PFunctor.{uA₃, uB}) (x✝ : (P + Q + R).A) :
          (sumAssoc P Q R).equivB x✝ = Sum.casesOn x✝ (fun (x : (P + Q).A) => Sum.casesOn x (fun (x : P.A) => _root_.Equiv.refl ((P + Q + R).B (Sum.inl (Sum.inl x)))) fun (x : Q.A) => _root_.Equiv.refl ((P + Q + R).B (Sum.inl (Sum.inr x)))) fun (x : R.A) => _root_.Equiv.refl ((P + Q + R).B (Sum.inr x))
          def PFunctor.Equiv.sumCongr {P Q : PFunctor.{u_1, u_2}} {R : PFunctor.{uA₃, uB₁}} {S : PFunctor.{uA₄, uB₁}} (e₁ : P.Equiv R) (e₂ : Q.Equiv S) :
          (P + Q).Equiv (R + S)

          If P ≃ₚ R and Q ≃ₚ S, then P + Q ≃ₚ R + S

          Instances For
            @[simp]
            theorem PFunctor.Equiv.sumCongr_equivB {P Q : PFunctor.{u_1, u_2}} {R : PFunctor.{uA₃, uB₁}} {S : PFunctor.{uA₄, uB₁}} (e₁ : P.Equiv R) (e₂ : Q.Equiv S) (x✝ : (P + Q).A) :
            (e₁.sumCongr e₂).equivB x✝ = Sum.casesOn x✝ (fun (x : P.A) => e₁.equivB x) fun (x : Q.A) => e₂.equivB x

            Rearrangement of nested sums: (P + Q) + (R + S) ≃ₚ (P + R) + (Q + S)

            Instances For

              Product with 0 on the right is 0

              Instances For

                Product with 0 on the left is 0

                Instances For

                  Product with the unit functor on the right is equivalent to the original functor

                  Instances For

                    Product with the unit functor on the left is equivalent to the original functor

                    Instances For

                      Product of polynomial functors is commutative up to equivalence

                      Instances For

                        Product of polynomial functors is associative up to equivalence

                        Instances For
                          @[simp]
                          def PFunctor.Equiv.prodCongr {P Q : PFunctor.{u_1, u_2}} {R : PFunctor.{uA₃, uB₃}} {S : PFunctor.{uA₄, uB₄}} (e₁ : P.Equiv R) (e₂ : Q.Equiv S) :
                          (P * Q).Equiv (R * S)

                          Equivalence is preserved under product: if P ≃ₚ R and Q ≃ₚ S, then P * Q ≃ₚ R * S

                          Instances For
                            @[simp]
                            theorem PFunctor.Equiv.prodCongr_equivB {P Q : PFunctor.{u_1, u_2}} {R : PFunctor.{uA₃, uB₃}} {S : PFunctor.{uA₄, uB₄}} (e₁ : P.Equiv R) (e₂ : Q.Equiv S) (a : (P * Q).A) :
                            (e₁.prodCongr e₂).equivB a = (e₁.equivB a.1).sumCongr (e₂.equivB a.2)

                            Rearrangement of nested products: (P * Q) * (R * S) ≃ₚ (P * R) * (Q * S)

                            Instances For

                              Sum distributes over product: (P + Q) * R ≃ₚ (P * R) + (Q * R)

                              Instances For

                                Product distributes over sum: P * (Q + R) ≃ₚ (P * Q) + (P * R)

                                TODO: define in terms of sumProdDistrib

                                Instances For
                                  @[simp]
                                  theorem PFunctor.Equiv.prodSumDistrib_equivB (P : PFunctor.{uA₁, uB₁}) (Q : PFunctor.{uA₂, uB₂}) (R : PFunctor.{uA₃, uB₂}) (x✝ : (P * (Q + R)).A) :
                                  (prodSumDistrib P Q R).equivB x✝ = match x✝ with | (fst, a) => Sum.casesOn a (fun (x : Q.A) => _root_.Equiv.refl ((P * (Q + R)).B (fst, Sum.inl x))) fun (x : R.A) => _root_.Equiv.refl ((P * (Q + R)).B (fst, Sum.inr x))
                                  def PFunctor.Equiv.emptySigma {I : Type v} (F : IPFunctor.{uA₂, uB₂}) [inst : IsEmpty I] :
                                  (sigma F).Equiv 0

                                  Sigma of an empty family is the zero functor.

                                  Instances For
                                    Instances For

                                      Sigma of a PUnit-indexed family is equivalent to the functor itself.

                                      Instances For
                                        def PFunctor.Equiv.sumSigmaDistrib (P : PFunctor.{uA₁, uB₁}) {I : Type v} (F : IPFunctor.{uA₂, uB₁}) [Unique I] :
                                        (P + sigma F).Equiv (sigma fun (i : I) => P + F i)

                                        Left distributivity of sum over sigma.

                                        Instances For
                                          def PFunctor.Equiv.sigmaSumDistrib (P : PFunctor.{uA₁, uB₁}) {I : Type v} (F : IPFunctor.{uA₂, uB₁}) [Unique I] :
                                          (sigma F + P).Equiv (sigma fun (i : I) => F i + P)

                                          Right distributivity of sum over sigma.

                                          Instances For
                                            def PFunctor.Equiv.prodSigmaDistrib (P : PFunctor.{uA₁, uB₁}) {I : Type v} (F : IPFunctor.{uA₂, uB₂}) :
                                            (P * sigma F).Equiv (sigma fun (i : I) => P * F i)

                                            Left distributivity of product over sigma.

                                            Instances For
                                              def PFunctor.Equiv.sigmaProdDistrib (P : PFunctor.{uA₁, uB₁}) {I : Type v} (F : IPFunctor.{uA₂, uB₂}) :
                                              (sigma F * P).Equiv (sigma fun (i : I) => F i * P)

                                              Right distributivity of product over sigma.

                                              Instances For

                                                Left distributivity of tensor product over sigma.

                                                Instances For

                                                  Right distributivity of tensor product over sigma.

                                                  Instances For
                                                    def PFunctor.Equiv.sigmaCompDistrib {I : Type v} (F : IPFunctor.{uA₁, uB₁}) (P : PFunctor.{uA₂, uB₂}) :
                                                    ((sigma F).comp P).Equiv (sigma fun (i : I) => (F i).comp P)

                                                    Right distributivity of composition over sigma.

                                                    Instances For

                                                      Pi over a PUnit-indexed family is equivalent to the functor itself.

                                                      Instances For

                                                        Equivalence between a polynomial functor and its universe-lifted version

                                                        Instances For

                                                          Universe lifting is idempotent up to equivalence

                                                          Instances For

                                                            Universe lifting commutes with sum

                                                            Instances For

                                                              Universe lifting commutes with product.

                                                              Instances For

                                                                Tensor product with 0 on the right is 0

                                                                Instances For

                                                                  Tensor product with 0 on the left is 0

                                                                  Instances For

                                                                    Tensor product with 1 on the right is equivalent to the constant functor

                                                                    Instances For

                                                                      Tensor product with 1 on the left is equivalent to the constant functor

                                                                      Instances For

                                                                        Tensor product with the functor Y on the right

                                                                        Instances For

                                                                          Tensor product with the functor Y on the left

                                                                          Instances For

                                                                            Tensor product of polynomial functors is commutative up to equivalence

                                                                            Instances For

                                                                              Tensor product of polynomial functors is associative up to equivalence

                                                                              Instances For

                                                                                Tensor product preserves equivalences: if P ≃ₚ R and Q ≃ₚ S, then P ⊗ Q ≃ₚ R ⊗ S

                                                                                Instances For
                                                                                  @[simp]
                                                                                  theorem PFunctor.Equiv.tensorCongr_equivB {P : PFunctor.{uA₁, uB₁}} {Q : PFunctor.{uA₂, uB₂}} {R : PFunctor.{uA₃, uB₃}} {S : PFunctor.{uA₄, uB₄}} (e₁ : P.Equiv R) (e₂ : Q.Equiv S) (a : (P.tensor Q).A) :
                                                                                  (e₁.tensorCongr e₂).equivB a = (e₁.equivB a.1).prodCongr (e₂.equivB a.2)

                                                                                  Rearrangement of nested tensor products: (P ⊗ Q) ⊗ (R ⊗ S) ≃ₚ (P ⊗ R) ⊗ (Q ⊗ S)

                                                                                  Instances For

                                                                                    Sum distributes over tensor product: (P + Q) ⊗ R ≃ₚ (P ⊗ R) + (Q ⊗ R)

                                                                                    Instances For

                                                                                      Tensor product distributes over sum: P ⊗ (Q + R) ≃ₚ (P ⊗ Q) + (P ⊗ R)

                                                                                      Instances For

                                                                                        Associativity of composition

                                                                                        Instances For

                                                                                          Composition with X is identity (right)

                                                                                          Instances For

                                                                                            Composition with X is identity (left)

                                                                                            Instances For

                                                                                              Distributivity of composition over sum on the right

                                                                                              Instances For

                                                                                                Composition distributes over product on the left.

                                                                                                Instances For