Subject: Ssreflect Users Discussion List
List archive
- From: François Pottier <>
- To:
- Subject: [ssreflect] Rewriting with inequalities?
- Date: Thu, 18 Feb 2016 10:11:13 +0100
Hello again, with another beginner question.
In standard Coq, provided one has declared appropriate instances of the type
class Proper, one can rewrite with an inequality (in fact, with an arbitrary
relation). In ssreflect, I don't know how to make this work (see attached file
for an example).
If it can be made to work, will it be compatible with ssreflect's improved
"rewrite" tactic? e.g. can one select which occurrence should be rewritten,
chain rewrites, etc.?
Thanks for your help!
--
François Pottier
http://gallium.inria.fr/~fpottier/
Require Import Coq.Program.Basics. (* [flip] *)
Require Export Coq.Setoids.Setoid. (* required for [rewrite] *)
Require Export Coq.Classes.Morphisms.
Require Import Omega.
Obligation Tactic := idtac.
(* Addition is covariant in both arguments. *)
Program Instance proper_plus: Proper (le ++> le ++> le) plus.
Next Obligation.
intros x1 y1 h1 x2 y2 h2. omega.
Qed.
Goal
forall x y,
x <= y ->
x + 1 <= y + 1.
Proof.
intros x y h.
rewrite h.
apply le_refl.
Qed.
Require Import ssreflect ssrfun ssrbool eqtype ssrnat.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Goal
forall x y,
x <= y ->
x + 1 <= y + 1.
Proof.
move => x y h.
rewrite h.
apply le_refl.
Qed.
- [ssreflect] Rewriting with inequalities?, François Pottier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, Enrico Tassi, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, François Pottier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, Laurent Thery, 02/18/2016
- RE: [ssreflect] Rewriting with inequalities?, Georges Gonthier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, François Pottier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, Christian Doczkal, 02/18/2016
- RE: [ssreflect] Rewriting with inequalities?, Georges Gonthier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, François Pottier, 02/18/2016
- RE: [ssreflect] Rewriting with inequalities?, Georges Gonthier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, Christian Doczkal, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, François Pottier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, François Pottier, 02/18/2016
- Re: [ssreflect] Rewriting with inequalities?, Enrico Tassi, 02/18/2016
Archive powered by MHonArc 2.6.18.