coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jonathan Chan <jcxz AT cs.ubc.ca>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Convertibility with η-equivalence
- Date: Tue, 28 Sep 2021 11:02:49 -0700
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jcxz AT cs.ubc.ca; spf=Pass smtp.mailfrom=jcxz AT cs.ubc.ca; spf=Pass smtp.helo=postmaster AT mail.cs.ubc.ca
- Ironport-hdrordr: A9a23:23YOE6+ddudvlCxEuypuk+C9I+orL9Y04lQ7vn2ZKCYlEfBw+PrDoB1273DJYVUqOE3I++rvBEDoexq1n6KdibN7AV7IZmjbUQWTQb1f0Q==
- Ironport-phdr: A9a23:A78YNxBnjhRtV+TKjeKUUyQUrUMY04WdBeb1wqQuh78GSKm/5ZOqZBWZua81yg6QFtiEo9t/yMPu+5j6XmIB5ZvT+FsjS7drEyE/tMMNggY7C9SEA0CoZNTjbig9AdgQHAQ9pyLzPkdaAtvxaEPPqXOu8zESBg//NQ1oLejpB4Lelcu62/6u95HJZwhEmTWxbLNwIR6rsQjfq84ajJd4JK0s0BXJuHxIe+pXxWNsO12emgv369mz8pB+7Sleouot+MFcX6r0eaQ4VqFYAy89M28p/s3rtALMQhWJ63ABT2gZiBtIAwzC7BHnQpf8tzbxu+Rh1CWGO8D9ULY5Uimg4ah2Uh/lkCgIOTA5/m/Jl8J/jqxbrhGuphNx34HZe5uaOOZicq7HYd8XX2hMU8BMXCJBGIO8aI4PAvIFM+ZfqYnyvUcOrRukCgmqGeji1D9IiWXw3aYn1OkhEx3J3QMhHt8VrHvUt8/5NLoJXu+p1qXH0S/MYupQ1Dzg54fGbgovruuQXbJsb8XR008vGhvGg1iMp4LpIi6Y2OoRvmWF8eZuW/+jh3M5pg1tvDShydshhpfUio8I113J9zh0zYc7K9CmSEB3fcOoHIdfuiyUMYZ9X80sQ2ZtuCkgy70Gv4a2fCcLyJQ7xx7fdueIf5KU7RLkUeadOSt3hHJ/d7K7gha971KgyvbmWsmvzllGti9FncfStn8T0Rzf8NKIRedl8keg3zaPzQHT5fteLUA6j6rWLYMqzL0olpcLrEjOETH6lF/rgKOKeEgo4Oml5/7lb7n7vpOQKoB5hh/kPqgzhsCyD/40PwoUU2SG5+ix1Lvu9lDjTrpQlP05iKzZvYjaJcsFoq65BBdY0oM55Ba+CzeqysgXnWIdIFJYYx2Ik5LlNE3UL/zgDPe/hUqjkCtzyvzbMbDtHI/BImXfnLrvZ7pw6lRQxQguwdxH4pJbELABIPb9Wk/rs9zYCwc0Mw6ozOfoCdRwzZ8RWXmVDq+EK6zdrUWE6f41LOWUfo8apC79K+Q55/7plXI2hVgdfbCw0ZQLbHC4A+9pLl6CYXvsh9cBCX0FshA/TOzskl2CUCRca2y8X6ImtXkHD9etCp6GTYSwipSA2j26F9tYfDNoEFeJRFXvcYyYW/4KIAmSK8kpxj4PRaqJQJRnyBul8gTznek0ZtHI8zEV4MqwnON+4PfewElaHd1cCs2c1yeGVCdplGhOTDZkhciXRGR20RGe26M+iPUKTbS7CNtCSUEnP5WaxOUoUrjP
Thanks for the detailed reply Meven! The η-conversion rule in Abel's paper looks like it could be adapted to be untyped by checking that either side is a lambda (like in the Coq manual) instead of checking the type...
Out of curiosity, how would the η laws be incorporated into α-equivalence? What were the issues you ran into?
On 2021-09-28 02:17, Meven LENNON-BERTRAND wrote:
Hello Jonathan,
[CAUTION: Non-UBC Email]
As far as I know, the theory of η-conversion in the Coq setting is quite muddy. I've been working on this recently with the people in the Gallinette team in Nantes and the MetaCoq team, so here are my two cents.
η-reduction cannot be adopted as such, because it would not respect subject reduction, as the cumulativity of product types in Coq is equivariant on domain (that is, Π x : A . B <= Π x : A' . B' when A = A' and B <= B'). Indeed, if A' < A then f : Π x : A . B |- λ x : A'. f x : Π x : A' . B (because by cumulativity x : A' |- x : A) but λ x : A' . f x ->η f and it is not the case that f : Π x : A . B |- f : Π x : A' . B. Also, it is quite an annoying rule to work with, since it is very non-local, as one has to test for variable freeness.
η-expansion also poses its own problems in the setting of Coq, notably that without types to know when to trigger it one could a priori fire it indefinitely (defeating normalization), and that generating the correct typing annotation on the variable bound by the λ is impossible (and so again this threatens subject reduction).
A third option, which is closer to what Coq does, is to not see η as a reduction in one or the other direction, but only as an equality rule, i.e. incorporate it in α-equality. But this also has some weird technical issues (again because of untyped terms).
So in the end, I am not aware of any satisfactory ways to treat η laws in the untyped CIC setting, and this is why MetaCoq still does not have η-conversion in its theory...
The only way out I see, which is how I've come to think of those rules, is that they are actually an algorithm for typed conversion, but one that does not maintain types as they are in fact not needed, since for rules η1 and η2 you only need to look at the other side to perform η expansion. In fact, those rules are very close to the ones for algorithmic conversion in Abel et al.'s Decidability of Conversion for Type Theory in Type Theory.
As for transitivity, no it does not hold directly. I guess the closest you can get is the paper above, where transitivity is proven for the typed, algorithmic system by induction on the conversion derivation – a proof that should adapt reasonably well to the untyped setting.
Best,
Meven LENNON-BERTRAND Doctorant, Équipe Gallinette – LS2N – Université de Nantes www.meven.acLe 25/09/2021 à 00:43, Jonathan Chan a écrit :Hello all,
I'm trying to determine convertibility rules for a CIC that adhere to those of Coq (untyped, with universe cumulativity), and I'm using the Coq manual on convertibility as reference.
It appears that these are the rules:Γ ⊢ e₁ ⊳* e
Γ ⊢ e₂ ⊳* e
----------- =-⊳*
Γ ⊢ e₁ = e₂Γ ⊢ e₁ ⊳* λx: t. e
Γ ⊢ e₂ ⊳* e'₂
Γ, x: t ⊢ e = e'₂ x
------------------- =-η₁
Γ ⊢ e₁ = e₂Γ ⊢ e₁ ⊳* e'₁
Γ ⊢ e₂ ⊳* λx: t. e
Γ, x: t ⊢ e'₁ x = e
------------------- =-η₂
Γ ⊢ e₁ = e₂+ congruent closure rules
I have two questions about these rules:
- Is there a source for this formulation of eta-equivalence? Some paper that uses this kind of convertibility that isn't merely citing the Coq manual?
So far I've only found papers that use the reflexive–symmetric–transitive closure of β- and η-reduction.- Does transitivity hold directly from these rules? And if so, is there some paper that states to have proven it? I'm mostly just looking for something to cite.
Jonathan
- [Coq-Club] Convertibility with η-equivalence, Jonathan Chan, 09/25/2021
- Re: [Coq-Club] Convertibility with η-equivalence, Meven LENNON-BERTRAND, 09/28/2021
- Re: [Coq-Club] Convertibility with η-equivalence, Jonathan Chan, 09/28/2021
- Re: [Coq-Club] Convertibility with η-equivalence, Meven LENNON-BERTRAND, 09/29/2021
- Re: [Coq-Club] Convertibility with η-equivalence, Jonathan Chan, 09/28/2021
- <Possible follow-up(s)>
- Re: [Coq-Club] Convertibility with η-equivalence, Thorsten Altenkirch, 09/30/2021
- Re: [Coq-Club] Convertibility with η-equivalence, nicolas tabareau, 09/30/2021
- Re: [Coq-Club] Convertibility with η-equivalence, Thorsten Altenkirch, 09/30/2021
- Re: [Coq-Club] Convertibility with η-equivalence, nicolas tabareau, 09/30/2021
- Re: [Coq-Club] Convertibility with η-equivalence, Meven LENNON-BERTRAND, 09/28/2021
Archive powered by MHonArc 2.6.19+.