-
Notifications
You must be signed in to change notification settings - Fork 201
move SetoidRewrite to main library and other changes in preparation for diagram chasing #2334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d183c5e
Products: mark associativity instance as #[export]
jdchristensen afe08d9
Be more selective with WildCat and other imports
jdchristensen 2b2350d
SetoidRewrite: move to WildCat folder; move tests to test folder
jdchristensen 72ecdd4
test/WildCat/SetoidRewrite: style updates
jdchristensen 9dc7828
ZeroGroupoid: add more moveL/R results and other minor changes
jdchristensen e0e30a4
WildCat.v: add Pullbacks.v to meta-file
jdchristensen 8bebb6f
test/WildCat/SetoidRewrite: change Abort to Defined
jdchristensen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| #[warnings="-deprecated-from-Coq"] | ||
| From Coq Require Init.Tactics. (* TODO: Can remove this line and previous once Rocq 9.0 is our minimum. *) | ||
| From HoTT Require Import Basics.Overture Basics.Tactics. | ||
| From HoTT.WildCat Require Import Core NatTrans Equiv SetoidRewrite. | ||
|
|
||
| (** * Examples and tests of setoid rewriting *) | ||
|
|
||
| (** ** Examples of setoid rewriting *) | ||
|
|
||
| (** See theories/WildCat/HomologicalAlgebra.v for many more examples of setoid rewriting. *) | ||
|
|
||
| (** Rewriting works in hypotheses. *) | ||
| Proposition epic_sectionof {A} `{Is1Cat A} | ||
| {a b : A} (f : a $-> b) : | ||
| SectionOf f -> Epic f. | ||
| Proof. | ||
| intros [right_inverse is_section] c g h eq_gf_hf. | ||
| apply cat_prewhisker with (h:=right_inverse) in eq_gf_hf. | ||
| rewrite 2 cat_assoc, is_section, 2 cat_idr in eq_gf_hf. | ||
| exact eq_gf_hf. | ||
| Defined. | ||
|
|
||
| (** A different approach, working in the goal. *) | ||
| Proposition monic_retractionof {A} `{Is1Cat A} | ||
| {b c : A} (f : b $-> c) : | ||
| RetractionOf f -> Monic f. | ||
| Proof. | ||
| intros [left_inverse is_retraction] a g h eq_fg_fh. | ||
| rewrite <- (cat_idl g), <- (cat_idl h). | ||
| rewrite <- is_retraction. | ||
| rewrite 2 cat_assoc. | ||
| exact (_ $@L eq_fg_fh). | ||
| Defined. | ||
|
|
||
| Proposition faithful_nat_equiv_faithful {A B : Type} | ||
| {F G : A -> B} `{Is1Functor _ _ F} | ||
| `{!Is0Functor G, !Is1Functor G} | ||
| `{!HasEquivs B} (tau : NatEquiv F G) | ||
| : Faithful F -> Faithful G. | ||
| Proof. | ||
| intros faithful_F x y f g eq_Gf_Gg. | ||
| apply faithful_F. | ||
| apply (cate_monic_equiv (tau y)). | ||
| rewrite 2 (isnat tau). | ||
| by apply cat_prewhisker. | ||
| Defined. | ||
|
|
||
| (** ** Tests of setoid rewriting *) | ||
|
|
||
| Section SetoidRewriteTests. | ||
|
|
||
| Goal forall (A : Type) `(H : Is0Gpd A) (a b c : A), | ||
| a $== b -> b $== c -> a $== c. | ||
| Proof. | ||
| intros A ? ? ? a b c eq_ab eq_bc. | ||
| by rewrite eq_ab, <- eq_bc. | ||
| Abort. | ||
|
|
||
| Goal forall (A : Type) `(H : Is0Gpd A) (a b c : A), | ||
| a $== b -> b $== c -> a $== c. | ||
| Proof. | ||
| intros A ? ? ? a b c eq_ab eq_bc. | ||
| symmetry. | ||
| rewrite eq_ab, <- eq_bc. | ||
| rewrite eq_bc. | ||
| by rewrite <- eq_bc. | ||
| Abort. | ||
|
|
||
| Goal forall (A B : Type) (F : A -> B) `{Is1Functor _ _ F} (a b : A) (f g : a $-> b), f $== g -> fmap F f $== fmap F g. | ||
| Proof. | ||
| do 17 intro. | ||
| intro eq_fg. | ||
| by rewrite eq_fg. | ||
| Abort. | ||
|
|
||
| Goal forall (A : Type) `{Is1Cat A} (a b c : A) (f1 f2 : a $-> b) (g : b $-> c), f1 $== f2 -> g $o f1 $== g $o f2. | ||
| Proof. | ||
| do 11 intro. | ||
| intro eq. | ||
| rewrite <- eq. | ||
| by rewrite eq. | ||
| Abort. | ||
|
|
||
| Goal forall (A : Type) `{Is1Cat A} (a b c : A) (f : a $-> b) (g1 g2 : b $-> c), g1 $== g2 -> g1 $o f $== g2 $o f. | ||
| Proof. | ||
| do 11 intro. | ||
| intro eq. | ||
| rewrite <- eq. | ||
| rewrite eq. | ||
| by rewrite <- eq. | ||
| Abort. | ||
|
|
||
| Goal forall (A : Type) `{Is1Cat A} (a b c : A) (f1 f2 : a $-> b) (g1 g2 : b $-> c), g1 $== g2 -> f1 $== f2 -> g1 $o f1 $== g2 $o f2. | ||
| Proof. | ||
| do 12 intro. | ||
| intros eq_g eq_f. | ||
| rewrite eq_g. | ||
| rewrite <- eq_f. | ||
| rewrite eq_f. | ||
| by rewrite <- eq_g. | ||
| Abort. | ||
|
|
||
| End SetoidRewriteTests. | ||
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.