File: bug_16362.v

package info (click to toggle)
coq 9.1.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 35,964 kB
  • sloc: ml: 239,908; sh: 4,355; python: 2,985; ansic: 2,644; makefile: 874; lisp: 171; javascript: 63; xml: 24; sed: 2
file content (24 lines) | stat: -rw-r--r-- 841 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Require Corelib.Setoids.Setoid.
Export Corelib.Classes.Morphisms.
Export Corelib.Setoids.Setoid.

Axiom A : Type.
Axiom equiv : relation A.
Axiom sg_op : A -> A -> A.
Axiom mon_unit : A.
Axiom negate : A -> A.

#[export] Declare Instance sg_setoid : Equivalence equiv.
#[export] Declare Instance sg_op_proper : Proper (equiv ==> equiv ==> equiv) sg_op.
Axiom right_identity : forall x, equiv (sg_op x mon_unit) x.
Axiom left_inverse : forall x, equiv (sg_op (negate x) x) mon_unit.

#[global] Hint Rewrite @right_identity @left_inverse using apply _: group_cancellation.

(* Check that the rewrite hints are considered in the right order. *)

Goal equiv mon_unit (sg_op (negate mon_unit) mon_unit).
Proof.
rewrite_strat (try bottomup (hints group_cancellation)). (* should select left_inverse rather than right_identity *)
reflexivity.
Qed.