Documentation

GroupoidModel.Syntax.NaturalModel

structure NaturalModel.Universe (Ctx : Type u) [CategoryTheory.Category.{u_1, u} Ctx] :
Type (max u (u_1 + 1))

A natural model with support for dependent types (and nothing more). The data is a natural transformation with representable fibers, stored as a choice of representative for each fiber.

Instances For

    Pullback of representable natural transformation #

    Pull a natural model back along a type.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def NaturalModel.Universe.ofIsPullback {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) {U E : CategoryTheory.Psh Ctx} {π : E U} {toTy : U M.Ty} {toTm : E M.Tm} (pb : CategoryTheory.IsPullback toTm π M.tp toTy) :

      Given the pullback square on the right, with a natural model structure on tp : TmTy giving the outer pullback square.

      Γ.A -.-.- var -.-,-> E ------ toTm ------> Tm | | | | | | M.disp π tp | | | V V V Γ ------- A -------> U ------ toTy ------> Ty

      construct a natural model structure on π : E ⟶ U, by pullback pasting.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Substitutions #

        Δ ⊢ σ : Γ  Γ ⊢ A type  Δ ⊢ t : A[σ]
        -----------------------------------
        Δ ⊢ σ.t : Γ.A
        

        ------ Δ ------ t --------¬ | ↓ substCons ↓ | M.ext A ---var A---> M.Tm | | | σ | | | disp A M.tp | | | | V V ---> Γ ------ A -----> M.Ty

        Equations
        Instances For
          def NaturalModel.Universe.substFst {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) {Δ Γ : Ctx} {A : CategoryTheory.yoneda.obj Γ M.Ty} (σ : Δ M.ext A) :
          Δ Γ
          Δ ⊢ σ : Γ.A
          ------------
          Δ ⊢ ↑∘σ : Γ
          
          Equations
          Instances For
            Δ ⊢ σ : Γ.A
            -------------------
            Δ ⊢ v₀[σ] : A[↑∘σ]
            
            Equations
            Instances For

              Weaken a substitution.

              Δ ⊢ σ : Γ  Γ ⊢ A type  A' = A[σ]
              ------------------------------------
              Δ.A' ⊢ ↑≫σ : Γ  Δ.A' ⊢ v₀ : A[↑≫σ]
              ------------------------------------
              Δ.A' ⊢ (↑≫σ).v₀ : Γ.A
              
              Equations
              Instances For

                sec is the section of disp A corresponding to a.

                ===== Γ ------ a --------¬ ‖ ↓ sec V ‖ M.ext A -----------> M.Tm ‖ | | ‖ | | ‖ disp A M.tp ‖ | | ‖ V V ===== Γ ------ A -----> M.Ty

                Equations
                Instances For

                  Polynomial functor on tp #

                  Specializations of results from the Poly package to natural models.

                  Equations
                  Instances For

                    A map (AB : y(Γ) ⟶ M.Ptp.obj X) is equivalent to a pair of maps A : y(Γ) ⟶ M.Ty and B : y(M.ext (fst M AB)) ⟶ X, thought of as a dependent pair A : Type and B : A ⟶ Type. PtpEquiv.fst is the A in this pair.

                    Equations
                    Instances For
                      def NaturalModel.Universe.PtpEquiv.snd {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) {Γ : Ctx} {X : CategoryTheory.Psh Ctx} (AB : CategoryTheory.yoneda.obj Γ M.Ptp.obj X) (A : CategoryTheory.yoneda.obj Γ M.Ty := fst M AB) (eq : fst M AB = A := by rfl) :

                      A map (AB : y(Γ) ⟶ M.Ptp.obj X) is equivalent to a pair of maps A : y(Γ) ⟶ M.Ty and B : y(M.ext (fst M AB)) ⟶ X, thought of as a dependent pair A : Type and B : A ⟶ Type PtpEquiv.snd is the B in this pair.

                      Equations
                      Instances For

                        A map (AB : y(Γ) ⟶ M.Ptp.obj X) is equivalent to a pair of maps A : y(Γ) ⟶ M.Ty and B : y(M.ext (fst M AB)) ⟶ X, thought of as a dependent pair A : Type and B : A ⟶ Type PtpEquiv.mk constructs such a map AB from such a pair A and B.

                        Equations
                        Instances For
                          @[simp]
                          theorem NaturalModel.Universe.PtpEquiv.fst_mk {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) {Γ : Ctx} {X : CategoryTheory.Psh Ctx} (A : CategoryTheory.yoneda.obj Γ M.Ty) (B : CategoryTheory.yoneda.obj (M.ext A) X) :
                          fst M (mk M A B) = A
                          @[simp]
                          theorem NaturalModel.Universe.PtpEquiv.snd_mk {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) {Γ : Ctx} {X : CategoryTheory.Psh Ctx} (A : CategoryTheory.yoneda.obj Γ M.Ty) (B : CategoryTheory.yoneda.obj (M.ext A) X) :
                          snd M (mk M A B) A = B
                          theorem NaturalModel.Universe.PtpEquiv.ext {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) {Γ : Ctx} {X : CategoryTheory.Psh Ctx} {AB AB' : CategoryTheory.yoneda.obj Γ M.Ptp.obj X} (A : CategoryTheory.yoneda.obj Γ M.Ty := fst M AB) (eq : fst M AB = A := by rfl) (h1 : fst M AB = fst M AB') (h2 : snd M AB A eq = snd M AB' A ) :
                          AB = AB'
                          theorem NaturalModel.Universe.PtpEquiv.eta {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) {Γ : Ctx} {X : CategoryTheory.Psh Ctx} (AB : CategoryTheory.yoneda.obj Γ M.Ptp.obj X) :
                          mk M (fst M AB) (snd M AB (fst M AB) ) = AB

                          Polynomial composition M.tp ▸ N.tp #

                          Universal property of compDom, decomposition (part 1).

                          A map ab : y(Γ) ⟶ M.uvPolyTp.compDom N.uvPolyTp is equivalently three maps fst, dependent, snd such that fst_tp and snd_tp. The map fst : y(Γ) ⟶ M.Tm is the (a : A) in (a : A) × (b : B a).

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Computation of comp (part 1).

                            fst_tp is (part 1) of the computation that (α, B, β, h) Γ ⟶ compDom \ | \ | comp (α ≫ tp, B) | \ V > P_tp Ty Namely the first projection α ≫ tp agrees.

                            Universal property of compDom, decomposition (part 2).

                            A map ab : y(Γ) ⟶ M.uvPolyTp.compDom N.uvPolyTp is equivalently three maps fst, dependent, snd such that fst_tp and snd_tp. The map dependent : y(M.ext (fst N ab ≫ M.tp)) ⟶ M.Ty is the B : A ⟶ Type in (a : A) × (b : B a). Here A is implicit, derived by the typing of fst, or (a : A).

                            Equations
                            Instances For

                              Universal property of compDom, decomposition (part 3).

                              A map ab : y(Γ) ⟶ M.uvPolyTp.compDom N.uvPolyTp is equivalently three maps fst, dependent, snd such that fst_tp and snd_tp. The map snd : y(Γ) ⟶ M.Tm is the (b : B a) in (a : A) × (b : B a).

                              Equations
                              Instances For

                                Universal property of compDom, decomposition (part 4).

                                A map ab : y(Γ) ⟶ M.uvPolyTp.compDom N.uvPolyTp is equivalently three maps fst, dependent, snd such that fst_tp and snd_tp. The equation snd_tp says that the type of b : B a agrees with the expression for B a obtained solely from dependent, or B : A ⟶ Type.

                                theorem NaturalModel.Universe.compDomEquiv.ext {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M N : Universe Ctx} {Γ : Ctx} {ab₁ ab₂ : CategoryTheory.yoneda.obj Γ M.uvPolyTp.compDom N.uvPolyTp} {A : CategoryTheory.yoneda.obj Γ M.Ty} (eq : CategoryTheory.CategoryStruct.comp (fst ab₁) M.tp = A) (h1 : fst ab₁ = fst ab₂) (h2 : dependent ab₁ A eq = dependent ab₂ A ) (h3 : snd ab₁ = snd ab₂) :
                                ab₁ = ab₂

                                Pi and Sigma types #

                                Instances For
                                  Instances For
                                    structure NaturalModel.Universe.IdIntro {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) :
                                    Type (u + 1)

                                    Universe.IdIntro consists of the following commutative square refl M.Tm ------> M.Tm | | | | diag M.tp | | | | V V k --------> M.Ty Id

                                    where K (for "Kernel" of tp) is a chosen pullback for the square k1 k ---------> Tm | | | | k2 | tp | | V V Tm ----------> Ty tp and diag denotes the diagonal into the pullback K.

                                    We require a choice of pullback because, although all pullbacks exist in presheaf categories, when constructing a model it is convenient to know that k is some specific construction on-the-nose.

                                    Instances For

                                      The introduction rule for identity types. To minimize the number of arguments, we infer the type from the terms.

                                      Equations
                                      Instances For
                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem NaturalModel.Universe.IdIntro.mkRefl_tp {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M : Universe Ctx} (idIntro : M.IdIntro) {Γ : Ctx} (a : CategoryTheory.yoneda.obj Γ M.Tm) :
                                          CategoryTheory.CategoryStruct.comp (idIntro.mkRefl a) M.tp = idIntro.mkId a a
                                          def NaturalModel.Universe.IdIntro.motiveCtx {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M : Universe Ctx} (idIntro : M.IdIntro) {Γ : Ctx} (a : CategoryTheory.yoneda.obj Γ M.Tm) :
                                          Ctx

                                          The context appearing in the motive for identity elimination J Γ ⊢ A Γ ⊢ a : A Γ.(x:A).(h:Id(A,a,x)) ⊢ M ...

                                          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
                                              def NaturalModel.Universe.IdIntro.reflSubst {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M : Universe Ctx} (idIntro : M.IdIntro) {Γ : Ctx} (a : CategoryTheory.yoneda.obj Γ M.Tm) :
                                              Γ idIntro.motiveCtx a

                                              The substitution (a,refl) appearing in identity elimination J (a,refl) : y(Γ) ⟶ y(Γ.(x:A).(h:Id(A,a,x))) so that we can write Γ ⊢ r : M(a,refl)

                                              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
                                                  structure NaturalModel.Universe.Id' {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] (M : Universe Ctx) (i : M.IdIntro) (N : Universe Ctx) :

                                                  The full structure interpreting the natural model semantics for identity types requires an IdIntro and an elimination rule j which satisfies a typing rule j_tp and a β-rule reflSubst_j. There is an equivalent formulation of these extra conditions later in Id1 that uses the language of polynomial endofunctors.

                                                  Note that the universe/model N for the motive C is different from the universe M that the identity type lives in.

                                                  Instances For
                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      The elimination rule for identity types, now with the parameters as explicit terms. Γ ⊢ A is the type with a term Γ ⊢ a : A. Γ (y : A) (p : Id(A,a,y)) ⊢ C is the motive for the elimination. Γ ⊢ b : A is a second term in A and Γ ⊢ h : Id(A,a,b) is a path from a to b. Then Γ ⊢ mkJ' : C [b/y,h/p] is a term of the motive with b and h substituted

                                                      Equations
                                                      Instances For

                                                        β rule for identity types. Substituting J with refl gives the user-supplied value r

                                                        structure NaturalModel.Universe.IdElimBase {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M : Universe Ctx} (ii : M.IdIntro) :
                                                        Type (u + 1)

                                                        UniverseBase.IdElimBase extends the structure UniverseBase.IdIntro with a chosen pullback of Id i1 i --------> M.Tm | | | | i2 M.tp | | V V k --------> M.Ty Id

                                                        Again, we always have a pullback, but when we construct a natural model, this may not be definitionally equal to the pullbacks we construct, for example using context extension.

                                                        Instances For

                                                          The comparison map M.tm ⟶ i induced by the pullback universal property of i.

                                                                refl
                                                          

                                                          M.Tm ---------> i1 | i --------> M.Tm | | | diag | | | i2 M.tp | | | | V V V k --------> M.Ty Id

                                                          Equations
                                                          Instances For

                                                            i over Tm can be informally thought of as the context extension (A : Ty).(a b : A).(p : Id(a,b)) ->> (A : Ty) (a : A) which is defined by the composition of (maps informally thought of as) context extensions (A : Ty).(a b : A).(p : Id(a,b)) ->> (A : Ty).(a b : A) ->> (A : Ty).(a : A) This is the signature for a polynomial functor iUvPoly on the presheaf category Psh Ctx.

                                                            Equations
                                                            Instances For
                                                              @[reducible, inline]

                                                              The functor part of the polynomial endofunctor iOverUvPoly

                                                              Equations
                                                              Instances For

                                                                Consider the comparison map comparison : Tmi in the slice over Tm. Then the contravariant action UVPoly.verticalNatTrans of taking UvPoly on a slice results in a natural transformation P_iOver ⟶ P_(𝟙 Tm) between the polynomial endofunctors iUvPoly and UvPoly.id M.Tm respectively. comparison Tm ----> i \ / 𝟙\ /i2 ≫ k2 \ / VV Tm

                                                                Equations
                                                                Instances For

                                                                  The variable r witnesses the motive for the case refl, This gives a map (a,r) : Γ ⟶ P_𝟙Tm TmTm × Tm where

                                                                      fst ≫ r
                                                                  N.Tm <--   Γ  --------> Tm
                                                                      <      ‖            ‖
                                                                       \     ‖   (pb)     ‖ 𝟙_Tm
                                                                      r \    ‖            ‖
                                                                         \   ‖            ‖
                                                                          \  Γ  --------> Tm
                                                                                   a
                                                                  
                                                                  Equations
                                                                  Instances For
                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      Equations
                                                                      Instances For
                                                                        structure NaturalModel.Universe.Id {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M : Universe Ctx} {ii : M.IdIntro} (ie : IdElimBase ii) (N : Universe Ctx) :
                                                                        Type (u + 1)

                                                                        In the high-tech formulation by Richard Garner and Steve Awodey: The full structure interpreting the natural model semantics for identity types requires an IdIntro, (and IdElimBase which can be generated by pullback in the presheaf category,) and that the following commutative square generated by IdBaseComparison.verticalNatTrans is a weak pullback.

                                                                          verticalNatTrans.app Tm
                                                                        iFunctor Tm --------> P_𝟙Tm Tm
                                                                          |                    |
                                                                          |                    |
                                                                        iFunctor tp           P_𝟙Tm tp
                                                                          |                    |
                                                                          |                    |
                                                                          V                    V
                                                                        iFunctor Ty --------> P_𝟙Tm Ty
                                                                          verticalNatTrans.app Ty
                                                                        

                                                                        This can be thought of as saying the following. Fix A : Ty and a : A - we are working in the slice over M.Tm. For any context Γ, any map (a, r) : Γ → P_𝟙Tm Tm and (a, C) : Γ ⟶ iFunctor Ty such that r ≫ M.tp = C[x/y, refl_x/p], there is a map (a,c) : Γ ⟶ iFunctor Tm such that c ≫ M.tp = C and c[a/y, refl_a/p] = r. Here we are thinking Γ (y : A) (p : A) ⊢ C : Ty Γ ⊢ r : C[a/y, refl_a/p] Γ (y : A) (p : A) ⊢ c : Ty This witnesses the elimination principle for identity types since we can take J (y.p.C;x.r) := c.

                                                                        Instances For

                                                                          The variable r witnesses the motive for the case refl, This gives a map (a,r) : Γ ⟶ P_𝟙Tm TmTm × Tm where

                                                                              fst ≫ r
                                                                          Tm <--   Γ  --------> Tm
                                                                            <      ‖            ‖
                                                                             \     ‖   (pb)     ‖ 𝟙_Tm
                                                                            r \    ‖            ‖
                                                                               \   ‖            ‖
                                                                                \  Γ  --------> Tm
                                                                                        a
                                                                          
                                                                          Equations
                                                                          Instances For
                                                                            @[reducible, inline]

                                                                            The variable C is the motive for elimination, This gives a map (a, C) : Γ ⟶ iFunctor Ty

                                                                                C
                                                                            Ty <-- y(motiveCtx) ----> i
                                                                                         |            |
                                                                                         |            | i2k2
                                                                                         |            |
                                                                                         V            V
                                                                                         Γ  --------> Tm
                                                                                              a
                                                                            
                                                                            Equations
                                                                            Instances For

                                                                              The elimination rule for identity types. Γ ⊢ A is the type with a term Γ ⊢ a : A. Γ (y : A) (h : Id(A,a,y)) ⊢ C is the motive for the elimination. Then we obtain a section of the motive Γ (y : A) (h : Id(A,a,y)) ⊢ mkJ : A

                                                                              Equations
                                                                              Instances For

                                                                                β rule for identity types. Substituting J with refl gives the user-supplied value r

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  def NaturalModel.Universe.Id.toId' {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M N : Universe Ctx} {ii : M.IdIntro} {ie : IdElimBase ii} (i : Id ie N) :
                                                                                  M.Id' ii N

                                                                                  Id is equivalent to Id (one half).

                                                                                  Equations
                                                                                  • i.toId' = { j := fun {Γ : Ctx} => i.j, j_tp := , comp_j := , reflSubst_j := }
                                                                                  Instances For
                                                                                    @[reducible, inline]
                                                                                    abbrev NaturalModel.Universe.Id'.motive {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M : Universe Ctx} {ii : M.IdIntro} {ie : IdElimBase ii} {N : Universe Ctx} {Γ : Ctx} (aC : CategoryTheory.yoneda.obj Γ ie.iFunctor.obj N.Ty) :
                                                                                    Equations
                                                                                    Instances For
                                                                                      def NaturalModel.Universe.Id'.toId {Ctx : Type u} [CategoryTheory.SmallCategory Ctx] {M : Universe Ctx} {ii : M.IdIntro} {ie : IdElimBase ii} {N : Universe Ctx} (i : M.Id' ii N) :
                                                                                      Id ie N
                                                                                      Equations
                                                                                      • One or more equations did not get rendered due to their size.
                                                                                      Instances For