Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] arg-min existential instantiation of an inequality

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] arg-min existential instantiation of an inequality


Chronological Thread 
  • From: Abhishek Anand <abhishek.anand.iitg AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] arg-min existential instantiation of an inequality
  • Date: Thu, 17 Mar 2016 22:16:31 -0400
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=abhishek.anand.iitg AT gmail.com; spf=Pass smtp.mailfrom=abhishek.anand.iitg AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw0-f175.google.com
  • Ironport-phdr: 9a23:1UtN8h2NmsYiEM+dsmDT+DRfVm0co7zxezQtwd8ZsegTIvad9pjvdHbS+e9qxAeQG96Lu7Qc1qGK6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6CyZzqnLzqs7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JtLVry/dKAlR/QMBzM/dmsx+cfDtB/ZTALJ6GFKAUsMlR8dKgLF7Qr6U5S5my3zsOY1jCCQPcztTb03Hz2k5qFnDh7plCgvODsw8WWRgct12vEI6Cm9rgByltaHKLqeM+BzK/vQ

The function get_arg_min should be easy to define. However, your use of dependent pairs may cause some trouble.
You may have to prove that all proofs of m < n are equal, to ensure that f and g do not base their decisions merely on difference in the proof parts of their inputs.
Without axioms, proving this may be tricky at best, or may not even hold. There are workarounds, if you are interested.

So, you can instead have f and g be of type nat - > nat. You can instead modify your lemma minimal_exists to express that you are only interested in inputs smaller than some number.
With these hints, and maybe after reading the first 5 or more chapters of Software Foundations , you should be able to write this function and prove its correctness.
If not, please ask.

I am not sure what you meant by "how to transform this (function) into a lemma".
Here is an example of how a function (Z.opp) and its correctness proof (Z.add_opp_diag_r) can be used in a proof:

Require Import ZArith.
Open Scope Z_scope.

Lemma add_inv_exists_Z : forall a:Z, exists b:Z, a + b = 0.
Proof.
  intro. exists (Z.opp a).
SearchAbout (?x + (Z.opp ?x) = 0).  
  apply Z.add_opp_diag_r.
Qed.




On Wed, Mar 16, 2016 at 1:05 PM, David Asher <asher AT informatik.hu-berlin.de> wrote:


On 03/16/2016 05:21 PM, Abhishek Anand wrote:
Your functions f and g have a finite domain. So you can write down a recursive function that computes f and g for all possible inputs and gives you the input you are after.

-- Abhishek
http://www.cs.cornell.edu/~aa755/ <http://www.cs.cornell.edu/%7Eaa755/>
Thank you for the hint. So you mean something like this?

Fixpoint get_arg_min
  (n : nat)
  (f : {m : nat | m < n} -> nat)
  (g : {m : nat | m < n} -> nat) : list (nat * nat) :=
match n with
| O    => nil
| S n' => ??
end.

And afterwards filtering applying two filters one that extracts the pairs, where left is smaller than the right and a filter that extracts the pair with the maximal left value? I see the point but I'm clueless, though, how to transform this into a lemma.

David.




Archive powered by MHonArc 2.6.18.

Top of Page