From : Assia Mahboubi <Assia.Mahboubi AT inria.fr>

: Assia Mahboubi <Assia.Mahboubi AT inria.fr> To : coq-club AT inria.fr

: coq-club AT inria.fr Subject : Re: [Coq-Club] ring tactic: boolean rings and completeness when supplied with equalities

: Re: [Coq-Club] ring tactic: boolean rings and completeness when supplied with equalities Date: Tue, 19 Apr 2016 20:42:27 +0200

Dear Abhishek,sorry for this late answer.The ring tactic decides an equality by comparing the normal forms of twopolynomials, inferred respectively from the right and left hand side of theequality. By default, polynomials are in Z[X1,...,Xn] (for n sufficientlylarge), i.e. the coefficients are in Z, as this is correct in any ring.But as explained in the corresponding paper [1], another choice for thecoefficients can possibly be smarter, like in the case of rings with apositivecharacteristic (like boolean rings). You can hence tell the tactic to useratherpolynomials in Z/2Z[X1,...,Xn] in its normalization procedure, provided thatyou're able to prove that this is correct. And this will allow the tactic toprove more identities, like 1 + 1 = 0.The ring tactic hence has a syntax for that purpose: I attach a file where Imodify your example slightly, in order to use bool as (the data structure forZ/2Z which models) the type of coefficients.This will save you from adding equations of the form x + x = 0:ring_test_1 shows that they are provable and ring_test_2 provides an exampleofidentity relying on this fact.Now this does not address the problem of normalizing expressions with powers,and I do not currently have a better suggestion for using a hypothesis like xx = x. Indeed, the ring tactic is unfortunately not able to deal with symbolicring expressions involved in the powers.Yet if you only need closed instances of powers, you could implement the powerfunction as:Definition rpower (r : R) (n : N) := match n with N0 => 1 | _ => r end.and simplify your goal before calling the decision procedure.Hope this helps,assia[1] Proving Equalities in a Commutative Ring Done Right in Coq,B. Grégoire and A.M., Proceedings of TPHOLs 2005.Le 13/04/2016 21:54, Abhishek Anand a écrit :

Attachment: ring_bool.v

Description: application/save-to-disk