Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Eliminating equalities over dependent function types

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Eliminating equalities over dependent function types


Chronological Thread 
  • From: Pierre-Marie Pédrot <pierre-marie.pedrot AT inria.fr>
  • To: Grant Jurgensen <mailing-lists.coq AT grant.jurgensen.dev>, coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Eliminating equalities over dependent function types
  • Date: Wed, 3 Nov 2021 20:01:18 +0100
  • Ironport-data: A9a23:I1JzXa1PlGEiLJbh2PbD5Qxzkn2cJEfYwER7XOPLsXnJ0WhxgjxSz2JLDz3SP/iMNGajfop2PY7g9EgCupWGzN42QQE+nZ1PZyIT+JCdXbx1DW+pYnjMdpWbJK5fAnR3huDodKjYdVeB4EfyWlTdhSMkj/jRH+KnULWs1h1ZHmeIdg9w0HqPpMZp2uaEsfDha++8kYuaT//3YDdJ6BYoWo4g0J9vnTs01BjEVJz0iXRlDRxDlAe2e3D4l/vzL4npR5fzatE88uJX24/+IL+FEmPxp3/BC/uWy+ehNBRUEviLe1HT008+t6qK00EE/3JulPtlcqNGMC+7iB3Q9zx14M1MuIaqREIsN7fNlaIFXhVCFD1WPKtc+baBL2LXXcm7lh2ZLyGynZ2CC2lzZ+X04N1fBGhP8f0eJ3UJbwufnKS9x6uTRfNlgNhlLtTxM44ZoXxmiz3UE54OSpfaBq7O+NVwxyY1nskIHPDEZsNfZyAHUfhqS3WjIX9GUddnwrvt2ye6KmcB7kmIr7Fx+3LU3AV9lr7gLLLolhWxbZ09ti6lSqjupQwV2i0nCeE=
  • Ironport-hdrordr: A9a23:Db3jsqNmi5ukxcBcTu2jsMiBIKoaSvp037BN7TELdfU1SL36qynApoV86faZslcssXwb8uxoW5PwI080l6QFhbX5VI3KNGSL11dARLsSiLcKqAePJ8SRzI5g/JYlXYw7MtH7EUN7kNaS2njBLz8n+rO6GOvBv5a4858oJjsaEp1d0w==

On 03/11/2021 18:23, Grant Jurgensen wrote:
> I was under the impression that equality only followed from cardinality
> in HoTT.

That's true for hSets but it breaks when you have higher structure.

> Wouldn't a more "traditional" view on type equality identify
> types with their inhabitants, and therefore suggest `nat -> bool` and
> `nat -> nat` to be unequal? Or am I misunderstanding something?

Ironically, types in type theory are very amorphous. They just need to
classify the kind of objects you're talking about and that's it. Since
you have essentially no way to inspect them in CIC there is a lot of
moving parts in the semantics of types, especially regarding equality.

A syntactic equality on types would indeed prove that the two above
types are distinct. Since my last post I convinced myself that if you
pick the types-as-codes model (i.e. Type is represented by a
inductive-recursive definition encoding the possible type former) then
your theorem holds. Indeed, in the model

(forall x : A, B) := code_pi A (fun x => B)

so you get injectivity of type formers by no-confusion of constructors.
But this is a very, very specific model that also induces a lot of
properties you probably don't want, e.g. it utterly destroys
parametricity. You can now inspect an abstract type at runtime and do
things by case analysis on its shape.

> Still, I take your point that type equality is quite under-specified in
> CIC and therefore open to many possible models and interpretation. I'm
> not sure its worth adding any fact axiomatically unless one is prepared
> to take a strong philosophical stance on the meaning of type equality.

I don't think that there is anything philosophical in this discussion,
it's a matter of (programming) language design. If you live in a
univalent world, you have a lot of invariants that come for free but you
are more constrained. If you live in the types-as-codes world, you now
got a dependently-typed variant of (a better behaved) Python.

PMP

Attachment: OpenPGP_signature
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.19+.

Top of Page