Added Sumbonoid

This commit is contained in:
Eloi Torrents 2021-08-25 16:48:55 +02:00
parent b1f3b4e77d
commit e2e83e6c07
3 changed files with 14 additions and 0 deletions

3
base/Monoid/get_e.kind Normal file
View File

@ -0,0 +1,3 @@
Monoid.get_e<A: Type>(M: Monoid(A)): A
open M
M.e

4
base/Monoid/get_op.kind Normal file
View File

@ -0,0 +1,4 @@
// Returns the monoid operation for the given monoid.
Monoid.get_op<A: Type>(M: Monoid<A>): A -> A -> A
open M
M.op

7
base/Submonoid.kind Normal file
View File

@ -0,0 +1,7 @@
type Submonoid<A: Type>(M: Monoid(A)){
new(
Q: A -> Type,
he: Q(Monoid.get_e(A,M)),
closed: (a: A) (ha: Q(a)) (b: A) (hb: Q(b)) -> Q(Monoid.get_op(A,M)(a, b)),
)
}