forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR coq#19207: Fix
remember
with sort polymorphic equality and…
… values Reviewed-by: ppedrot Co-authored-by: ppedrot <[email protected]>
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Set Universe Polymorphism. | ||
|
||
Inductive bool@{q| |} : Type@{q|Set} := | true : bool | false : bool. | ||
|
||
Definition nand@{q| |} (a b : bool@{q|}) : bool@{q|} := | ||
match a , b with | ||
| true , true => false | ||
| _ , _ => true | ||
end. | ||
|
||
Inductive seq@{q|u|} {A : Type@{q|u}} (a : A) : A -> Type@{q|u} := | srefl : seq a a. | ||
Arguments srefl {_ _}. | ||
|
||
Definition seq_elim@{q|u v|} := | ||
fun (A : Type@{q|u}) (x : A) (P : A -> Type@{q|v}) (f : P x) (a : A) (e : seq x a) => | ||
match e in (seq _ a0) return (P a0) with | ||
| srefl => f | ||
end. | ||
|
||
Register seq as core.eq.type. | ||
Register srefl as core.eq.refl. | ||
Register seq_elim as core.eq.rect. | ||
|
||
Lemma foo@{q| |} (f : bool@{q|} -> bool@{q|}) (x : bool@{q|}) : seq (f true) (f true). | ||
Proof. | ||
remember (f true) as b eqn : ftrue. | ||
reflexivity. | ||
Qed. | ||
|
||
Lemma f3_eq_f@{q| |} (f : bool@{q|} -> bool@{q|}) (x : bool@{q|}) : seq (f (f (f x))) (f x). | ||
Proof. | ||
remember (f true) as b eqn : ftrue. | ||
|
||
remember (f false) as c eqn : ffalse. | ||
Validate Proof. | ||
|
||
destruct x,b,c. | ||
all:repeat rewrite <-?ftrue, <-?ffalse. | ||
all: reflexivity. | ||
Qed. |