Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] : Lexicographic order well foundedness

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] : Lexicographic order well foundedness


Chronological Thread 
  • From: Castéran Pierre <pierre.casteran AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] : Lexicographic order well foundedness
  • Date: Thu, 26 Aug 2021 08:49:48 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=pierre.casteran AT gmail.com; spf=Pass smtp.mailfrom=pierre.casteran AT gmail.com; spf=None smtp.helo=postmaster AT mail-wr1-f42.google.com
  • Ironport-hdrordr: A9a23:cbIYR60Zviwfioyr4Wu8KAqjBIUkLtp133Aq2lEZdPU1SL37qynKpp4mPHDP+VEssR0b6LO90ey7MAvhHOBOkPIs1MaZLWzbUQKTRekIjbcKgQeQfREWntQ96U4KSdkbNDSfNykCsS842mWF+hQbreVvPJrGuQ6n9QYWceiiUc9d0zs=
  • Ironport-phdr: A9a23:2xOcWR+AGt0T5P9uWay8ngc9DxPPW53KNwIYoqAql6hJOvz6uci4ZAqOvL4w0xfgZsby07p8ke3YsqTtCyQrwK2qlzQ8SqFKTAIPks4MngYtU4avAEz/K+P2PWRhRJwRHFBq8GumPkdLBc3we0PdomGo7T4VBx7zKRd5Kv76F4LMk8i7zeS/94DcbwhIhje2fK9/IgixoQjNrMcdnJFsKrw2yhvHo3tIf/pZyGZ1Ll+NnBjy+9m98od7/ytfp/wu+chAUb7nf6sjVrxXEC4mM2Eu68L1sxTIUBaC6WEdUmUSlRpIHhTF4RTnVZr/rif2quxw0zScMMbrT747RC6i4r9rRhD0hygJKjA38G/JhMNyj6xVpwmsqAZjz47ReoyVNOZyc6HbcNgHRWRBRMFRVylZD46idYQPFPYBOvxCr4bnoVsBtQGwBQiyC+P10D9HmGL90Koi0+QgDw7GxhYgEMwUvHvIttr1L7sSXv6vzKbSyzXOdPxW2TLn54jJdhAtu+2DXbV1ccfIz0QkCgzKgEmKp4P/IzOVyvoCs3Kd7+d4Wuyij3Iqpxx/rDahyMohlIjEiIIXx13G9Sh3zps5KN22RUN0fNKoDodcui+UOYV2Qs0vX29ltTo6x7MIpZO2YC4Hw4kpyR7YbvyIaYmI4hT7WemLOzd4hW5leLKlixe8/0itzPD3WMqs0FtSsCZJjt3BumoO2hHT8MSLVOVx8lq71TuAyQzf8v9ILloomabGLpMu3qU/mocXvEnGHCL5g0X7gaqYe0o65uSk9+HqYrv7qZKYN4J5jwLzPb8ylsG7BOk1PBUCUHaU9Om5yLLu+UP0TKhMg/YriKfWqoraKt4epqOhAw9azIIj6xGnAjejytsYnH0HIEtLeRKdkoTlIl/OLf/mAfuljFSslzBrx//CPrL/GJnCMn/DkLL5cbZ87U5T1hYzwMhB655IDrwNOvH+V0/ruNDGEBM1Lha4zun5BNll04MRQ2OPAquXMKPItl+I4/oiI/GNZIALojb9MeYq6+TygnAjgl8dYbem3YENZ3C+BflmLECZbmDtgtcFC2sFog0+TOnyhF2YTTFTf2qyX7475jwjFI2mCp7DSpmxj7yFwSe0BYZbZntGC1CJCXfnbZ+IW/YKaCKII89uiCYIVba7S9xp6Rb7vwjjjrFjM+D8+ysCtJul2sImyffUkEQZ/Cdojt6U1Va1TmxuhG5AEyc30bplrAp2w0yf3LJxhdRXENVS47VCVQJsZs2U9PBzF92nAlGJRdyOUlvzGr1O7hk+S9swx5kFZEMvQr1KbzjG1iuuRqAPzvmFWMZy/aXb0Hz8Yc16ziSevEHEp1YjS8pLc2ahg/wnnzU=

Hi,

  You will probably have to require also Relations.Operators_Properties (where well-roundedness of the lexicographic product of two wfs is proved).

  AFAIK, Relation_Operators defines the lexicographic product as a relation on dependent pairs. If you are not familiar with this kind of data, it may be useful to work with a simpler definition (i.e. of type relation (A * B).  If you are interested, I may send you such definitions.

Pierre




Le 26 août 2021 à 02:49, Jasper Hugunin <jasper AT hugunin.net> a écrit :

The simple answer is that you want lexprod (Lexicographic order) rather than symprod (Symmetric product), defined in Relations.Relation_Operators.
lexprod has the definition you expect.

Best,
- Jasper Hugunin

On Wed, Aug 25, 2021 at 5:22 PM Wendlasida Ouedraogo <ouedraogo.tertius AT gmail.com> wrote:
Dear List, I am trying to write some functions in coq whose termination proofs use lexicographic order. My minimized problem is :
-------------------------
Require Import FunInd.
Require Import Recdef Coq.Arith.Wf_nat ZArith Coq.ZArith.Zwf Omega.
Require Import Relations.Relation_Operators.

Function test (x: string * nat) {wf (symprod string nat (ltof string length) (ltof nat (fun id => id)) ) x} :=
match x with
| (EmptyString, 0) => 0
| (EmptyString, S n) => test (EmptyString, n)
| ((String a s), n) => test (s, n + 1)
end.

---------------
I cannot prove that the function terminates. It seems that the problem is due to the fact that in Relations.Relation_Operators.v, symprod is defined like following:

Inductive symprod : A * B -> A * B -> Prop :=
| left_sym :
  forall x x':A, leA x x' -> forall y:B, symprod (x, y) (x', y)
| right_sym :
  forall y y':B, leB y y' -> forall x:A, symprod (x, y) (x, y').

instead of :

Inductive symprod : A * B -> A * B -> Prop :=
| left_sym :
  forall x x':A, leA x x' -> forall y y':B, symprod (x, y) (x', y')
| right_sym :
  forall y y':B, leB y y' -> forall x:A, symprod (x, y) (x, y').

-------------------
Any ideas ? 
--
Regards,
M. Wendlasida OUEDRAOGO                                                        




Archive powered by MHonArc 2.6.19+.

Top of Page