An abstract principal homogeneous space over the additive group of a linear space.
An abstract principal homogeneous space over the additive group of a linear space. Vector addition acts freely and transitively over the point set. To the extent practicable, the following axioms should hold.
Axioms:
zero
== 𝓅 for every point 𝓅 in this
.this
.this
.
// You can abstract over affine spaces by parameterizing a class or // function with a subtype of AffineSpace with Singleton. Type elements // with the #Point, #Vector and #Scalar type projections of your // AffineSpace type parameter. def testAffineSpaceOperations[A <: AffineSpace with Singleton]( p: A#Point, q: A#Point, u: A#Vector, v: A#Vector): Unit = { assert((p + u) + v == p + (u + v), "associativity of point-vector addition") assert(p + (-v) == p - v, "existence of point-vector subtraction") assert((p + v) - (q + v) == p - q, "existence of point-point subtraction") } // Alternatively, functions can use path-dependent types of an AffineSpace parameter. def testAffineSpaceIdentities(A: AffineSpace)(p: A.Point, q: A.Point, v: A.Vector): Unit = { import A._ assert(p + zero == p, "existence of additive identity vector") if (p + v == q + v) assert(p == v, "uniqueness of points") }
0.1
0.0
A complete abstract field structure.
A complete abstract field structure. Addition associates and commutes, and multiplication associates, commutes, and distributes over addition. Addition and multiplication both have an identity element, every element has an additive inverse, and every element except zero has a multiplicative inverse. Completeness implies that every Cauchy sequence of elements converges. To the extent practicable, the following axioms should hold.
Axioms for addition:
this
, then their sum 𝑎 + 𝑏 is also an element in this
.this
.this
.this
has an element zero
such that zero
+ 𝑎 == 𝑎 for every element 𝑎 in this
.this
corresponds an element -𝑎 in this
such that 𝑎 + (-𝑎) == zero
.Axioms for multiplication:
this
, then their product 𝑎 * 𝑏 is also an element in this
.this
.this
.this
has an element unit
!= zero
such that unit
* 𝑎 == 𝑎 for every element 𝑎 in this
.this
and 𝑎 != zero
then there exists an element 𝑎.inverse
such that 𝑎 * 𝑎.inverse
== unit
.The distributive law:
this
.Completeness axiom:
this
with an upper bound has a least upper bound.
// You can abstract over complete fields by parameterizing a class or // function with a subtype of CompleteField with Singleton. Type elements // with the #Element type projection of your CompleteField type parameter. def testCompleteFieldOperations[F <: CompleteField with Singleton](a: F#Element, b: F#Element, c: F#Element): Unit = { assert(a + b == b + a, "commutativity of addition") assert((a + b) + c == a + (b + c), "associativity of addition") assert(a * b == b * a, "commutativity of multiplication") assert((a * b) * c == a * (b * c), "associativity of multiplication") assert(a * (b + c) == (a * b) + (a * c), "distributivity of multiplication over addition") } // Alternatively, functions can use path-dependent types of a CompleteField parameter. def testCompleteFieldIdentities(F: CompleteField)(a: F.Element): Unit = { import F._ assert(zero + a == a, "existence of additive identity") assert(a + (-a) == zero, "existence of additive inverse") assert(unit != zero && unit * a == a, "existence of multiplicative identity") assert(a * a.inverse == unit, "existence of multiplicative inverse") }
0.1
0.0
Indicates a dimensional mismatch.
Indicates a dimensional mismatch.
0.0
0.0
An abstract 2-dimensional vector space over a ring.
An abstract 2-dimensional vector space over a ring.
0.1
0.0
An asbtract 2 by 2 matrix space over a field.
An asbtract 2 by 2 matrix space over a field.
0.1
0.0
An abstract 3-dimensional vector space over a ring.
An abstract 3-dimensional vector space over a ring.
0.1
0.0
An asbtract 3 by 3 matrix space over a field.
An asbtract 3 by 3 matrix space over a field.
0.1
0.0
An abstract 4-dimensional vector space over a ring.
An abstract 4-dimensional vector space over a ring.
0.1
0.0
An asbtract 4 by 4 matrix space over a field.
An asbtract 4 by 4 matrix space over a field.
0.1
0.0
An abstract M by N matrix space over a ring.
An abstract M by N matrix space over a ring. Matrix spaces describe linear maps between vector spaces relative to the vector spaces' assumed bases. Matrix addition associates and commutes, and scalar multiplication associates, commutes, and distributes over matrix addition and scalar addition. Matrix and vector multiplication also both associate and distribute over matrix addition. Vectors in the row space multiply as columns on the right, and vectors in the column space multiply as rows on the left. Addition and scalar multiplication both have an identity element, and every matrix has an additive inverse. To the extent practicable, the following axioms should hold.
Axioms for matrix addition:
this
, then their sum 𝐀 + 𝐁 is also a matrix in this
.this
.this
.this
has a matrix zero
such that zero
+ 𝐀 == 𝐀 for every matrix 𝐀 in this
.this
corresponds a matrix -𝐀 in this
such that 𝐀 + (-𝐀) == zero
.Axioms for scalar multiplication:
this
and 𝐀 is a matrix in this
, then their product 𝑥 *: 𝐀 is also a matrix in this
.this
.Scalar
has an element unit
such that unit
*: 𝐀 == 𝐀 for every matrix 𝐀 in this
.Axioms for vector multiplication:
this
and 𝐯 is a vector in the row space of 𝐀, then their product
𝐀 :⋅ 𝐯 is a vector in the column space of 𝐀.T
for every matrix 𝐀 and every vector 𝐯 in the row space of 𝐀.Axioms for matrix multiplication:
T
== 𝐁.T
⋅ 𝐀.T
for all matrices 𝐀, 𝐁 where the row space of 𝐀 equals the column space of 𝐁.Distributive laws:
this
.this
.0.1
0.0
An abstract N-dimensional vector space over a ring.
An abstract N-dimensional vector space over a ring. Vector addition associates and commutes, and scalar multiplication associates, commutes, and distributes over vector addition and scalar addition. Vector addition and scalar multiplication both have an identity element, and every vector has an additive inverse. Every vector space is an affine space over itself. To the extent practicable, the following axioms should hold.
Axioms for vector addition:
this
, then their sum 𝐮 + 𝐯 is also a vector in this
.this
.this
.this
has a vector zero
such that zero
+ 𝐯 == 𝐯 for every vector 𝐯 in this
.this
corresponds a vector -𝐯 in this
such that 𝐯 + (-𝐯) == zero
.Axioms for scalar multiplication:
this
and 𝐯 is a vector in this
, then their product 𝑎 *: 𝐯 is also a vector in this
.this
.Scalar
has an element unit
such that unit
*: 𝐯 == 𝐯 for every vector 𝐯 in this
.Distributive laws:
this
.this
.
// You can abstract over vector spaces by parameterizing a class or // function with a subtype of FN with Singleton. Type elements with // the #Vector and #Scalar type projections of your FN type parameter. def testVectorSpaceOperations[V <: FN[S] with Singleton, S <: Ring with Singleton] (a: V#Scalar, b: V#Scalar, u: V#Vector, v: V#Vector, w: V#Vector): Unit = { assert(u + v == v + u, "commutativity of vector addition") assert((u + v) + w == u + (v + w), "associativity of vector addition") assert((a * b) *: v == a *: (b *: v), "associativity of scalar multiplication with ring multiplication") assert(a *: (u + v) == (a *: u) + (a *: v), "distributivity of scalar multiplication over vector addition") assert((a + b) *: v == (a *: v) + (b *: v), "distributivity of scalar multiplication over ring addition") } // Alternatively, functions can use path-dependent types of a FN parameter. def testVectorSpaceIdentities(V: FN[_])(a: V.Scalar, v: V.Vector): Unit = { import V._ assert(zero + v == v, "existence of additive identity vector") assert(v + (-v) == zero, "existence of additive inverse vector") assert(Scalar.unit *: v == v, "existence of multiplicative identity scalar") }
0.1
0.0
An abstract field structure.
An abstract field structure. Addition associates and commutes, and multiplication associates, commutes, and distributes over addition. Addition and multiplication both have an identity element, every element has an additive inverse, and every element except zero has a multiplicative inverse. To the extent practicable, the following axioms should hold.
Axioms for addition:
this
, then their sum 𝑎 + 𝑏 is also an element in this
.this
.this
.this
has an element zero
such that zero
+ 𝑎 == 𝑎 for every element 𝑎 in this
.this
corresponds an element -𝑎 in this
such that 𝑎 + (-𝑎) == zero
.Axioms for multiplication:
this
, then their product 𝑎 * 𝑏 is also an element in this
.this
.this
.this
has an element unit
!= zero
such that unit
* 𝑎 == 𝑎 for every element 𝑎 in this
.this
and 𝑎 != zero
then there exists an element 𝑎.inverse
such that 𝑎 * 𝑎.inverse
== unit
.The distributive law:
this
.
// You can abstract over fields by parameterizing a class or // function with a subtype of Field with Singleton. Type elements // with the #Element type projection of your Field type parameter. def testFieldOperations[F <: Field with Singleton](a: F#Element, b: F#Element, c: F#Element): Unit = { assert(a + b == b + a, "commutativity of addition") assert((a + b) + c == a + (b + c), "associativity of addition") assert(a * b == b * a, "commutativity of multiplication") assert((a * b) * c == a * (b * c), "associativity of multiplication") assert(a * (b + c) == (a * b) + (a * c), "distributivity of multiplication over addition") } // Alternatively, functions can use path-dependent types of a Field parameter. def testFieldIdentities(F: Field)(a: F.Element): Unit = { import F._ assert(zero + a == a, "existence of additive identity") assert(a + (-a) == zero, "existence of additive inverse") assert(unit != zero && unit * a == a, "existence of multiplicative identity") assert(a * a.inverse == unit, "existence of multiplicative inverse") }
0.1
0.0
A field of closed sets between two elements of an ordered field.
A field of closed sets between two elements of an ordered field.
0.1
0.1
A ring of closed sets between two elenents of an ordered ring.
A ring of closed sets between two elenents of an ordered ring.
0.1
0.1
A totally ordered abstract field structure.
A totally ordered abstract field structure. Addition associates and commutes, and multiplication associates, commutes, and distributes over addition. Addition and multiplication both have an identity element, every every element has an additive inverse, and every element except zero has a multiplicative inverse. To the extent practicable, the following axioms should hold.
Axioms for addition:
this
, then their sum 𝑎 + 𝑏 is also an element in this
.this
.this
.this
has an element zero
such that zero
+ 𝑎 == 𝑎 for every element 𝑎 in this
.this
corresponds an element -𝑎 in this
such that 𝑎 + (-𝑎) == zero
.Axioms for multiplication:
this
, then their product 𝑎 * 𝑏 is also an element in this
.this
.this
.this
has an element unit
!= zero
such that unit
* 𝑎 == 𝑎 for every element 𝑎 in this
.this
and 𝑎 != zero
then there exists an element 𝑎.inverse
such that 𝑎 * 𝑎.inverse
== unit
.The distributive law:
this
.Order axioms:
this
.this
.this
.
// You can abstract over ordered fields by parameterizing a class or // function with a subtype of OrderedField with Singleton. Type elements // with the #Element type projection of your OrderedField type parameter. def testOrderedFieldOperations[F <: OrderedField with Singleton](a: F#Element, b: F#Element, c: F#Element): Unit = { assert(a + b == b + a, "commutativity of addition") assert((a + b) + c == a + (b + c), "associativity of addition") assert(a * b == b * a, "commutativity of multiplication") assert((a * b) * c == a * (b * c), "associativity of multiplication") assert(a * (b + c) == (a * b) + (a * c), "distributivity of multiplication over addition") if (a <= b) assert((a min b) == a, "existence of minima") if (a <= b) assert((a max b) == b, "existence of maxima") } // Alternatively, functions can use path-dependent types of an OrderedField parameter. def testOrderedFieldIdentities(F: OrderedField)(a: F.Element, b: F.Element): Unit = { import F._ assert(zero + a == a, "existence of additive identity") assert(a + (-a) == zero, "existence of additive inverse") assert(unit != zero && unit * a == a, "existence of multiplicative identity") assert(a * a.inverse == unit, "existence of multiplicative inverse") if (a <= b && b <= a) assert(a == b, "antisymmetry of ordering") if (a <= b && b <= c) assert(a <= c, "transitivity of ordering") assert(a <= b || b <= a, "totality of ordering") }
0.1
0.0
A totally ordered abstract ring structure.
A totally ordered abstract ring structure. Addition associates and commutes, and multiplication associates and distributes over addition. Addition and multiplication both have an identity element, and every element has an additive inverse. To the extent practicable, the following axioms should hold.
Axioms for addition:
this
, then their sum 𝑎 + 𝑏 is also an element in this
.this
.this
.this
has an element zero
such that zero
+ 𝑎 == 𝑎 for every element 𝑎 in this
.this
corresponds an element -𝑎 in this
such that 𝑎 + (-𝑎) == zero
.Axioms for multiplication:
this
, then their product 𝑎 * 𝑏 is also an element in this
.this
.this
has an element unit
!= zero
such that unit
* 𝑎 == 𝑎 for every element 𝑎 in this
.The distributive law:
this
.Order axioms:
this
.this
.this
.
// You can abstract over ordered rings by parameterizing a class or // function with a subtype of OrderedRing with Singleton. Type elements // with the #Element type projection of your OrderedRing type parameter. def testOrderedRingOperations[R <: OrderedRing with Singleton](a: R#Element, b: R#Element, c: R#Element): Unit = { assert(a + b == b + a, "commutativity of addition") assert((a + b) + c == a + (b + c), "associativity of addition") assert((a * b) * c == a * (b * c), "associativity of multiplication") assert(a * (b + c) == (a * b) + (a * c), "distributivity of multiplication over addition") if (a <= b) assert((a min b) == a, "existence of minima") if (a <= b) assert((a max b) == b, "existence of maxima") } // Alternatively, functions can use path-dependent types of an OrderedRing parameter. def testOrderedRingIdentities(R: OrderedRing)(a: R.Element, b: R.Element): Unit = { import R._ assert(zero + a == a, "existence of additive identity") assert(a + (-a) == zero, "existence of additive inverse") assert(unit != zero && unit * a == a, "existence of multiplicative identity") if (a <= b && b <= a) assert(a == b, "antisymmetry of ordering") if (a <= b && b <= c) assert(a <= c, "transitivity of ordering") assert(a <= b || b <= a, "totality of ordering") }
0.1
0.0
A complete, totally ordered abstract field structure.
A complete, totally ordered abstract field structure. Addition associates and commutes, and multiplication associates, commutes, and distributes over addition. Addition and multiplication both have an identity element, every element has an additive inverse, and every element except zero has a multiplicative inverse. Also, every Cauchy sequence of elements converges. To the extent practicable, the following axioms should hold.
Axioms for addition:
this
, then their sum 𝑎 + 𝑏 is also an element in this
.this
.this
.this
has an element zero
such that zero
+ 𝑎 == 𝑎 for every element 𝑎 in this
.this
corresponds an element -𝑎 in this
such that 𝑎 + (-𝑎) == zero
.Axioms for multiplication:
this
, then their product 𝑎 * 𝑏 is also an element in this
.this
.this
.this
has an element unit
!= zero
such that unit
* 𝑎 == 𝑎 for every element 𝑎 in this
.this
and 𝑎 != zero
then there exists an element 𝑎.inverse
such that 𝑎 * 𝑎.inverse
== unit
.The distributive law:
this
.Order axioms:
this
.this
.this
.Completeness axiom:
this
with an upper bound has a least upper bound.
// You can abstract over real fields by parameterizing a class or // function with a subtype of RealField with Singleton. Type elements // with the #Element type projection of your RealField type parameter. def testRealFieldOperations[R <: RealField with Singleton](a: R#Element, b: R#Element, c: R#Element): Unit = { assert(a + b == b + a, "commutativity of addition") assert((a + b) + c == a + (b + c), "associativity of addition") assert(a * b == b * a, "commutativity of multiplication") assert((a * b) * c == a * (b * c), "associativity of multiplication") assert(a * (b + c) == (a * b) + (a * c), "distributivity of multiplication over addition") if (a <= b) assert((a min b) == a, "existence of minima") if (a <= b) assert((a max b) == b, "existence of maxima") } // Alternatively, functions can use path-dependent types of a RealField parameter. def testRealFieldIdentities(R: RealField)(a: R.Element, b: R.Element): Unit = { import R._ assert(zero + a == a, "existence of additive identity") assert(a + (-a) == zero, "existence of additive inverse") assert(unit != zero && unit * a == a, "existence of multiplicative identity") assert(a * a.inverse == unit, "existence of multiplicative inverse") if (a <= b && b <= a) assert(a == b, "antisymmetry of ordering") if (a <= b && b <= c) assert(a <= c, "transitivity of ordering") assert(a <= b || b <= a, "totality of ordering") }
0.1
0.0
An abstract ring structure.
An abstract ring structure. Addition associates and commutes, and multiplication associates and distributes over addition. Addition and multiplication both have an identity element, and every element has an additive inverse. To the extent practicable, the following axioms should hold.
Axioms for addition:
this
, then their sum 𝑎 + 𝑏 is also an element in this
.this
.this
.this
has an element zero
such that zero
+ 𝑎 == 𝑎 for every element 𝑎 in this
.this
corresponds an element -𝑎 in this
such that 𝑎 + (-𝑎) == zero
.Axioms for multiplication:
this
, then their product 𝑎 * 𝑏 is also an element in this
.this
.this
has an element unit
!= zero
such that unit
* 𝑎 == 𝑎 for every element 𝑎 in this
.The distributive law:
this
.
// You can abstract over rings by parameterizing a class or // function with a subtype of Ring with Singleton. Type elements // with the #Element type projection of your Ring type parameter. def testRingOperations[R <: Ring with Singleton](a: R#Element, b: R#Element, c: R#Element): Unit = { assert(a + b == b + a, "commutativity of addition") assert((a + b) + c == a + (b + c), "associativity of addition") assert((a * b) * c == a * (b * c), "associativity of multiplication") assert(a * (b + c) == (a * b) + (a * c), "distributivity of multiplication over addition") } // Alternatively, functions can use path-dependent types of a Ring parameter. def testRingIdentities(R: Ring)(a: R.Element): Unit = { import R._ assert(zero + a == a, "existence of additive identity") assert(a + (-a) == zero, "existence of additive inverse") assert(unit != zero && unit * a == a, "existence of multiplicative identity") }
0.1
0.0
An abstract vector space over a ring.
An abstract vector space over a ring. Vector addition associates and commutes, and scalar multiplication associates and distributes over vector addition and scalar addition. Vector addition and scalar multiplication both have an identity element, and every vector has an additive inverse. To the extent practicable, the following axioms should hold.
Axioms for vector addition:
this
, then their sum 𝐮 + 𝐯 is also a vector in this
.this
.this
.this
has a vector zero
such that zero
+ 𝐯 == 𝐯 for every vector 𝐯 in this
.this
corresponds a vector -𝐯 in this
such that 𝐯 + (-𝐯) == zero
.Axioms for scalar multiplication:
this
and 𝐯 is a vector in this
, then their product 𝑎 *: 𝐯 is also a vector in this
.this
.Scalar
has an element unit
such that unit
*: 𝐯 == 𝐯 for every vector 𝐯 in this
.Distributive laws:
this
.this
.
// You can abstract over vector spaces by parameterizing a class or // function with a subtype of VectorSpace with Singleton. Type elements // with the #Vector and #Scalar type projections of your VectorSpace // type parameter. def testVectorSpaceOperations[V <: VectorSpace with Singleton] (a: V#Scalar, b: V#Scalar, u: V#Vector, v: V#Vector, w: V#Vector) { assert(u + v == v + u, "commutativity of vector addition") assert((u + v) + w == u + (v + w), "associativity of vector addition") assert((a * b) *: v == a *: (b *: v), "associativity of scalar multiplication with ring multiplication") assert(a *: (u + v) == (a *: u) + (a *: v), "distributivity of scalar multiplication over vector addition") assert((a + b) *: v == (a *: v) + (b *: v), "distributivity of scalar multiplication over ring addition") } // Alternatively, functions can use path-dependent types of a VectorSpace parameter. def testVectorSpaceIdentities(V: VectorSpace)(a: V.Scalar, v: V.Vector): Unit = { import V._ assert(zero + v == v, "existence of additive identity vector") assert(v + (-v) == zero, "existence of additive inverse vector") assert(Scalar.unit *: v == v, "existence of multiplicative identity scalar") }
0.1
0.0
64-bit binary based algebraic structures.
Abstract algebraic structures.