Skip to content

Commit

Permalink
Demote right congruence of + to a theorem (#3)
Browse files Browse the repository at this point in the history
* + Right congruence can be proven

* Move the proof
  • Loading branch information
nobrakal authored and snowleopard committed Jun 23, 2018
1 parent 6b623e5 commit 9f6f345
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Algebra/Graph.agda
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data _≡_ {A} : (x y : Graph A) -> Set where

-- Congruence
+left-congruence : {x y z : Graph A} -> x ≡ y -> x + z ≡ y + z
+right-congruence : {x y z : Graph A} -> x ≡ y -> z + x ≡ z + y
-- +right-congruence holds as a theorem, please see below
*left-congruence : {x y z : Graph A} -> x ≡ y -> x * z ≡ y * z
*right-congruence : {x y z : Graph A} -> x ≡ y -> z * x ≡ z * y

Expand All @@ -39,6 +39,9 @@ data _≡_ {A} : (x y : Graph A) -> Set where
right-distributivity : {x y z : Graph A} -> (x + y) * z ≡ x * z + y * z
decomposition : {x y z : Graph A} -> x * y * z ≡ x * y + x * z + y * z

+right-congruence : {A} {x y z : Graph A} -> x ≡ y -> z + x ≡ z + y
+right-congruence {_} {x} {y} {z} eq = transitivity +commutativity (transitivity (+left-congruence eq) +commutativity)

-- Subgraph relation
_⊆_ : {A} -> Graph A -> Graph A -> Set
x ⊆ y = x + y ≡ y

0 comments on commit 9f6f345

Please sign in to comment.