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.
- Tm : CategoryTheory.Psh Ctx
- Ty : CategoryTheory.Psh Ctx
- var {Γ : Ctx} (A : CategoryTheory.yoneda.obj Γ ⟶ self.Ty) : CategoryTheory.yoneda.obj (self.ext A) ⟶ self.Tm
- disp_pullback {Γ : Ctx} (A : CategoryTheory.yoneda.obj Γ ⟶ self.Ty) : CategoryTheory.IsPullback (self.var A) (CategoryTheory.yoneda.map (self.disp A)) self.tp A
Instances For
Equations
- M.pullbackIsoExt A = ⋯.isoPullback.symm
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
Given the pullback square on the right,
with a natural model structure on tp : Tm ⟶ Ty
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
- M.substCons σ A t t_tp = CategoryTheory.Yoneda.fullyFaithful.preimage (⋯.lift t (CategoryTheory.yoneda.map σ) t_tp)
Instances For
Δ ⊢ σ : Γ.A
------------
Δ ⊢ ↑∘σ : Γ
Equations
- M.substFst σ = CategoryTheory.CategoryStruct.comp σ (M.disp A)
Instances For
Δ ⊢ σ : Γ.A
-------------------
Δ ⊢ v₀[σ] : A[↑∘σ]
Equations
- M.substSnd σ = CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map σ) (M.var A)
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
- M.sec A a a_tp = M.substCons (CategoryTheory.CategoryStruct.id Γ) A a ⋯
Instances For
Instances For
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
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
- NaturalModel.Universe.PtpEquiv.snd M AB A eq = CategoryTheory.UvPoly.Equiv.snd' M.uvPolyTp X AB ⋯
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
- NaturalModel.Universe.PtpEquiv.mk M A B = CategoryTheory.UvPoly.Equiv.mk' M.uvPolyTp X A ⋯ B
Instances For
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
.
Universal property of compDom
, constructing a map into compDom
.
Equations
Instances For
Pi and Sigma types #
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.
- k : CategoryTheory.Psh Ctx
- isKernelPair : CategoryTheory.IsKernelPair M.tp self.k1 self.k2
- refl_tp : CategoryTheory.CategoryStruct.comp self.refl M.tp = CategoryTheory.CategoryStruct.comp (CategoryTheory.IsPullback.lift ⋯ (CategoryTheory.CategoryStruct.id M.Tm) (CategoryTheory.CategoryStruct.id M.Tm) ⋯) self.Id
Instances For
The introduction rule for identity types. To minimize the number of arguments, we infer the type from the terms.
Equations
- idIntro.mkId a0 a1 a0_tp_eq_a1_tp = CategoryTheory.CategoryStruct.comp (⋯.lift a1 a0 ⋯) idIntro.Id
Instances For
Equations
- idIntro.mkRefl a = CategoryTheory.CategoryStruct.comp a idIntro.refl
Instances For
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
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
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.
- j {Γ : Ctx} (a : CategoryTheory.yoneda.obj Γ ⟶ M.Tm) (C : CategoryTheory.yoneda.obj (i.motiveCtx a) ⟶ N.Ty) (r : CategoryTheory.yoneda.obj Γ ⟶ N.Tm) (r_tp : CategoryTheory.CategoryStruct.comp r N.tp = CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (i.reflSubst a)) C) : CategoryTheory.yoneda.obj (i.motiveCtx a) ⟶ N.Tm
- j_tp {Γ : Ctx} (a : CategoryTheory.yoneda.obj Γ ⟶ M.Tm) (C : CategoryTheory.yoneda.obj (i.motiveCtx a) ⟶ N.Ty) (r : CategoryTheory.yoneda.obj Γ ⟶ N.Tm) (r_tp : CategoryTheory.CategoryStruct.comp r N.tp = CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (i.reflSubst a)) C) : CategoryTheory.CategoryStruct.comp (self.j a C r r_tp) N.tp = C
- comp_j {Γ Δ : Ctx} (σ : Δ ⟶ Γ) (a : CategoryTheory.yoneda.obj Γ ⟶ M.Tm) (C : CategoryTheory.yoneda.obj (i.motiveCtx a) ⟶ N.Ty) (r : CategoryTheory.yoneda.obj Γ ⟶ N.Tm) (r_tp : CategoryTheory.CategoryStruct.comp r N.tp = CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (i.reflSubst a)) C) : CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (i.motiveSubst σ a)) (self.j a C r r_tp) = self.j (CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map σ) a) (CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (i.motiveSubst σ a)) C) (CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map σ) r) ⋯
- reflSubst_j {Γ : Ctx} (a : CategoryTheory.yoneda.obj Γ ⟶ M.Tm) (C : CategoryTheory.yoneda.obj (i.motiveCtx a) ⟶ N.Ty) (r : CategoryTheory.yoneda.obj Γ ⟶ N.Tm) (r_tp : CategoryTheory.CategoryStruct.comp r N.tp = CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (i.reflSubst a)) C) : CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (i.reflSubst a)) (self.j a C r r_tp) = r
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
- i.mkJ a C r r_tp b b_tp h h_tp = CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (NaturalModel.Universe.Id'.endPtSubst a b b_tp h h_tp)) (i.j a C r r_tp)
Instances For
Typing for elimination rule J
β rule for identity types. Substituting J
with refl
gives the user-supplied value r
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.
- i : CategoryTheory.Psh Ctx
- i_isPullback : CategoryTheory.IsPullback self.i1 self.i2 M.tp ii.Id
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
- ie.comparison = ⋯.lift ii.refl (CategoryTheory.IsPullback.lift ⋯ (CategoryTheory.CategoryStruct.id M.Tm) (CategoryTheory.CategoryStruct.id M.Tm) ⋯) ⋯
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
.
Instances For
The functor part of the polynomial endofunctor iOverUvPoly
Instances For
Consider the comparison map comparison : Tm ⟶ i
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
- ie.verticalNatTrans = (CategoryTheory.UvPoly.id M.Tm).verticalNatTrans ie.iUvPoly ie.comparison ⋯
Instances For
The variable r
witnesses the motive for the case refl
,
This gives a map (a,r) : Γ ⟶ P_𝟙Tm Tm ≅ Tm × 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
- ie.equivMk a x = CategoryTheory.UvPoly.Equiv.mk' ie.iUvPoly X a ⋯ x
Instances For
Equations
- ie.equivFst pair = CategoryTheory.UvPoly.Equiv.fst ie.iUvPoly X pair
Instances For
Equations
- ie.equivSnd pair = CategoryTheory.UvPoly.Equiv.snd' ie.iUvPoly X pair ⋯
Instances For
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
.
- weakPullback : CategoryTheory.WeakPullback (ie.verticalNatTrans.app N.Tm) (ie.iFunctor.map N.tp) ((CategoryTheory.UvPoly.id M.Tm).functor.map N.tp) (ie.verticalNatTrans.app N.Ty)
Instances For
The variable r
witnesses the motive for the case refl
,
This gives a map (a,r) : Γ ⟶ P_𝟙Tm Tm ≅ Tm × Tm
where
fst ≫ r
Tm <-- Γ --------> Tm
< ‖ ‖
\ ‖ (pb) ‖ 𝟙_Tm
r \ ‖ ‖
\ ‖ ‖
\ Γ --------> Tm
a
Equations
Instances For
The variable C
is the motive for elimination,
This gives a map (a, C) : Γ ⟶ iFunctor Ty
C
Ty <-- y(motiveCtx) ----> i
| |
| | i2 ≫ k2
| |
V V
Γ --------> Tm
a
Equations
- NaturalModel.Universe.Id.motive ie a C = ie.equivMk a C
Instances For
Equations
- i.lift a C r r_tp = i.weakPullback.coherentLift (NaturalModel.Universe.Id.reflCase a r) (NaturalModel.Universe.Id.motive ie a C) ⋯
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
- i.j a C r r_tp = CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯) (ie.equivSnd (i.lift a C r r_tp))
Instances For
Typing for elimination rule J
β 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
Id
is equivalent to Id
(one half).
Instances For
Equations
- NaturalModel.Universe.Id'.motive aC = ie.equivSnd aC
Instances For
Equations
Instances For
Equations
- i.lift ar aC hrC = ie.equivMk (ie.equivFst aC) (i.j (ie.equivFst aC) (NaturalModel.Universe.Id'.motive aC) (NaturalModel.Universe.Id'.reflCase ar) ⋯)
Instances For
Equations
- One or more equations did not get rendered due to their size.