klefki.algebra.abstract

Module Contents

Classes

Transformer

A Transformer, is a Object implemented methods like from_int, from_list, from_SomeType.

Functor

Functor provide help function like fmap, lift_fmap

Groupoid

A groupoid is an algebraic structure consisting of a non-empty set G and a binary operation o on G. The pair (G, o) is called groupoid.

SemiGroup

If (G, o) is a groupoid and if the associative rule (aob)oc = ao(boc) holds for all a, b, c ∈ G, then (G, o) is called a semigroup.

Monoid

A semigroup with identity element is called a monoid.

Group

A monoid in which every element has an inverse is called group.

Ring

RING is a setRwhich is CLOSED under two operations+and×andsatisfying the following properties:

Field

A FIELD is a set F which is closed under two operations + and × s.t.

class klefki.algebra.abstract.Transformer

A Transformer, is a Object implemented methods like from_int, from_list, from_SomeType.

classmethod derive(cls, name, *args, **kwargs)
clone(self)
copy(self)
craft(self, *args)

Automatic lookup method like from_{type} of Class Object.

class klefki.algebra.abstract.Functor(*args)

Bases: klefki.algebra.abstract.Transformer

Functor provide help function like fmap, lift_fmap

__slots__ = ['value']
classmethod construct(cls, name, **kwargs)
property type(self)
property id(self)
classmethod fmap(cls, f: Callable[[Any], Any]) → Callable[[Functor], Functor]
classmethod lift_fmap(cls, f: Callable[[Functor], Functor]) → Callable[[Any], Functor]
classmethod as_map(cls, target: Type[Functor], f: Callable[[Functor], Functor]) → Callable[[Any], Functor]
class klefki.algebra.abstract.Groupoid(*args)

Bases: klefki.algebra.abstract.Functor

A groupoid is an algebraic structure consisting of a non-empty set G and a binary operation o on G. The pair (G, o) is called groupoid.

__slots__ = []
abstract op(self, g: Group)Group
__eq__(self, b) → bool

Return self==value.

__lt__(self, b) → bool

Return self<value.

__le__(self, b) → bool

Return self<=value.

__gt__(self, b) → bool

Return self>value.

__ge__(self, b) → bool

Return self>=value.

__add__(self, g: Group)Group

Allowing call associativity operator via A + B Strict limit arg g and ret res should be subtype of Group, For obeying axiom closure (1)

__radd__(self, g)
__mul__(self, g: Group)Group
__repr__(self)

Return repr(self).

__str__(self)

Return str(self).

class klefki.algebra.abstract.SemiGroup(*args)

Bases: klefki.algebra.abstract.Groupoid

If (G, o) is a groupoid and if the associative rule (aob)oc = ao(boc) holds for all a, b, c ∈ G, then (G, o) is called a semigroup.

__slots__ = []
abstract op(self, g: Group)Group

The Operator for obeying axiom associativity (2)

class klefki.algebra.abstract.Monoid(*args)

Bases: klefki.algebra.abstract.SemiGroup

A semigroup with identity element is called a monoid.

__slots__ = []
classmethod zero(cls)
classmethod identity(cls)

The value for obeying axiom identity (3)

__not__(self)
scalar(self, times)
__matmul__(self, times)
__xor__(self, times)Group
class klefki.algebra.abstract.Group(*args)

Bases: klefki.algebra.abstract.Monoid

A monoid in which every element has an inverse is called group.

__slots__ = []
abstract inverse(self: Group)Group

Implement for axiom inverse

__sub__(self, g: Group)Group

Allow to reverse op via a - b

__neg__(self)Group
class klefki.algebra.abstract.Ring(*args)

Bases: klefki.algebra.abstract.Group

RING is a setRwhich is CLOSED under two operations+and×andsatisfying the following properties: (1) R is an abelian group under+. (2)Associativity of × For every a,b,c∈R,a×(b×c) = (a×b)×c (3)Distributive Properties – For everya,b,c∈Rthe following identities hold: a×(b+c) = (a×b) + (a×c)and(b+c)×a=b×a+c×a

__slots__ = []
abstract sec_op(self, g: Field)Field

The Operator for obeying axiom associativity (2)

__mul__(self, g: Field)Field

Allowing call associativity operator via A * B Strict limit arg g and ret res should be subtype of Group, For obeying axiom closure (1)

__pow__(self, b, m=None)
class klefki.algebra.abstract.Field(*args)

Bases: klefki.algebra.abstract.Ring

A FIELD is a set F which is closed under two operations + and × s.t. (1) Fis an abelian group under + and (2) F-{0} (the set F without the additive identity 0) is an abelian group under ×.

__slots__ = []
abstract sec_inverse(self)Field

Implement for axiom inverse

classmethod sec_identity(cls)
classmethod one(cls)
__invert__(self)
__truediv__(self, g: Field)Field