Skip to content

Commit a8aa378

Browse files
committed
explicit varaibles
1 parent 9711485 commit a8aa378

File tree

1 file changed

+36
-34
lines changed

1 file changed

+36
-34
lines changed

src/Algebra/Properties/Monoid/Reasoning.agda

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,59 @@ open import Algebra.Bundles using (Monoid)
1212
module Algebra.Properties.Monoid.Reasoning {o ℓ} (M : Monoid o ℓ) where
1313

1414
open Monoid M
15-
using (Carrier; _∙_; _≈_; setoid; isMagma; semigroup; ε; sym; identityˡ
16-
; identityʳ ; ∙-cong; refl; assoc; ∙-congˡ; ∙-congʳ; trans)
15+
using (Carrier; _∙_; _≈_; setoid; isMagma; semigroup; ε; sym; identityˡ
16+
; identityʳ ; ∙-cong; refl; assoc; ∙-congˡ; ∙-congʳ; trans)
1717
open import Relation.Binary.Reasoning.Setoid setoid
18-
open import Algebra.Properties.Semigroup.Reasoning semigroup public
1918

20-
module Identity {a : Carrier } where
21-
id-unique : ( b b ∙ a ≈ b) a ≈ ε
22-
id-unique b∙a≈b = trans (sym (identityˡ a)) (b∙a≈b ε)
19+
open import Algebra.Properties.Semigroup semigroup public
2320

24-
id-comm : a ∙ ε ≈ ε ∙ a
25-
id-comm = trans (identityʳ a) (sym (identityˡ a))
21+
private
22+
variable
23+
a b c d : Carrier
2624

27-
id-comm-sym : ε ∙ a ≈ a ∙ ε
28-
id-comm-sym = sym id-comm
25+
module _ where
26+
id-unique : a ( b b ∙ a ≈ b) a ≈ ε
27+
id-unique a b∙a≈b = trans (sym (identityˡ a)) (b∙a≈b ε)
2928

30-
open Identity public
29+
id-comm : a a ∙ ε ≈ ε ∙ a
30+
id-comm a = trans (identityʳ a) (sym (identityˡ a))
3131

32-
module IntroElim {a b : Carrier} (a≈ε : a ≈ ε) where
33-
elimʳ : b ∙ a ≈ b
34-
elimʳ = trans (∙-congˡ a≈ε) (identityʳ b)
32+
id-comm-sym : a ε ∙ a ≈ a ∙ ε
33+
id-comm-sym a = sym (id-comm a)
3534

36-
elimˡ : a ∙ b ≈ b
37-
elimˡ = trans (∙-congʳ a≈ε) (identityˡ b)
35+
module _ {a b : Carrier} (a≈ε : a ≈ ε) where
36+
elimʳ : b b ∙ a ≈ b
37+
elimʳ b = trans (∙-congˡ a≈ε) (identityʳ b)
3838

39-
introʳ : a ≈ ε b ≈ b ∙ a
40-
introʳ a≈ε = sym elimʳ
39+
elimˡ : b a ∙ b ≈ b
40+
elimˡ b = trans (∙-congʳ a≈ε) (identityˡ b)
4141

42-
introˡ : a ≈ ε b ≈ a ∙ b
43-
introˡ a≈ε = sym elimˡ
42+
introʳ : b b ≈ b ∙ a
43+
introʳ b = sym (elimʳ b)
44+
45+
introˡ : b b ≈ a ∙ b
46+
introˡ b = sym (elimˡ b)
4447

4548
introcenter : c b ∙ c ≈ b ∙ (a ∙ c)
4649
introcenter c = trans (∙-congˡ (sym (identityˡ c))) (∙-congˡ (∙-congʳ (sym a≈ε)))
4750

48-
open IntroElim public
51+
module _ {a c : Carrier} (inv : a ∙ c ≈ ε) where
4952

50-
module Cancellers {a b c : Carrier} (inv : a ∙ c ≈ ε) where
53+
cancelʳ : b (b ∙ a) ∙ c ≈ b
54+
cancelʳ b = trans (assoc b a c) (trans (∙-congˡ inv) (identityʳ b))
5155

52-
cancelʳ : (b ∙ a)c ≈ b
53-
cancelʳ = trans (assoc b a c) (trans (∙-congˡ inv) (identityʳ b))
56+
cancelˡ : b a(c ∙ b) ≈ b
57+
cancelˡ b = trans (sym (assoc a c b)) (trans (∙-congʳ inv) (identityˡ b))
5458

55-
cancelˡ : a ∙ (c ∙ b) ≈ b
56-
cancelˡ = trans (sym (assoc a c b)) (trans (∙-congʳ inv) (identityˡ b))
59+
insertˡ : b b ≈ a ∙ (c ∙ b)
60+
insertˡ b = sym (cancelˡ b)
5761

58-
insertˡ : b ≈ a ∙ (cb)
59-
insertˡ = sym cancelˡ
62+
insertʳ : b b ≈ (ba) ∙ c
63+
insertʳ b = sym (cancelʳ b)
6064

61-
insertʳ : b ≈ (b ∙ a) ∙ c
62-
insertʳ = sym cancelʳ
65+
cancelInner : b d (b ∙ a) ∙ (c ∙ d) ≈ b ∙ d
66+
cancelInner b d = trans (sym (assoc (b ∙ a) c d)) (∙-congʳ (cancelʳ b))
6367

64-
cancelInner : {g} (b ∙ a) ∙ (cg) ≈ bg
65-
cancelInner {g = g} = trans (sym (assoc (b ∙ a) c g)) (∙-congʳ cancelʳ)
68+
insertInner : b d b ∙ d ≈ (ba) ∙ (cd)
69+
insertInner b d = sym (cancelInner b d)
6670

67-
insertInner : {g} b ∙ g ≈ (b ∙ a) ∙ (c ∙ g)
68-
insertInner = sym cancelInner

0 commit comments

Comments
 (0)