• No results found

the relationship between ! and

Chapter 5 Equality and Object-Level Unification

5.1.5 the relationship between ! and

Having argued for the practicality of using instead of

when working with depen- dent types, I nonetheless feel obliged to point out that the two are equivalent—provided we mean

equipped withg*:›yg;A¥y> . Let me now give the mutual construction. First,

the easy direction:

CONSTRUCTION: c from

This is so easy that I will just tell you the answers—by construction,

is just telescopic equation for telescopes of length b

. † ‡ Y ç D LMNPORQ Y  ð D ç  ² DeE ç D LMNPORQ E ÂX ð D ç O † >< ‡ > DeE ç D LMNPOQ E  D ç ÂEÂ † g)(c¥ £ =?h ‡ >;*(c¥ £ =?h K DeE ç D LMNPORQ E  D ç EjC D ç ƒ LMNPORQ E { DFC  E•² D ç E Ž D  ² C ² † g):›yg;A¥y> ‡ >;*:›yg;A¥y> K DeE ç D LMNPORQ E  D ç EjC D   ƒ«LMNPORQ E { DFC ™ >< ÂHŸ E Ž D · C Ž

Furthermore, the reduction behaviour for g)(c¥

£

=Bh and g):›yg;A¥y> is ex-

actly that for>;)(c¥

£ =?h K and>;):›yg;A¥y> K .

The other direction is the interesting one.

CONSTRUCTION: from c withdfehgjid!kmln

Let us assume we have

XR D}E D LMNPORQ E  D ç EpoàD LMNPORQ E ð D]o O X > D}E ç D LMNPORQ E  D ç   XM>;A§Šfg¨ D}E ç D LMNPOQ E  D ç EjC D}E ÂEC Dç J  ÂC ƒ«LMNPORQ E { DFC ÂK™ > ÂHŸ E  C D ç E Ž D   C C  C D

Let us first make a little abbreviation:

kl>ff ‡,+ ú ç D LMNPORQJ ç

kl>ff packages up a typed term. The idea is that is just

fork>ffs: † ‡ Y ç D LMNPORQ Y  D ç Y oàD LMNPORQ Y–ð DNo üç x1 ý üo x ð¦ý † > ‡ Y ç D LMNPORQ Y  D ç >< üç x1 ý

This makes the elimination rule

XM>;A§Šfg¨ D}E ç D LMNPOQ E  D ç EjC D}E•²cD ç E Ž DHü ç x ý ü ç x ² ý LMNPOQ E { DFC ÂK™ >' ü ç x1 ý Ÿ E•² D ç E Ž Drüç x1 ý üç x ² ý Cn² Ž

If we could only deduceÂ

²

fromŽ

, we would be most of the way there. For that, we need a proof that equal cells have equal second projections.

The equivalence of g):›yg;4¥¦> and equality of second projections from

dependent pairs is folklore knowledge, but I shall do the work nonetheless.

It is even difficult to state the equality of the second projections, because they are not of convertible types—we must use the substitutivity of equal- ity to make a type coercion.

The lemma we need is as shown. Let us claim it globally and work on the main goal. Observe that W ¶q ñVr Ž DsE ’ Dç ç J ™ “’~” П7 ² X<W ¶q ñLr DVE ç  Ay²cD kl>ff E Ž D ç  Ay² ç “ ç –” Ay² “ A ² ” E ’ D ç A ™ “’~” ÂHŸ7 ² so that W ¶q ñLr Ž:™ >' ç Ÿ D  ²

Let us exploit this discovery. Introducing all the hypotheses, this is the goal we now must solve. † SMð ‡ W ¶q ñLr Ž:™ > ç Ÿ D  ² X<Q·ñXS'T DºCn² Ž As the type ofŽ contains² , it is wise to reabstract it:

We may now eliminate SMð by g)(c¥ £ =Bh. †  ² ‡ W ¶q ñLr Ž(™ >< ç Ÿ ÂE ² XRQ·ñ?S'T C DeE Ž C D~üç x1 ý üç x ² ý C ² Ž C † Q·ñ?S'T D Q·ñ?S'T C Ž NowŽ C is a reflexive equation!

We may eliminate it byg):›yg;4¥¦> .

X<W ¹ ð Q·ñXS'T D}E ŽC D~üç x1 ý üç x1 ý C Â4Ž C

The subgoal we acquire follows from{ . XNsutvtxw¬òXs7S'yNw DFC ÂK™ >–v9z ü ç x ý Ÿ

All that remains is to prove W ¶q

ñLr. Firstly, we eliminate the equation on

the cells,Ž

withg)(c¥

£

Although the two pairs unpacked by the bind- ing sugar are the same, we have two names for each projection. We can clear this up by elimi- natingç

Â

, reducing the projections and cutting the sugared † -bindings. X<WS't{w DE ç  D kl>ff ç ÂR“ ç ¬” ç ÂR“ A ² ” E ’ D ç A ™ “’~” П7 ²

Now we may useg*:›yg;A¥y> to remove the reflex-

ive’ . X*ñ ¶ w[| D}E ç D LMNPORQ E  D ç E ’ D ç ç ™ “’~” ÂHŸ7·Â

The remaining subgoal has exactly the type of >' ! X q w} DVE ç D LMNPORQ E ç D Â ÂÚÂ

As far as reduction behaviour is concerned, first observe that

W ¶q ñLr ™ >' üç x ý Ÿ™ > ç Ÿ ÿ ‡ ™ >< П This is because W ¶q

ñLr eliminates in succession the first equation, the cell,

then the second equation, and all three are in constructor form. Conse- quently, when >;A§pfg¨ is applied to

™

> ÂHŸ

, the computed equality proof

SMð turns out to be

™

> П

. Since both these equations are reflexive, both theg)(c¥

£

=?h andg):›yg;4¥¦> steps reduce as required.