From: Michael Orlitzky Date: Mon, 4 Nov 2019 14:35:02 +0000 (-0500) Subject: mjo-set: adopt \set and \setc from mjo-common. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=77f02015fe36069f7db4277902bb89654821e947;p=mjotex.git mjo-set: adopt \set and \setc from mjo-common. --- diff --git a/examples.tex b/examples.tex index f922d65..3a1d6c4 100644 --- a/examples.tex +++ b/examples.tex @@ -73,9 +73,8 @@ \begin{section}{Common} The function $f$ applied to $x$ is $f\of{x}$. We can group terms - like $a + \qty{b - c}$ or $a + \qty{b - \sqty{c - d}}$. Here's a - set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. The tuples go - up to seven, for now: + like $a + \qty{b - c}$ or $a + \qty{b - \sqty{c - d}}$. The tuples + go up to seven, for now: % \begin{itemize} \begin{item} @@ -290,8 +289,9 @@ \end{section} \begin{section}{Set theory} - The cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X} - = 3$, and its powerset is $\powerset{X}$. + Here's a set $\set{1,2,3} = \setc{n \in \Nn[1]}{ n \le 3 }$. The + cardinality of the set $X \coloneqq \set{1,2,3}$ is $\card{X} = + 3$, and its powerset is $\powerset{X}$. We also have a few basic set operations, for example the union of two or three sets: $\union{A}{B}$, $\unionthree{A}{B}{C}$. And of diff --git a/mjo-common.tex b/mjo-common.tex index 0fcc2aa..f14b60d 100644 --- a/mjo-common.tex +++ b/mjo-common.tex @@ -17,15 +17,6 @@ % Group terms using square brackets. \newcommand*{\sqty}[1]{ \left[{#1}\right] } -% Create a set from the given elements -\newcommand*{\set}[1]{\left\lbrace{#1}\right\rbrace} - -% A set comprehension, where the ``such that...'' bar is added -% automatically. The bar was chosen over a colon to avoid ambiguity -% with the L : V -> V notation. We can't leverage \set here because \middle -% needs \left and \right present. -\newcommand*{\setc}[2]{\left\lbrace{#1}\ \middle|\ {#2} \right\rbrace} - % A pair of things. \newcommand*{\pair}[2]{ \left({#1},{#2}\right) } diff --git a/mjo-set.tex b/mjo-set.tex index 2134e64..4177f5a 100644 --- a/mjo-set.tex +++ b/mjo-set.tex @@ -15,6 +15,15 @@ \usepackage{mathtools} \fi +% Create a set from the given elements +\newcommand*{\set}[1]{\left\lbrace{#1}\right\rbrace} + +% A set comprehension, where the ``such that...'' bar is added +% automatically. The bar was chosen over a colon to avoid ambiguity +% with the L : V -> V notation. We can't leverage \set here because \middle +% needs \left and \right present. +\newcommand*{\setc}[2]{\left\lbrace{#1}\ \middle|\ {#2} \right\rbrace} + % The cardinality of a set. The |X| notation conflicts with the % absolute value, and the meaning of card(X) is clear at once, so we