Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 28 additions & 24 deletions docs/algebra.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@ The `algebra.ring` package contains more sophisticated structures which combine

All ring-like structures are associative for both `+` and `*`, have commutative `+`, and have a `zero` element (an identity for `+`).

|Name |Has `negate`?|Has `1`?|Has `reciprocal`?|Commutative `*`?|
|--------------------|-------------|--------|-----------------|----------------|
|Semiring | | | | |
|Rng | ✓| | | |
|Rig | | ✓| | |
|CommutativeRig | | ✓| | ✓|
|Ring | ✓| ✓| | |
|CommutativeRing | ✓| ✓| | ✓|
|Semifield | | ✓| ✓| |
|CommutativeSemifield| | ✓| ✓| ✓|
|Field | ✓| ✓| ✓| ✓|

| Name | Has `negate`? | Has `1`? | Has `reciprocal`? | Commutative `*`? | Has `gcd`/`lcm`? | Has `quot`/`mod`? |
|----------------------|----------------|-----------|--------------------|-------------------|-------------------|--------------------|
| Semiring | | | | | | |
| Rng | ✓ | | | | | |
| Rig | | ✓ | | | | |
| CommutativeSemiring | | | | ✓ | | |
| CommutativeRng | ✓ | | | ✓ | | |
| CommutativeRig | | ✓ | | ✓ | | |
| Ring | ✓ | ✓ | | | | |
| CommutativeRing | ✓ | ✓ | | ✓ | | |
| Semifield | | ✓ | ✓ | | | |
| CommutativeSemifield | | ✓ | ✓ | ✓ | | |
| GCDRing | ✓ | ✓ | | ✓ | ✓ | |
| EuclideanRing | ✓ | ✓ | | ✓ | ✓ | ✓ |
| Field | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |

(For a description of what the terminology in each column means, see [§algebraic properties and terminology](#algebraic-properties-and-terminology).)

Expand Down Expand Up @@ -88,18 +91,19 @@ The law of the excluded middle can be expressed as:

- `(a ∨ (a → 0))` = `1`

|Name |Has `join`?|Has `meet`?|Has `zero`?|Has `one`?|Distributive|Has `imp`?|Excludes middle?|
|--------------------------|-----------|-----------|-----------|----------|------------|----------|----------------|
|JoinSemilattice | ✓| | | | | | |
|MeetSemilattice | | ✓| | | | | |
|BoundedJoinSemilattice | ✓| | ✓| | | | |
|BoundedMeetSemilattice | | ✓| | ✓| | | |
|Lattice | ✓| ✓| | | | | |
|DistributiveLattice | ✓| ✓| | | ✓| | |
|BoundedLattice | ✓| ✓| ✓| ✓| | | |
|BoundedDistributiveLattice| ✓| ✓| ✓| ✓| ✓| | |
|Heyting | ✓| ✓| ✓| ✓| ✓| ✓| |
|Bool | ✓| ✓| ✓| ✓| ✓| ✓| ✓|
| Name | Has `join`? | Has `meet`? | Has `zero`? | Has `one`? | Distributive | Has `imp`? | Excludes middle? |
|----------------------------|-------------|-------------|-------------|------------|--------------|------------|------------------|
| JoinSemilattice | ✓ | | | | | | |
| MeetSemilattice | | ✓ | | | | | |
| BoundedJoinSemilattice | ✓ | | ✓ | | | | |
| BoundedMeetSemilattice | | ✓ | | ✓ | | | |
| Lattice | ✓ | ✓ | | | | | |
| DistributiveLattice | ✓ | ✓ | | | ✓ | | |
| BoundedLattice | ✓ | ✓ | ✓ | ✓ | | | |
| BoundedDistributiveLattice | ✓ | ✓ | ✓ | ✓ | ✓ | | |
| Heyting | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| GenBool | ✓ | ✓ | ✓ | | ✓ | | |
| Bool | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |

Note that a `BoundedDistributiveLattice` gives you a `CommutativeRig`, but not the other way around: rigs aren't distributive with `a + (b * c) = (a + b) * (a + c)`.

Expand Down
Loading