my forest

start on sums

+48 -3
+1 -3
trees/dt/dt-001Z.tree
··· 6 6 \p{This lecture is based on material from [[haskellhutt]], [[danascott]], [[jstoy]], [[cgunter]], and [[gwinskel]].} 7 7 \transclude{dt-002K} 8 8 \transclude{dt-002Z} 9 - \subtree{ 10 - \title{Sums} 11 - } 9 + \transclude{dt-0030} 12 10 \subtree{ 13 11 \title{Strict Constructions} 14 12 }
+9
trees/dt/dt-0030.tree
··· 1 + \import{dt-macros} 2 + \title{Sums} 3 + \author{liamoc} 4 + \transclude{dt-0031} 5 + \subtree{ 6 + \title{Primitive functions for sums} 7 + \author{liamoc} 8 + \transclude{dt-0032} 9 + }
+25
trees/dt/dt-0031.tree
··· 1 + \import{dt-macros} 2 + \taxon{Construction} 3 + \author{liamoc} 4 + \title{Sum of [cpos](dt-001D)} 5 + \p{ 6 + The \em{sum} construct on [cpo](dt-001D) #{A + B} denotes a disjoint union of two [cpos](dt-001D) with a new, dedicated [#{\bot} value](dt-000A): 7 + ##{ 8 + A + B = \{ (0, a) \mid a \in A \} \cup \{ (1, b) \mid b \in B \} \cup \{ \bot_{A+B} \} 9 + } 10 + This construct is a [cpo](dt-001D) under the [ordering](dm-0000): 11 + ##{ 12 + x \sqsubseteq y\;\;\text{iff}\;\;\begin{cases} \text{true} & \text{if}\ x=\bot_{A+B}\\ a \sqsubseteq a' & \text{if}\ x = (0,a)\ \text{and}\ y = (0, a') \\ b \sqsubseteq b' & \text{if}\ x = (1,b)\ \text{and}\ y = (1, b') \\ 13 + \text{false} & \text{otherwise} \end{cases} 14 + } 15 + Intuitively, this says that the [ordering](dm-0000) on #{A + B} is the same as #{A} and #{B} separately, except that #{\bot_{A+B}} is less than anything.} 16 + \p{ The only [directed sets](dt-0010) are those that do \em{not} contain a mixture of elements from both #{A} and from #{B}, so the [least upper bound](dt-0017) operator is essentially the same as the [least upper bounds](dt-0017) for #{A} and for #{B}. Formally: 17 + ##{ 18 + \bigsqcup X \;\; = \;\; \begin{cases} 19 + (0,\bigsqcup \Set{ a \mid (0,a) \in X }) & \text{if}\ \Set{ a \mid (0,a) \in X } \neq \emptyset \\ 20 + (1,\bigsqcup \Set{ b \mid (1,b) \in X }) & \text{if}\ \Set{ b \mid (1,b) \in X } \neq \emptyset\\ 21 + \bot_{A+B} & \text{otherwise}\\ 22 + \end{cases} 23 + } 24 + 25 + }
+13
trees/dt/dt-0032.tree
··· 1 + \import{dt-macros} 2 + \taxon{Definition} 3 + \author{liamoc} 4 + \title{Constructors for sums} 5 + \p{For \em{constructing} sums, we use two primitive constructor functions, #{\mathit{inl}} and #{\mathit{inr}}: 6 + ##{ 7 + \begin{array}{l} 8 + \mathit{inl} : A \contto (A + B)\\ 9 + \mathit{inl}(x) = (0,x)\\[1em] 10 + \mathit{inr} : B \contto (A + B)\\ 11 + \mathit{inr}(y) = (1,y) 12 + \end{array} 13 + }}