Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Names of bound variables of existing lemma changes

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Names of bound variables of existing lemma changes


Chronological Thread 
  • From: Ralf Jung <jung AT mpi-sws.org>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Names of bound variables of existing lemma changes
  • Date: Mon, 6 Jun 2016 18:09:08 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jung AT mpi-sws.org; spf=Pass smtp.mailfrom=jung AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
  • Ironport-phdr: 9a23:ZMwi6hT+8lFg3phMLoVjAFkr9Npsv+yvbD5Q0YIujvd0So/mwa64Zh2N2/xhgRfzUJnB7Loc0qyN4/GmBz1LsMrJmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3BPAZ4bt74BpTVx5zukbviqtuNMk4Z2HKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGfayQ6NtRrtBST8iLmod5cvxtBCFQxHcyGEbVzAsmx5GSyrY6h6yCpXstCTSs/J8nTKFJovxV79iCmfq1LtiVBK90HRPDDU+6myC0sE=

Hi Hugo,

> The "apply ... with (x:=...)" construction applies to terms. So, it is
> an "apply term with (x:=term')" construction and not an
> "apply reference with (x:=term)".

My bug is mostly about "foo (name:=bar)". So I take it this, too, takes
[foo] to be any term and not just a reference?
Indeed I expected this to be directly referring to a "Definition" or
so, which I take it is what you call a reference.

[...]

> This being said, I'll now try to address your questions.

Thanks for these explanations! I think I understand slightly better now
how all this works.

>> There is no ambiguity here, I am writing an application
>> of [foo] which only has one parameter called [P].
>
> So, to paraphrase the explanation above, there is no ambiguity either
> for Coq here. You are writing an application of "foo" which is
> interpreted as "@foo _" and which has (after application of "_"),
> parameters called "P0" and "Q0", as "Check foo" tells.

So, let me try to see if I understand. The problem here is that in [@foo
_], the "_" is an existential that *could* use the [P] from the outside.
And hence the [P] in the definition of [foo] has to be renamed, so that
the two can be told apart in the existential?

What I don't entirely understand here is that the existential is
actually quantified "outside" the [P] in [foo], i.e., the implicit [n]
is an argument occurring *before" [P]. It hence cannot refer to [P]. But
still, somehow, in this type

> forall P0 Q0 : Prop, ?n@{P:=P; Q:=Q; H:=H; H0:=H0} = 0 -> Q0 -> P0 -> Q0

the existential ends up below the [P] (now renamed to [P0]), because the
[n] is *used* there. And that's where the clash comes from? So,
essentially, the trouble is that Coq is unable to express that these two
variables called "P" are *different* variables, and hence the only way
to get the outside [P] to the inside is to rename the inner [P].

If we could write

> rename P into P0 in forall P Q0 : Prop, ?n@{P:=P0; Q:=Q; H:=H; H0:=H0} = 0
> -> Q0 -> P -> Q0

then the inner [P] would not need renaming.

But, in any case -- I can see that getting this named-argument business
right when working with any term is near impossible. I expected it to be
for references only, and that's where the clash of intuitions occurs.

Kind regards,
Ralf


  • Re: [Coq-Club] Names of bound variables of existing lemma changes, Ralf Jung, 06/06/2016

Archive powered by MHonArc 2.6.18.

Top of Page