%! TEX root = LST.tex
% vim: tw=50
% 29/02/2024 09AM

\begin{flashcard}[eps-induction-thm]
\begin{theorem}[Principle of $\in$-induction]
  \glsnoundefn{epsind}{$\in$-induction}{N/A}
  For any \gls{form} $p$ with $\FV(p) = \{x, t_1,
  \ldots, t_n\}$, we have
  \[ (\pforall t_1) \cdots (\pforall t_n)
  ((\pforall x)[(\pforall y)(y \zin x \pimpl p(y))
  \pimpl p(x)] \pimpl (\pforall x) p(x)) .\]
\end{theorem}

\begin{proof}
  \cloze{Fix $t_1, \ldots, t_n$ and assume
  \[ (\pforall x)(((\pforall y \zin x) p(y))
  \pimpl p(x)) \]
  holds. We want to show that $(\pforall x) p(x)$
  holds. Assume not, so $\pnot p(x)$ holds for
  some $x$. We'd like to pick an $\zin$-minimal
  member of $\{y \st \pnot p(y)\}$, but this is
  not a set. Choose a \gls{transset} set $t$ such that
  $x \in t$. For example can pick $t =
  \TC(\{x\})$. By \gls{Sep} we can form the set $u
  = \{y \zin t \st \pnot p(y)\}$. Note that $x \in
  u$ so $u \neq \emptyset$. Let $z$ be an
  $\zin$-minimal membet of $u$ (exists by
  \gls{Fnd}). If $y \zin z$, then $y \zin t$ ($t$
  is \gls{transset}) and $y \notin u$ (by
  minimality), so $p(y)$ holds. By assumption
  $p(z)$ holds, which contradicts $z \zin u$.}
\end{proof}
\end{flashcard}

\begin{remark*}
  In the presence of axioms (1) - (8) of \gls{ZF},
  \gls{Fnd} is equivalent to the principle of
  \gls{epsind}.
\end{remark*}

\begin{proof}
  Assume \gls{epsind} (as well as axioms (1) -
  (8)). We deduce \gls{Fnd}. Clever idea: say
  ``$x$ is regular'' to mean
  \[ (\pforall y)(x \zin y \pimpl \text{``$y$ has
  $\zin$-minimal member''}) \]
  We prove by \gls{epsind} that $(\pforall
  x)(\text{``$x$ is regular''})$. This obviously
  implies \gls{Fnd}. Fix a set $x$ and assume that
  $y$ is regular for all $y \zin x$. We want to
  deduce that $x$ is regular.

  Let $z$ be a set such that $x \zin z$. Then:
  \begin{itemize}
    \item either $x$ is an $\zin$-minimal membet
      of $z$
    \item or there's $y \zin z$ such that $y \zin
      x$. By induction hypothesis, $y$ is regular,
      so $z$ has an $\eps$-minimal member.
  \end{itemize}
\end{proof}

\textbf{Next step:} $\zin$-recursion. Want to
define functions such that $f(x)$ depends on
$f(y)$, $y \in x$, i.e. $f(x)$ depends on $f|_x$.

\begin{flashcard}[eps-recursion-thm]
\begin{theorem}[$\in$-recursion theorem]
  \glsnoundefn{epsrec}{$\in$-recursion}{N/A}
  \cloze{For any \gls{funccls} $G$ (given by a formula
  $p$ with two \gls{freev} \glspl{var} such that
  $(x, y) \in G \iff p(x, y)$ holds) which is
  defined everywhere (so $(\pforall x)(\pexists y)
  p(x, y)$), then there is a \gls{funccls} $F$
  (given by some formula $q$) defined everywhere
  such that
  \[ (\pforall x)(F(x) = G(F|_x)) .\]
  Moreover, $F$ is unique.}
\end{theorem}

\fcscrap{
\begin{note*}
  $F|_x$ is a set by \gls{Rep}: $F|_x = \{(s, t)
  \st s \zin x, t = F(s)\}$ is the image of the
  set $x$ under the \gls{funccls} $s \mapsto (s,
  F(s))$.
\end{note*}
}

\begin{proof}
  \cloze{\textbf{Uniqueness:} Assume $F_1, F_2$ both
  satisfy the theorem. Then we prove $(\pforall
  x)(F_1(x) = F_2(x))$ by \gls{epsind}. If
  $F_1(y) = F_2(y)$ $\pforall y \zin x$, then
  $F_1|_x = F_2|_x$, so $F_1(x) = F_2(x)$.

  \textbf{Existence:} Say ``$f$ is an attempt'' to
  mean
  \[ \text{``$f$ is a function''} \pand
  \text{``$\dom f$ is \gls{transset}''} \pand
  (\pforall x \zin \dom f)(f(x) = G(f|_x)) .\]
  Note that $f|_x$ makes sense as $\dom f$ is
  \gls{transset}. We prove by \gls{epsind}
  that
  \[ (\pforall f)(\pforall g)(\pforall
  x)((\text{``$f$ is an attempt''} \pand
  \text{``$g$ is an attempt''} \pand (x \zin \dom
  f \cap \dom g)) \pimpl (f(x) = g(x))) \]
  Call this property $(*)$. Then we show by
  \gls{epsind} that
  \[ (\pforall x)(\pexists f)(\text{``$f$ is an
  attempt''} \pand (x \zin \dom f)) .\]
  Call this property $(**)$. Fix $x$. Assume every
  $y \zin x$ is in the domain of some attempt,
  which is then defined on $\TC(\{y\})$ and is
  unique by $(*)$ -- call this $f_y$. Then
  \[ f' = \bigcup \{f_y \st y \zin x\} \]
  is an attempt by $(*)$, and is a set by
  \gls{Rep}. Finally $f = f' \cup \{(x, G(f'))\}$
  is an attempt defined at $x$. Note that $f|_x =
  f'$. Let $q$ be the formula:
  \[ (\pexists f)(\text{``$f$ is an attempt''}
  \pand (y = f(x))) .\]
  Then $q$ defines the required \gls{funccls}
  $F$.}
\end{proof}
\end{flashcard}

We can generalise induction and recursion to other
relations. Let $r$ be a relation (i.e. a
\gls{form} with two \gls{freev} \glspl{var}).

\begin{flashcard}[well-founded-defn]
\begin{definition*}[Well-founded]
  \glsadjdefn{wfdd}{well-founded}{relation}
  \cloze{We say a relation $r$ is \emph{well-founded} if
  \[ (\pforall x)((\pnot x = \emptyset) \pimpl
  (\pexists y \zin x)((\pforall z \zin x)(\pnot z
  r y))) \]
  (i.e. every non-emptyer set has an $r$-minimal
  member).}
\end{definition*}
\end{flashcard}

\begin{example*}
  If $r$ is $(x \zin y)$ is the $\zin$-relation,
  then $r$ is \gls{wfdd} by \gls{Fnd}.
\end{example*}

\begin{flashcard}[local-defn]
\begin{definition*}[Local]
  \glsadjdefn{local}{local}{relation}
  \cloze{We say a relation $r$ is \emph{local} if
  \[ (\pforall x)(\pexists y)(\pforall z)(z \zin y
  \iff z r x) .\]
  (i.e. the $r$-predecessors of $x$ form a set).}
\end{definition*}
\end{flashcard}

\begin{example*}
  $\zin$ is \gls{local}: the $\zin$ predecessors
  of $x$ is precisely the set $x$.
\end{example*}

\vspace{-1em}

\glsnoundefn{rind}{$r$-induction}{N/A}
\glsnoundefn{rrec}{$r$-recursion}{N/A}
``\glsref[local]{Local}'' is needed for
$r$-closure. Then we can prove $r$-induction and
$r$-recursion.

Can restrict $r$ to a class or a set. Note that if
$r$ is a relation on a set $a$, then for any $x
\zin a$, $\{y \zin a \st y r x\}$ is a set by
\gls{Sep}. So we only need well-foundedness to
have $r$-induction and $r$-recursion on $a$.

Is this really more general than $\zin$? No,
provided we also assume that $r$ is
\emph{extensional} on $a$:

\begin{flashcard}[extensional-defn]
\begin{definition*}[Extensional]
  \glsadjdefn{extensional}{extensional}{relation}
  \cloze{
  We say a relation $r$ is \emph{extensional} if:
  \[ (\pforall x, y \zin a)((\pforall z \zin a)((z r
  x) \iff (z r y)) \pimpl x = y) .\]}
\end{definition*}
\end{flashcard}
