Skip to content

Commit

Permalink
documentation on hashtag operator
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed Dec 2, 2024
1 parent a708ffd commit f356dcc
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/reference-material/terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,35 @@ When coding in Ampersand, these operators are typed with characters on the keybo
| right residual | `\` | $$\backslash$$ | |
| diamond | `<>` | $$\Diamond$$ | |
| relational product | `!` | $$\dagger$$ | associative |
| cartesian product | `#` | $$\times$$ | |
| hashtag | `#` | $$\times$$ | This is syntactical sugar for `;V;` |
| reflexive transitive closure | `*` | $$$$ | |
| transitive closure | `+` | $$+$$ | |

::: info Note on `hashtag`

`hashtag` used to be pronounced as `cartesian product`. However, this is an incorrect term for this operator. The Cartesian product of two terms \( R \) and \( S \) is defined as the set of all pairs where the first element is a pair from \( R \) and the second element is a pair from \( S \). Mathematically:

$$
R \times S = \{ ((a, b), (c, d)) \mid (a, b) \in R \text{ and } (c, d) \in S \}.
$$

***Explanation***:
1. **Relation $ R $:** A subset of the Cartesian product of two sets $$ A $$ and $$ B $$, i.e., $$ R \subseteq A \times B $$.
2. **Relation $ S $:** A subset of the Cartesian product of two sets $$ C $$ and $$ D $$, i.e., $$ S \subseteq C \times D $$.

The Cartesian product $$ R \times S $$ forms a new term in which each element is a pair of pairs: one pair from $$ R $$ and another pair from $$ S $$.

***Example***:
Let $$ R = \{(1, 2), (3, 4)\} $$ and $$ S = \{(5, 6), (7, 8)\} $$. Then:

$$
R \times S = \{((1, 2), (5, 6)), ((1, 2), (7, 8)), ((3, 4), (5, 6)), ((3, 4), (7, 8))\}.
$$

This concept extends the Cartesian product of sets to relations by treating each relation as a collection of pairs.

:::

## Semantics

We present the semantics of terms in 5 different (but equivalent) ways: one explanation in terms of logic, one in set theory, one in terms of axioms (algebraically), one in natural language, and one visual explanation. These ways are equivalent, so you can interpret a term in any of the presented ways. Any way will do; take your pick!
Expand Down

0 comments on commit f356dcc

Please sign in to comment.