Created
April 2, 2020 11:14
-
-
Save Blaisorblade/990d4ef7418bcbbc0f329dedee5c7b93 to your computer and use it in GitHub Desktop.
Trying out herbelin's suggestion in https://github.com/coq/coq/issues/11998#issuecomment-607773624
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From mathcomp Require Import ssreflect ssrnat eqtype ssrbool ssrnum ssralg. | |
Require Import Ring. | |
Import GRing.Theory. | |
Open Scope ring_scope. | |
Section foo. | |
(* Variant of the same problem. *) | |
(* Variable R: numFieldType. *) | |
Variable R: comRingType. | |
Locate "+". | |
Lemma check_defeq: GRing.Zmodule.sort R = GRing.ComRing.sort R. done. Qed. | |
Locate "+%R". | |
Check +%R. | |
(* Definition addT : R -> R -> R := +%R. | |
Local Infix "+" := addT. *) | |
Definition rt : | |
(* @ring_theory (GRing.ComRing.sort R) 0%:R 1%:R addT *%R (fun a b => a - b) -%R eq. *) | |
@ring_theory (GRing.Zmodule.sort R) 0%:R 1%:R +%R *%R (fun a b => a - b) -%R eq. | |
(* Doesn't work.*) | |
(* @ring_theory R 0%:R 1%:R +%R *%R (fun a b => a - b) -%R eq. *) | |
(* Works. *) | |
(* @ring_theory R 0%:R 1%:R addT *%R (fun a b => a - b) -%R eq. *) | |
Proof. | |
apply mk_rt. | |
- apply add0r. | |
- apply addrC. | |
- apply addrA. | |
- apply mul1r. | |
- apply mulrC. | |
- apply mulrA. | |
- apply mulrDl. | |
- by []. | |
- apply subrr. | |
Qed. | |
Add Ring Ringgg : rt. | |
Lemma tmp2: | |
forall x y: R, eq (x + y) (y + x). | |
Proof. move => x y. ring. Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment