QL75BDYCNRAF2NPJP3MJHUPM6JRIGJQWK2OG2NWKBOVZUZ75CHOAC
export
proofDisjCommutative : (a, b : Boolean) -> a `disj` b = b `disj` a
proofDisjCommutative False b =
rewrite proofDisjLeftIdentity b in
rewrite proofDisjRightIdentity b in
Refl
proofDisjCommutative True b = rewrite proofDisjRightAnnihilation b in Refl
public export
[BooleanDisjMagma] Magma Boolean where
(<>) = disj
export
proofDisjCommutative : (a, b : Boolean) -> a `disj` b = b `disj` a
proofDisjCommutative False b =
rewrite proofDisjLeftIdentity b in
rewrite proofDisjRightIdentity b in
Refl
proofDisjCommutative True b = rewrite proofDisjRightAnnihilation b in Refl
public export
[BooleanDisjCommutativeMonoid] CommutativeMonoid Boolean using BooleanDisjCommutativeSemigroup BooleanDisjMonoid where
export
proofConjCommutative : (a, b : Boolean) -> a `conj` b = b `conj` a
proofConjCommutative False b = rewrite proofConjRightAnnihilation b in Refl
proofConjCommutative True b =
rewrite proofConjLeftIdentity b in
rewrite proofConjRightIdentity b in
Refl
public export
[BooleanConjMagma] Magma Boolean where
(<>) = conj
public export
[BooleanConjCommutativeMagma] CommutativeMagma Boolean using BooleanConjMagma where
proofCommutativity = proofConjCommutative
export
proofConjCommutative : (a, b : Boolean) -> a `conj` b = b `conj` a
proofConjCommutative False b = rewrite proofConjRightAnnihilation b in Refl
proofConjCommutative True b =
rewrite proofConjLeftIdentity b in
rewrite proofConjRightIdentity b in
Refl
public export
interface (CommutativeMagma t, Semigroup t) => CommutativeSemigroup t where
public export
CommutativeMagma t => Semigroup t => CommutativeSemigroup t where
public export
interface (CommutativeSemigroup t, Monoid t) => CommutativeMonoid t where
CommutativeSemigroup t => Monoid t => CommutativeMonoid t where
public export
interface Magma t => CommutativeMagma t where
proofCommutativity : (x, y : t) -> x <> y = y <> x
public export
interface (CommutativeMonoid t, Group t) => CommutativeGroup t where
public export
CommutativeMonoid t => Group t => CommutativeGroup t where