Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] More than one ring structure (e.g. modulo ring) for one type

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] More than one ring structure (e.g. modulo ring) for one type


Chronological Thread 
  • From: e AT x80.org (Emilio Jesús Gallego Arias)
  • To: "Soegtrop\, Michael" <michael.soegtrop AT intel.com>
  • Cc: "coq-club\@inria.fr" <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] More than one ring structure (e.g. modulo ring) for one type
  • Date: Mon, 17 Jul 2017 12:50:58 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=e AT x80.org; spf=Pass smtp.mailfrom=e AT x80.org; spf=Pass smtp.helo=postmaster AT x80.org
  • Ironport-phdr: 9a23:sJgi2xx8I67TuT7XCy+O+j09IxM/srCxBDY+r6Qd1OwVIJqq85mqBkHD//Il1AaPBtSEraocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze6/9pnRbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiScIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CRWRPQNtfVytPAo2ybYQBDOQOMulEoITmu1sCsQGzCRWwCO71yDJFgGL9060g0+QmFAHLxBIvEskBsXnXsNn5LqASUfq6zKLVyTnNYPZW2Tb56IjJdRAqvPWCUqxrcdLL0kkkCgLLgU+UqYzhITyV2eMNuHWH4up6VOKgkXUnpwR3rzOyxckskpHEip8Wx13H7yl13pg5KNyiREJmY9OoDYFcuzyUOodoWs8uXmVltSYgxrAFt5O3ZjUGxIklyhLFdfCKc4eF7xT+X+iLOzh4nmhqeLenihay70egzur8W9G70VtJsiZJiN7MtmoC1xDL68iHTOVy/lu51DqS1A3e6ftILV4qmafaMZIt37w9mocJvUjeECL6hl36jKqMeUUl/uio5f7nYrLjppKEKYB5kQ7/P6cylsClBuQ4KAcOU3CB+eugzL3j4VH5QLJSg/IqlanZqYnWKtgfpq6kGABYyZ0j6ha6Dze+ytsUh3gHLFRfeBKGlYflIV/OIOqrRcu41h6Xlzpk2+rBJomlSrDMJXjKnbOrNeJ46kVcwQc3i8tY6p1IELYZCPP1RkL18tffC0lqHRazxrPqIMUtjsUZQ23HQoKcMafTtheq6/m9OKGjbYsRtTn6Y9E/5vf1zCxq0WQBdLWkiMNEIEuzGe5rdgDAOSLh
  • Organization: X80 Heavy Industries

Dear Michael,

"Soegtrop, Michael"
<michael.soegtrop AT intel.com>
writes:

> I wanted to use the ring tactic in proofs of pretty much what you
> describe (various variants of standard library CycliyType), so to use
> it in this way I would have to define an intermediate type just for
> the proofs, which is not so convenient.
>
> So I either have to redefine the ring tactic from time to time or
> extend it to take an options ring structure name.

Of course making the tactic more flexible would be great.

Note that a more cumbersome solution if you really want to use the same
type is to scope the ring declaration inside a module. Example:

#+BEGIN_SRC coq
From Coq Require Import Reals.

Variables (T : Type).
Variables (z1 o1 z2 o2 : T).
Variables (a1 m1 a2 m2 : T -> T -> T).

Definition rm1 : semi_ring_theory z1 o1 a1 m1 eq.
Admitted.

Definition rm2 : semi_ring_theory z2 o2 a2 m2 eq.
Admitted.

Module M1.

Add Ring rm1 : rm1.

Lemma t1 : a1 z1 o1 = o1.
Proof. ring. Qed.

End M1.

Module M2.

Add Ring rm2 : rm2.

Lemma t2 : a2 z2 o2 = o2.
Proof. ring. Qed.

End M2.
#+END_SRC

But note that you will have to alias the lemmas declared inside the
modules as opening them should (*) bring the ring declaration back.

Best,
E.

(*) Actually it may be more complicated than that.



Archive powered by MHonArc 2.6.18.

Top of Page