scrambled
Book

Chapter 2 mathematical preliminaries

Modified just now

Sets, Relations, and Functions

Sets and Numbers

  • Standard notation:

    • Use {...}\{...\} for explicit lists or comprehension (e.g., {xS...}\{x \in S \mid ...\}).
    • \emptyset denotes the empty set.
    • STS \setminus T denotes set difference (elements in SS but not in TT).
    • S| S | denotes the size of set SS.
    • P(S)\mathcal{P}(S) is the powerset (set of all subsets) of SS.
  • Natural numbers (N\mathbb{N}): The set {0,1,2,...}\{0, 1, 2, ...\}.

  • Countable: A set is countable if it has a one-to-one correspondence with N\mathbb{N}.

Relations

  • n-place relation: An n-ary relation.

  • Predicate: A one-place (unary) relation on a set SS.

    Written P(s)P(s) or sPs \in P regarding PP as a function mapping to truth values.

  • Binary relation: A two-place relation on sets SS and TT.

    Often written sRts\,R\,t instead of (s,t)R(s, t) \in R.

  • Mixfix syntax: For readability, relations with 3+ places often use symbols separating elements to form the name (e.g., Γs:T\Gamma \vdash s : T).

  • Domain & Codomain:

    • Domain (dom(R)dom(R)): The set of elements sSs \in S such that (s,t)R(s,t) \in R for some tt.
    • Codomain/Range (range(R)range(R)): The set of elements tTt \in T such that (s,t)R(s,t) \in R for some ss.
  • Preservation: A predicate PP is preserved by a relation RR if sRss\, R\, s' and P(s)P(s) implies P(s)P(s').

Functions

  • Partial function: A relation RR where (s,t1)R(s, t_1) \in R and (s,t2)R(s, t_2) \in R implies t1=t2t_1 = t_2.

    • Defined: Written f(x)f(x)\downarrow means xdom(f)x \in dom(f).
    • Undefined: Written f(x)f(x)\uparrow or f(x)= f(x) =\ \perp means xdom(f)x \notin dom(f).
  • Total function: A partial function where dom(R)=Sdom(R) = S.

  • Failure: Distinct from divergence.

    Formally, a function that may fail maps ST{fail}S \to T \cup \{fail\}.

Ordered sets

Properties of binary relations

Given a relation RR on set SS:

  • Reflexive: sRss\, R\, s for all sSs \in S.
  • Symmetric: sRts\, R\, t implies tRst\, R\, s.
  • Transitive: sRts\, R\, t and tRut\, R\, u implies sRus\, R\, u.
  • Antisymmetric: sRts\, R\,t and tRst\, R\, s implies s=ts = t.

Types of orders

  • Preorder: A relation that is reflexive and transitive.

    • Notation: Often written \le or \lesssim.
    • Strict inequality (s<ts < t): Means ststs \le t \land s \neq t.
  • Partial order: A preorder that is also antisymmetric.

  • Total order: A partial order where for every s,ts, t, either sts \le t or tst \le s.

  • Equivalence: A relation that is reflexive, transitive, and symmetric.

Bounds and Closures

  • Join (Least upper bound \lor): An element jj is the join of ss and tt if sjs \le j, tjt \le j, and jj is less than or equal to any other upper bound kk.

  • Meet (Greatest lower bound \land): An element mm is the meet of ss and tt if msm \le s, mtm \le t, and mm is greater than or equal to any other lower bound nn.

  • Closures:

    • Reflexive closure: The smallest reflexive relation containing RR.
    • Transitive closure (R+R^+): The smallest transitive relation containing RR.
    • Reflexive and transitive closure (RR^*): The smallest relation containing RR that is both reflexive and transitive.

Chains and well-foundedness

  • Decreasing chain: A sequence s1,s2,...s_1, s_2, ... where si+1<sis_{i+1} < s_i.

  • Well-founded: A preorder is well-founded if it contains no infinite decreasing chains.

    • Example: Standard order on N\mathbb{N} is well-founded; standard order on integers is not.

Sequences

  • Notation: Elements are separated by commas (e.g., 3,2,13, 2, 1).

  • Cons and Append: The comma serves as both "cons" (adding an element) and "append" (joining sequences).

    • Example: If a=3,2,1a = 3,2,1, then 0,a0,a is 0,3,2,10,3,2,1.
  • Range: 1..n1..n abbreviates the sequence from 11 to nn.

  • Length: a| a | denotes the length of sequence aa.

  • Empty sequence: Written as ϵ\epsilon or a blank.

  • Permutation: A sequence containing the same elements as another, possibly in a different order.

Induction

Induction on natural numbers

  • Axiom: Principle of ordinary induction

    If P(0)P(0) holds, and P(i)    P(i+1)P(i) \implies P(i+1) for all ii, then P(n)P(n) holds for all nn.

  • Axiom: Principle of complete induction

    If showing P(n)P(n) is possible assuming P(i)P(i) for all i<ni < n, then P(n)P(n) holds for all nn.

Lexicographic induction

  • Lexicographic order: On pairs of numbers, (m,n)(m,n)(m,n) \le (m', n') iff m<mm < m' OR (m=mm = m' and nnn \le n').

  • Axiom: Principle of lexicographic induction

    If showing P(m,n)P(m, n) is possible assuming P(m,n)P(m', n') for all (m,n)<(m,n)(m', n') < (m, n), then P(m,n)P(m, n) holds for all pairs.

  • Usage: Generalized to triples, 4-tuples, etc. Useful for nested inductions.


Exercises

Exercise 2.2.6

Problem: Suppose we are given a relation RR on a set SS. Define the relation RR^{\prime} as follows:

R=R{(s,s)sS}R^{\prime} = R \cup \{(s,s) \mid s \in S\}

That is, RR^{\prime} contains all the pairs in RR plus all pairs of the form (s,s)(s,s) .

Task: Show that RR^{\prime} is the reflexive closure of RR.

Solution

Take RR'' to be the reflexive closure of RR.

By definition:

  • RR'' is reflexive.
  • RRR \subseteq R''.
  • For any reflexive relation SS such that RSR \subseteq S, we have RSR'' \subseteq S.

By the problem statement, RR' is reflexive and RRR \subseteq R'.

Therefore, RRR'' \subseteq R'.

Now, it suffices to show that RRR' \subseteq R''.

Take an element xRx \in R'.

  • If xRx \in R, then xRx \in R''.
  • If x=(s,s)x = (s,s) for some sSs \in S, then xRx \in R'' because RR'' is reflexive.

Therefore, RRR' \subseteq R''.

In conclusion, RRR' \equiv R'' or RR' is the reflexive closure of RR.

Exercise 2.2.7

Problem: Here is a more constructive definition of the transitive closure of a relation RR. First, we define the following sequence of sets of pairs:

  • R0=RR_{0} = R
  • Ri+1=Ri{(s,u)for some t,(s,t)Ri and (t,u)Ri}R_{i+1} = R_{i} \cup \{(s,u) \mid \text{for some } t, (s,t) \in R_{i} \text{ and } (t,u) \in R_{i}\}

That is, we construct each Ri+1R_{i+1} by adding to RiR_{i} all the pairs that can be obtained by "one step of transitivity" from pairs already in RiR_{i}. Finally, define the relation R+R^{+} as the union of all the RiR_{i}: R+=iRiR^{+} = \bigcup_{i} R_{i}.

Task: Show that this R+R^{+} is really the transitive closure of RR-i.e., that it satisfies the conditions given in Definition 2.2.5.

  • Problem

    Take RR' to be the transitive closure of RR.

    By definition:

    • RR' is transitive.

    • RRR \subseteq R'.

    • For any transitive relation SS such that RSR \subseteq S, we have RSR' \subseteq S.

    • Prove that R+R^+ is transitive

      Suppose there exist s,r,ts, r, t such that (s,r)R+(s, r) \in R^+ and (r,t)R+(r, t) \in R^+ but (s,t)R+(s, t) \notin R^+.

      Because (s,r)R+(s, r) \in R^+, there exists i0i_0 such that (s,r)Ri0(s, r) \in R_{i_0}.

      Similarly, there exists i1i_1 such that (r,t)Ri1(r, t) \in R_{i_1}.

      Therefore, we have (s,r)Rmini0,i1(s, r)\in R_{\min{i_0, i_1}} and (r,t)Rmini0,i1(r, t)\in R_{\min{i_0, i_1}}. Then, (s,t)Rmini0,i1+1R+(s,t) \in R_{\min{i_0, i_1} + 1} \subseteq R^+. This is a contradiction.

    • It's obvious that RR+R \subseteq R^+.

    • Therefore, RR+R' \subseteq R^+.

    • Prove that R+RR^+ \subseteq R'

      It's obvious that R0RRR_0 \equiv R \subseteq R'.

      Suppose for RiRR_i \subseteq R' for some i0i\ge 0.

      We will prove that Ri+1RR_{i+1} \subseteq R'. This is trivial.

      By induction, RiRR_i \subseteq R' for any i0i \ge 0.

      Therefore, R+RR^+ \subseteq R'.

    • In conclusion, R+RR^+ \equiv R'.

Exercise 2.2.8

Problem: Suppose RR is a binary relation on a set SS and PP is a predicate on SS that is preserved by RR.

Task: Show that PP is also preserved by RR^{*} (the reflexive and transitive closure of RR).

  • Problem

    Because PP is a predicate on SS that is preserved by RR: For any r,tSr, t \in S such that rRtr\, R\, t, we have P(r)    P(t)P(r) \implies P(t).

    Take RrefR^{ref} to be the reflexive closure of RR.

    Then, RR^* is the transitive closure of RrefR^{ref}.

    Assume r,tSr, t \in S such that rRtr\,R^*\,t.

    • If rRtr\,R\,t, it's trivial that PP is preserved.

    • If rtr\not R\, t but rRreftr\, R^{ref}\, t, then r=tr=t. Therefore, PP is also preserved.

    • If r̸Rreftr\not R^{ref}\, t but rRtr\, R^{*}\, t, that means rRitr\, R_i\, t for some i0i \ge 0, with RiR_i as defined in the previous exercise.

      Assume ii is smallest such number.

      • ii must not be 00, else we would have rRreftr\, R^{ref}\, t, a contradiction.

      • Assume that if riRitir_i\, R_i\,t_i then P(ri)    P(ti)P(r_i) \implies P(t_i).

        We will prove that if ri+1Ri+1ti+1r_{i+1}\, R_{i+1}\,t_{i+1} then P(ri+1)    P(ti+1)P(r_{i+1}) \implies P(t_{i+1}).

        By assumption, ri+1̸Riti+1r_{i+1} \not R_i\, t_{i+1}.

        Therefore, there exists ss such that ri+1Risr_{i+1}\, R_i\, s and sRiti+1s\, R_i\, t_{i+1}.

        By the induction hypothesis, we have P(ri+1)    P(s)P(r_{i+1}) \implies P(s) and P(s)    P(ti+1)P(s) \implies P(t_{i+1}).

        It follows that, P(ri+1)    P(ti+1)P(r_{i+1}) \implies P(t_{i+1}).

        By induction, if rRitr\, R_i\, t for any ii, we have P(r)    P(t)P(r) \implies P(t).

      This concludes our proof.