1.12.2 Equivalence of path induction and based path induction

The two induction principles for the identity type introduced above are equivalent.
It is easy to see that path induction follows from the based path induction principle.
Indeed, let us assume the premises of path induction:

C

:∏x,y:A(x=Ay)→𝒰,

c

:∏x:AC⁢(x,x,𝗋𝖾𝖿𝗅x).

Now, given an elementx:A, we can instantiate both of the above, obtaining

C′

:∏y:A(x=Ay)→𝒰,

C′

:≡C(x),

c′

:C′⁢(x,𝗋𝖾𝖿𝗅x),

c′

:≡c(x).

Clearly, C′ and c′ match the premises of based path induction and hence we can construct

g:∏(y:A)∏(p:x=y)C′⁢(y,p)

with the defining equality

g(x,𝗋𝖾𝖿𝗅x):≡c′.

Now we observe that g’s codomain is equal to C⁢(x,y,p).
Thus, discharging our assumptionx:A, we can derive a function

f:∏(x,y:A)∏(p:x=Ay)C⁢(x,y,p)

with the required judgmental equality f(x,x,𝗋𝖾𝖿𝗅x)≡g(x,𝗋𝖾𝖿𝗅x):≡c′:≡c(x).

Another proof of this fact is to observe that any such f can be obtained as an instance of 𝗂𝗇𝖽=A′
so it suffices to define 𝗂𝗇𝖽=A in terms of 𝗂𝗇𝖽=A′ as

𝗂𝗇𝖽=A(C,c,x,y,p):≡𝗂𝗇𝖽=A′(x,C(x),c(x),y,p).

The other direction is a bit trickier; it is not clear how we can use a particular instance of path induction to derive a particular instance of
based path induction. What we can do instead is to construct one instance of path induction which shows
all possible instantiations of based path induction at once.
Define

D

:∏x,y:A(x=Ay)→𝒰,

D⁢(x,y,p)

:≡∏C:∏(z:A)(x=Az)→𝒰C(x,𝗋𝖾𝖿𝗅x)→C(y,p).

Then we can construct the function

d

:∏x:AD⁢(x,x,𝗋𝖾𝖿𝗅x),

d

:≡λx.λC.λ(c:C(x,𝗋𝖾𝖿𝗅x)).c

and hence using path induction obtain

f:∏(x,y:A)∏(p:x=Ay)D⁢(x,y,p)

with f(x,x,𝗋𝖾𝖿𝗅x):≡d(x). Unfolding the definition of D, we can expand the type of f:

f:∏(x,y:A)∏(p:x=Ay)∏(C:∏(z:A)(x=Az)→𝒰)C⁢(x,𝗋𝖾𝖿𝗅x)→C⁢(y,p).

Now given x:A and p:a=Ax, we can derive the conclusion of based path induction:

f⁢(a,x,p,C,c):C⁢(x,p).

Notice that we also obtain the correct definitional equality.

Another proof is to observe that any use of based path induction is an instance of 𝗂𝗇𝖽=A′ and to define

Note that the construction given above uses universes. That is, if we want to
model 𝗂𝗇𝖽=A′ with C:∏(x:A)(a=Ax)→𝒰i, we need
to use 𝗂𝗇𝖽=A with

D:∏x,y:A(x=Ay)→𝒰i+1

since D quantifies over all C of the given type. While this is
compatible with our definition of universes, it is also possible to
derive 𝗂𝗇𝖽=A′ without using universes: we can show that 𝗂𝗇𝖽=A entails Lemma 1 (http://planetmath.org/23typefamiliesarefibrations#Thmlem1),Lemma 3.11.8 (http://planetmath.org/311contractibility#Thmprelem5), and that these two principles imply 𝗂𝗇𝖽=A′ directly.
We leave the details to the reader as http://planetmath.org/node/87560Exercise 1.7.

We can use either of the foregoing formulations of identity types
to establish that equality is an equivalence relation, that every function preserves equality and that every family respects equality. We leave the details to the next chapter, where this will be derived and explained in the context of homotopy type theory.