Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Is this provable? (I'll give you credit and beer/dessert)

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Is this provable? (I'll give you credit and beer/dessert)


Chronological Thread 
  • From: Gaëtan Gilbert <gaetan.gilbert AT skyskimmer.net>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Is this provable? (I'll give you credit and beer/dessert)
  • Date: Sat, 10 Oct 2020 10:59:53 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT skyskimmer.net; spf=Pass smtp.mailfrom=gaetan.gilbert AT skyskimmer.net; spf=None smtp.helo=postmaster AT relay10.mail.gandi.net
  • Ironport-phdr: 9a23:6Kxe+x0Du/O+iOAVsmDT+DRfVm0co7zxezQtwd8ZseIRL/ad9pjvdHbS+e9qxAeQG9mCtLQZ0KGO7OjJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVhjexe7N/IRu5oQnNtMQdnJdvJLs2xhbVuHVDZv5YxXlvJVKdnhb84tm/8Zt++ClOuPwv6tBNX7zic6s3UbJXAjImM3so5MLwrhnMURGP5noHXWoIlBdDHhXI4wv7Xpf1tSv6q/Z91SyHNsD4Ubw4RTKv5LptRRT1iikIKiQ5/XnKhMJugqJVoBGvqRJxzIHbYo6aKOFzfqbBcd4AX2dNQshcWi5HD4ihb4UPFe0BPeNAoof8vVQJsQe+ChOqBOz3yzFIh3v20rYk3OQ7DQHNwQstH90Uv3vKsNX6LqESXfq6zKnJyTXMdO1Z2S3h6IXTaRAhovGNXalzccrQzEkvEh3Kjk+KpYzjITyVyv0Avm6G5OVvSeyhkXQoqx1tojex3McsjJHEip8JxlzZ+ih0wYc4KcO5RUB0Y9OqHoZcuiOaOoZ1Qs0vTX9ltSUkxrAJuJO2YSkHxYo7yhDfdvCKb4eF7BLjWuuXPDx2h2pldaqhixqv80Ws0O/xWtWu3FpXrCdIkcPAum4D2hDP8sSLVOZx80m71TqS1w3f9PtILV01mKbFMZIsxrE9m5wOukrZBCD2gl/5jKqOe0Uk5Oeo7+Pnb638ppCCM497kAH/PrkylsClBOQ3KAkOX2yB9eSzzrLj+1D2QLRQgv0wjKbZrIjWJcUdpqGnHw9Yypgv5wu9Aju80tkUgWMLIE9HdR+ElYTlJV/DLOzgAfe6mVuskTNrx/7cPr3mB5XANnfDn63/crZh8UFczhA/zd9e55JQEb4OPujzWlPqudzDDR84Mxe0w+XmCNV404MRR3iPDrWfMKzMrV+E/vgvLPWUZI8JpDb9LOAo6OLpjX8ggFMSYa2p3YYMZ32jBfRnI0CZYWL2jdsbEGcKuBA+TO3wh1GYXz5TfSX6Y6Vp7TYiTYmiEI3rR4a3gbXH0j3oMIdRYzVpA9OQGHHfWISAUfoWdGrGLcZsjjUCE7egT4Uszw2Grwzr0LlmK+/Z4GseuI61h4s93PHaiRxnrW88NM+ayWzYFzgpzFNNfCc/2eVEmWI4ylqH1vIk0eZVEdVCvqsPVw47MdjTxup2Cpb0Vx6TJo7YGmbjec2vBHQKdvx0xtYPZ0hnHND70ELY3DuxAL4QkrGRQpo57vCFhiSjF4NG03/DkZIZoRw+WMIWaz+9hb9k9AnWAoPT1UOUi/TyeA==

It's proved. HoTT is the only place I know to get lemmas about equality from
so that's what I used, but this is axiom less so can be done without HoTT too.

Thought process:
- eq_rect is complicated, let's turn it into transport to simplify the goal
this worked but is not actually useful in the end
- maybe there's a fancy destruct which will work (simple proofs about
equality are all about the well chosen destruct)
this went nowhere fast
- maybe I can construct a counterexample using univalence on boolean negation
obviously this couldn't work
- this looks like the incomplete IsEquiv from HoTT where we can construct
some fancy equality proofs to get the full IsEquiv stuff
let's look at the construction to see if I get any ideas
a bit of messing about then leads to the solution

Gaëtan Gilbert

On 10/10/2020 08:11, Talia Ringer wrote:
Hello friends,

I got nerd sniped this morning on a proof task I've been at for like 11
hours. Most of the proof obligations are done now, but I ended up stuck at
one particular proof obligation that I'm not sure how to solve, or if it is
solvable in general. But also I need to work on job applications and normal
last year of grad school things, and I haven't eaten dinner. So if you help
me out with this one proof obligation, I'll give you appropriate credit and
also get you a beer or dessert.

For real. I don't have technical mentors or local expertise to consult.

Essentially, I have two types:

A : Type

B : Type

that are equivalent:

f : A -> B

g : B -> A
section : forall a, g (f a) = a.
retraction : forall b, f (g b) = b.


I know literally nothing else about my types or my equivalence. *I want to
know if it is possible to solve this proof obligation:*

*P : B -> Type
a : A
f0 : forall a : A, P (f a)
______________________________________(1/1)
eq_rect (f (g (f a))) P (f0 (g (f a))) (f a) (retraction (f a)) = f0 a*


(I have already solved this proof obligation:

a : A
______________________________________(1/1)
eq_rect (f (g (f a))) (fun _ : B => A) (g (f a)) (f a) (retraction (f a))
= a

Literally just "rewrite retraction. apply section." works. But that didn't
help me, and I also couldn't get Coq to use the same tactics.)

I can't figure out whether this is me being really bad at equalities of
equalities and dependent rewrites, or whether there is something we must know
about A, B, or our equivalence for this to hold, or whether there is an
additional axiom we must assume for this to hold in general. And it's 11:00
PM and I haven't eaten dinner, so time to ask you all:

* Is this provable? If so, how? (And why am I so bad at equalities of
equalities?)
* If it is not, can you explain why?
* Is there anything I could assume about A and B to make it provable?
* Is there anything I could assume about f, g, section, or retraction to
make it provable?

Hopefully someone else finds this fun, too. Or really likes beer.

Talia



From HoTT Require Import Basics.Overture Basics.PathGroupoids.

Section S.
  Context
    (A : Type)
    (B : Type)
    (f : A -> B)
    (g : B -> A)
    (section : forall a, g (f a) = a)
    (retraction : forall b, f (g b) = b).

  (* Taken from https://github.com/HoTT/HoTT/blob/1977b2be2ff7d8eaee8ffc2687c94acfe0d498d1/theories/Basics/Equivalences.v#L130
     They're Let in a section so we have to redefine them. *)
  Definition section' x :=
    ap g (ap f (section x)^)  @  ap g (retraction (f x))  @  section x.

  Lemma is_adjoint' (a : A) : retraction (f a) = ap f (section' a).
  Proof.
    unfold section'.
    apply moveR_M1.
    repeat rewrite ap_pp, concat_p_pp; rewrite <- ap_compose.
    rewrite (concat_pA1 (fun b => (retraction b)^) (ap f (section a)^)).
    repeat rewrite concat_pp_p; rewrite ap_V; apply moveL_Vp; rewrite concat_p1.
    rewrite concat_p_pp, <- ap_compose.
    rewrite (concat_pA1 (fun b => (retraction b)^) (retraction (f a))).
    rewrite concat_pV, concat_1p; reflexivity.
  Qed.

  Lemma bla (P : B -> Type) (a : A) (F : forall a, P (f a))
    : paths_rect _ (f (g (f a))) (fun a _ => P a) (F (g (f a))) (f a) (retraction (f a)) = F a.
  Proof.
    change (transport P (retraction (f a)) (F (g (f a))) = F a).
    rewrite is_adjoint'.
    destruct (section' a).
    reflexivity.
  Qed.
End S.
Print Assumptions bla.
(* Closed under the global context: not dependent on funext / univalence *)



Archive powered by MHonArc 2.6.19+.

Top of Page