CardinalNumber

card.spad line 1 [edit on github]

Members of the domain CardinalNumber are values indicating the cardinality of sets, both finite and infinite. Arithmetic operations are defined on cardinal numbers as follows. If x = #X and y = #Y then x+y= #(X+Y)disjoint union x-y= #(X-Y)relative complement x*y= #(X*Y)cartesian product x^y = #(X^Y)X^Y = {g| g: Y->X} The non-negative integers have a natural construction as cardinals 0 = #{}, 1 = {0}, 2 = {0, 1}, ..., n = {i| 0 <= i < n}. That 0 acts as a zero for the multiplication of cardinals is equivalent to the axiom of choice. The generalized continuum hypothesis asserts 2^Aleph i = Aleph(i+1) and is independent of the axioms of set theory [Goedel 1940]. Three commonly encountered cardinal numbers are a = #Zcountable infinity c = #Rthe continuum f = #{g| g: [0, 1]->R} In this domain, these values are obtained using a := Aleph 0, c := 2^a, f := 2^c.

* : (%, %) -> %
from Magma
* : (NonNegativeInteger, %) -> %
from AbelianMonoid
* : (PositiveInteger, %) -> %
from AbelianSemiGroup
+ : (%, %) -> %
from AbelianSemiGroup
- : (%, %) -> Union(%, "failed")

x - y returns an element z such that z+y=x or "failed" if no such element exists.

0 : () -> %
from AbelianMonoid
1 : () -> %
from MagmaWithUnit
< : (%, %) -> Boolean
from PartialOrder
<= : (%, %) -> Boolean
from PartialOrder
= : (%, %) -> Boolean
from BasicType
> : (%, %) -> Boolean
from PartialOrder
>= : (%, %) -> Boolean
from PartialOrder
Aleph : NonNegativeInteger -> %

Aleph(n) provides the named (infinite) cardinal number.

^ : (%, %) -> %

x^y returns #(X^Y) where X^Y is defined as {g| g: Y->X}.

^ : (%, NonNegativeInteger) -> %
from MagmaWithUnit
^ : (%, PositiveInteger) -> %
from Magma
coerce : NonNegativeInteger -> %
from CoercibleFrom(NonNegativeInteger)
coerce : % -> OutputForm
from CoercibleTo(OutputForm)
countable? : % -> Boolean

countable?(a) determines whether a is a countable cardinal, i.e. an integer or Aleph 0.

finite? : % -> Boolean

finite?(a) determines whether a is a finite cardinal, i.e. an integer.

generalizedContinuumHypothesisAssumed : Boolean -> Boolean

generalizedContinuumHypothesisAssumed(bool) is used to dictate whether the hypothesis is to be assumed.

generalizedContinuumHypothesisAssumed? : () -> Boolean

generalizedContinuumHypothesisAssumed?() tests if the hypothesis is currently assumed.

latex : % -> String
from SetCategory
leftPower : (%, NonNegativeInteger) -> %
from MagmaWithUnit
leftPower : (%, PositiveInteger) -> %
from Magma
leftRecip : % -> Union(%, "failed")
from MagmaWithUnit
max : (%, %) -> %
from OrderedSet
min : (%, %) -> %
from OrderedSet
one? : % -> Boolean
from MagmaWithUnit
opposite? : (%, %) -> Boolean
from AbelianMonoid
recip : % -> Union(%, "failed")
from MagmaWithUnit
retract : % -> NonNegativeInteger
from RetractableTo(NonNegativeInteger)
retractIfCan : % -> Union(NonNegativeInteger, "failed")
from RetractableTo(NonNegativeInteger)
rightPower : (%, NonNegativeInteger) -> %
from MagmaWithUnit
rightPower : (%, PositiveInteger) -> %
from Magma
rightRecip : % -> Union(%, "failed")
from MagmaWithUnit
sample : () -> %
from MagmaWithUnit
smaller? : (%, %) -> Boolean
from Comparable
zero? : % -> Boolean
from AbelianMonoid
~= : (%, %) -> Boolean
from BasicType

OrderedSet

Monoid

CoercibleFrom(NonNegativeInteger)

SemiGroup

CommutativeStar

TwoSidedRecip

Magma

CoercibleTo(OutputForm)

SetCategory

AbelianSemiGroup

Comparable

AbelianMonoid

PartialOrder

BasicType

MagmaWithUnit

RetractableTo(NonNegativeInteger)