Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions test/WildCat/AbEnriched.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From HoTT Require Import WildCat.SetoidRewrite WildCat.Core WildCat.AbEnriched.
From HoTT Require Import Basics.Overture.

Local Open Scope mc_add_scope.

(** Test that setoid rewriting works with the additive structure. *)

Definition test1 (A : Type) `{IsAbGroup_0gpd A}
{a b c d : A} (p : b $== c) (q : c $== d)
: b + a $== d + a.
Proof.
rewrite p.
rewrite <- q.
reflexivity.
Defined.

Definition test2 (A : Type) `{IsAbGroup_0gpd A}
{a b c d : A} (p : b $== c) (q : c $== d)
: a + b $== a + d.
Proof.
rewrite p.
rewrite <- q.
reflexivity.
Defined.

Definition test3 (A : Type) `{IsAbGroup_0gpd A}
{a b c d : A} (p : a $== c) (q : b $== d)
: a - b $== c - d.
Proof.
rewrite p.
rewrite <- q.
reflexivity.
Defined.

Definition test4 (A : Type) `{IsAbGroup_0gpd A}
{a b : A} (p : a $== b)
: - a $== - b.
Proof.
rewrite p.
reflexivity.
Defined.

(** Test rewriting just on LHS of a sum. *)
Definition test5 (A : Type) `{IsAbGroup_0gpd A}
{a b c : A} (p : a $== b)
: a + c $== b + c.
Proof.
rewrite p.
reflexivity.
Defined.

(** Test rewriting just on RHS of a sum. *)
Definition test6 (A : Type) `{IsAbGroup_0gpd A}
{a b c : A} (p : a $== b)
: c + a $== c + b.
Proof.
rewrite p.
reflexivity.
Defined.

(** Test rewriting simultaneously on both sides of a sum. *)
Definition test7 (A : Type) `{IsAbGroup_0gpd A}
{a b : A} (p : a $== b)
: a + a $== b + b.
Proof.
rewrite p.
reflexivity.
Defined.
1 change: 1 addition & 0 deletions theories/WildCat.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Require Export WildCat.Coproducts.
Require Export WildCat.Displayed.
Require Export WildCat.DisplayedEquiv.
Require Export WildCat.Pullbacks.
Require Export WildCat.AbEnriched.

Require Export WildCat.SetoidRewrite.

Expand Down
Loading
Loading