# A limit-computable, self-reflective distribution

$$\newcommand{\ts}{\times}$$
$$\newcommand{\sbs}{\subset}$$
$$\newcommand{\sbse}{\subseteq}$$
$$\newcommand{\sbsne}{\subsetneq}$$
$$\newcommand{\sps}{\supset}$$
$$\newcommand{\spse}{\supseteq}$$
$$\newcommand{\spsne}{\supsetneq}$$
$$\newcommand{\proves}{\vdash}$$

$$\newcommand{\PP}{\mathbb{P}}$$
$$\newcommand{\QQ}{\mathbb{Q}}$$
$$\newcommand{\NN}{\mathbb{N}}$$
$$\newcommand{\PA}{\mathsf{PA}}$$
$$\newcommand{\ZFC}{\mathsf{ZFC}}$$
$$\newcommand{\TT}{T}$$
$$\newcommand{\LL}{\mathcal{L}}$$
$$\newcommand{\unit}{[0,1]}$$
$$\newcommand{\imp}{\Rightarrow}$$
$$\newcommand{\pp}{P}$$
$$\newcommand{\godel}[1]{\ulcorner #1 \urcorner}$$
$$\newcommand{\eps}{\varepsilon }$$

$$\newcommand{\dist}{\Psi}$$
$$\newcommand{\distTwo}{\Lambda}$$
$$\newcommand{\distThree}{\Upsilon}$$
$$\newcommand{\behaviors}{\mathfrak{B}_{\dist}}$$
$$\newcommand{\behaviorsTwo}{\mathfrak{B}_{\distTwo}}$$
$$\newcommand{\behaviorsThree}{\mathfrak{B}_{\distThree}}$$

$$\newcommand{\Dists}[1]{\Delta(#1)}$$
$$\newcommand{\con}{\texttt{Con}}$$
$$\newcommand{\coh}[1]{\texttt{Coh}_{#1}}$$
$$\newcommand{\refl}{\texttt{Refl}}$$
$$\newcommand{\corr}[1]{\lhd_{#1}}$$
$$\newcommand{\TTrefl}[2]{\TT_{#1 = #2 }}$$
$$\newcommand{\bx}{\mathfrak{b}}$$
$$\newcommand{\sub}{\texttt{Divide}}$$
$$\newcommand{\inhab}{\texttt{Inhabited}}$$
$$\newcommand{\incompZ}{Z}$$
$$\newcommand{\compZ}{\bar Z}$$
$$\newcommand{\incompU}{U}$$
$$\newcommand{\compU}{\bar U}$$
$$\newcommand{\pptwo}{\PP_{\compZ}}$$
$$\newcommand{\basic}{\text{Th}(\QQ)}$$


We present a $\Delta_2$-definable probability distribution $\dist$ that satisfies Christiano's reflection schema for its own defining formula. The strategy is analogous to the chicken step
employed by modal decision theory to obfuscate itself from the eyes of $\PA$; we will prevent the base theory $\TT$ from knowing much about $\dist$, so that
$\dist$ can be coherent over $\TT$ and also consistently believe in reflection statements. So, the method used here is technical and not fundamental, but it does at
least show that limit-computable and reflective distributions exist. These results are due to Sam Eisenstat and me, and this post benefited greatly from
extensive notes from Sam; any remaining errors are probably mine.

Prerequisites: we assume familiarity with Christiano's original result and the methods used there. In particular, we will freely use Kakutani's fixed point
theorem. See [Christiano et al.'s paper](https://intelligence.org/files/DefinabilityTruthDraft.pdf).



***

### Outline
* Section  1. Introduction and problem statement
* Section 2. A definable, self-reflective distribution $\dist$
* Section 3. A $\Delta_2$-definable, self-reflective distribution $\distTwo$
* Section 4. Discussion and open problems

## Section 1. Problem statement

### Probabilistic reflection

We have some base theory $\TT$ in a language $\LL$, where $\TT$ is able to talk about arithmetic (e.g. $\PA$ or $\ZFC$). We
wish to find probability distributions over completions of $\TT$, or equivalently functions $\PP: \LL \to \unit$
satisfying $\phi \in \TT$ implies $\PP(\phi) = 1$ and probabilistic coherence conditions like $\PP(\neg \phi) = 1-\PP(\phi)$. In particular, we want $\PP$ to
have accurate beliefs about itself:

$$\forall \phi \in \LL : \forall a,b \in \QQ : \PP(\phi) \in (a,b) \imp \PP( \pp(\godel{\phi}) \in (a,b)) = 1\ , $$

where $\pp$ is a symbol in $\LL$. Christiano showed that there exists such a distribution $\PP$. In other words, taking an additional symbol $\PP$ in the
metalanguage, writing $\coh{\TT}(\PP)$ for the
statement that $\PP$ is a coherent distribution over $\TT$,  and $\refl(\PP)$ for the statement that $\PP$ is reflective, we have that the theory  

$$\ZFC + \coh{\TT}(\PP) + \refl(\PP)$$

is consistent. That consistency of this theory is equivalent to the existence of a reflective $\PP$ requires an argument due to Fallenstein, wherein we take
the standard part of $\PP$ according to some completion of this theory.  We will use this idea in Section 3 and explain it there.

### Definable reflection

Christiano asked: Can we find a distribution that is  definable, and furthermore reflective about its own defining formula?  
This is different from the original reflective $\PP$ because we had a symbol $\pp$ in the language, and $\PP$ reflected itself in that symbol; in that case, 
speaking imprecisely, $\PP$
knew that $\pp$ assigned the same probabilities that $\PP$ assigned. Now we want a formula $\dist$ that defines a distribution, and that distribution assigns
probability 1 to certain true statements about what probabilities $\dist$ assigns. ($\dist$ stands for $P$-Self-reflective.) 

Formally, can we have a coherent distribution on $T$ defined by some formula  $\dist$ in the language $\LL$, where
$\LL$ now does not contain a distinguished symbol $\pp$, satisfying: 

$$\forall \phi \in \LL : \forall a,b \in \QQ :\text{ if } \dist(\godel{\phi}) \in (a,b) \text{, then }\dist(\godel{ \dist(\godel{\phi}) \in (a,b)}) = 1\ ? $$

Our strategy is to apply Kakutani's fixed point theorem to the following reflection correspondence $\corr{\dist}$ on the set $\Dists{\TT} \sbs \unit^L$ of coherent
distributions over $\TT$. For any $P,Q \in \Dists{\TT}$, we write 
$P \corr{\dist} Q$ and say that  $Q$ reflects $P$ in $\dist$  if and only if, whenever $P(\phi)$ is in some interval, $Q$ believes that $\dist$ assigns
to $\phi$ a value in that interval. Formally, for all $P,Q \in \Dists{\TT}$, we have $P \corr{\dist} Q$ if and only if: 

$$\forall \phi \in \LL : \forall a,b \in \QQ : \text{ if } P(\phi) \in (a,b) \text{, then }Q( \dist(\godel{\phi}) \in (a,b)) = 1\ . $$

If we can obtain a fixed point of this correspondence $\corr{\dist}$, and have $\dist$ define this same distribution, then we will have a
definable self-reflective distribution. 

(The notation $\corr{\dist}$ does *not* denote an ordering, and is meant to suggest a single point on the left with a
larger corresponding set on the right; better recommendations are welcome. Also, in the following section, $P$ and $Q$ are actual distributions, not symbols in a language; this is
distinguished by their arguments having the type of formulas rather than Gödel numbers of formulas.)

Most of the conditions for Kakutani's theorem are satisfied by $\corr{\phi}$ for any formula $\phi$ just as in Christiano's proof, so we won't verify them in
detail. For example, the set of  distributions reflect $Q$ in $\phi$ is still convex, because interpolation preserves coherence and reflection. (I can make an
auxiliary post if people would like to see the details.) However, we need $\corr{\dist}$ to satisfy the crucial non-emptiness condition: 

$$\forall P \in \Dists{\TT} : \exists Q \in \Dists{\TT} : P \corr{\dist} Q\ . $$

In the next section, we give a definition $\dist$ that  meets this criterion, assuming a strong background theory such as $\ZFC$. This will illustrate the
diagonalization method we will apply. Section 3 gives a $\distTwo$ that uses the same strategy as $\dist$, but is $\Delta_2$-definable in
arithmetic, i.e. computable relative to a halting oracle. Section 4  discusses the meta-theoretic assumptions used, optimality of our results, and open
questions.


## Section 2. A definable, self-reflective distribution $\dist$

Consider the theory $\TTrefl{\dist}{P} := \TT \cup \{ \dist(\godel{\phi}) \in (a,b)\ |\ \phi \in \LL, a,b \in \QQ, P(\phi) \in (a,b) \}$ stating that $\dist$ behaves according to $P$. 
If $\TTrefl{\dist}{P}$ is a consistent theory,
then we can take a completion $\TT'$ of $\TTrefl{\dist}{P}$, and then take the 0-1-valued distribution $Q(\phi) := \mathbb{I}\{\phi \in \TT'\}$, i.e. the
indicator function for membership in the complete theory $\TT'$. This $Q$
is coherent over $\TT$, and furthermore by fiat $Q$ assigns probability 1 to each reflection statement for $P$ by $\dist$. 

In the original existence proof of a reflective $\PP$, the analogous reflection theory  $\TTrefl{p}{P}$ for a symbol $p$ is consistent: the distribution $P$
itself provides a model for $\TTrefl{p}{P}$. However, in the present case, we have to be more careful. Perhaps $\TT$ proves some non-trivial facts about the
behavior of the function $\dist$ we are defining. Then $\TTrefl{\dist}{P}$ may be inconsistent, if $\TT$ proves that $\dist$ cannot behave according to $P$,
e.g. if $P(\phi) \in (a,b)$ but $\TT \proves \dist(\godel{\phi}) \notin (a,b)$. 

To overcome this, we will obfuscate the behavior of $\dist$ from the prying proofs of $\TT$, to such an extreme extent that $\TT$ cannot rule out any finite
set of behaviors of $\dist$; then $\TTrefl{\dist}{P}$ will be consistent. (Unfortunately, this weakens the main potential use in reflective agents of having a definable
self-reflective distribution, namely, that the theory can reason concretely about the distribution, other than what can be said about generic coherent
distributions. It may be possible to have the base theory prove more about the distribution by not diagonalizing against certain behaviors, and working around
that in the application of Kakutani's theorem.)

### Definition of $\dist$

Take the set $\behaviors := \{ \bigwedge_{i\in [n]}( \dist(\godel{\phi_i}) \in (a_i,b_i))\ |\ 
n \in \NN; a_j,b_j \in \QQ\cap \unit; \forall k \in [n]: a_k<b_k \}$ of possible finite specifications of behaviors for $\dist$. Here $\phi_i$ is some
enumeration of all sentences in $\LL$.  Note that $\behaviors$ is
countable, and each sentence in $\behaviors$
is consistent with $\dist$ being a function, though not necessarily a coherent distribution. Now we can define $\dist$ by the following informally stated
construction, which can be translated into a formula $\dist(n,r)$ defining the graph of a function from sentences to real numbers: 

Step 1. Search for a proof in $\TT$ of the negation of some statement in $\behaviors$. If such a statement $\bigwedge_{i\in [n]}( \dist(\godel{\phi_i}) \in (a_i,b_i))$ is
found, then output some value in $(a_i,b_i)$ on input $\phi_i$, and otherwise output 0. 

Step 2. Otherwise, output values according to the least fixed point of the reflection correspondence $\corr{\dist}$. 

By the least fixed point, we mean the fixed point with minimal first coordinate; minimal second coordinate out of those with minimal first coordinate; minimal
third coordinate . . . etc. This exists because the set of fixed points is closed, and therefore also compact. Note that we require $\LL$ and $\TT$ to be
expressive enough to define fixed points of  $\corr{\dist}$ and the ordering just described. Taking $\TT = \ZFC$ suffices. This is not a crucial point, as we
will later show that a much weaker theory suffices. 


### Theorem 1.
If $\TT$ is a sound theory, then  $\dist$ defines a function on $\LL$ that assigns probability 1 to each sentence in $\TT$, is coherent, and is reflective. 

#### Proof.
Suppose we have $\TT \proves \neg\xi$ for some $\xi \in \behaviors$, where $\xi = \bigwedge_{i\in [n]}( \dist(\godel{\phi_i}) \in (a_i,b_i))$. Then by step 1
of $\dist$, 
we have that $\dist(\phi) \in (a_i,b_i)$  for all $i\in [n]$. This contradicts soundness of $\TT$. 

Thus, by compactness, we have that for all $P \in \Dists{\TT}$, the theory $\TTrefl{\dist}{P}$ is consistent. Then by the argument above, the correspondence
$\corr{\dist}$
gives a non-empty image for each point in $\Dists{\TT}$. By Kakutani's theorem, there is a fixed point of this correspondence. 

Step 2 then outputs probabilities according to some such fixed point $\PP$. That is, $\forall \phi: \dist(\phi) = \PP(\phi)$. Furthermore, $\PP \corr{\dist}
\PP$, i.e. $\dist$ is reflective. $\square$

In fact, we do not need to assume soundness of $\TT$ in Theorem 1; we only need to assume that $\TT$ is consistent. Proof: suppose that 
$\TT \proves \neg\xi$ for some $\xi \in \behaviors$. Then there is a least such $\xi$. But then $\TT$ can prove that $\xi$ is the first sentence in
$\behaviors$ that $\TT$ refutes, so $\TT$ can prove that $\dist$ finds this proof and outputs according to $\xi$. Then we have that $\TT$ both proves and
refutes that $\dist$ behaves according to $\xi$, contradicting the consistency of $\TT$. 


## Section 3. A $\Delta_2$-definable, self-reflective distribution $\distTwo$

Step 1 in $\dist$ as defined above is $\Delta_2$-definable, i.e. computable with a halting oracle: we just need to check the halting of the machine that
searches for refutations by $\TT$ of the (computably recognizable) sentences in $\behaviors$.  If the machine halts, find the proof computably, and output
rational numbers given by the refuted behavior. 

Step 2, however, uses set-theoretic notions; namely, it quantifies over the  large and complicated set of fixed points of $\corr{\dist}$. In
this section we  replace Step 2 with a $\Delta_2$ computation, thereby defining a $\Delta_2$ formula $\distTwo$ that is self-reflective. ($\distTwo$ stands
for Limit-computable.)


### Definition of $\distTwo$

By the arguments for Theorem 1, regardless of what $\distTwo$ does in Step 2, there will be some $\PP \in \Dists{\TT}$ such that $\PP \corr{\distTwo}\PP$. Thus,
for Step 2, it suffices to run a $\Delta_2$ computation that outputs a fixed point as long as one exists. We now define $\distTwo$ by the following construction, which can be viewed as
an algorithm executed by a machine with a halting oracle: 

Step 1. Search for a proof in $\TT$ of the negation of some statement in $\behaviorsTwo$. If such a statement $\bigwedge_{i\in [n]}( \distTwo(\godel{\phi_i}) \in (a_i,b_i))$ is
found, then output some value in $(a_i,b_i)$ on input $\phi_i$, and otherwise output 0. 

Step 2. Otherwise, enumerate a completion $\compZ$ of the theory $\incompZ:= \ZFC + \coh{\TT}(P) + P \corr{\distTwo} P$ in the language of set theory plus a
constant symbol $P$. That is, list  all sentences $\sigma$, and print out each $\sigma$ that is consistent with $\incompZ$ and the finitely many sentences
that have already been printed. 
Given a sentence $\phi$ and a precision $0<\eps \in \QQ$, search $\compZ$ for  the first quadruple of rational numbers $a<a'<b'<b$ such that $\compZ \proves P(\godel{\phi}) \in
(a',b')$, and such that $b-a < \eps$. Output $(a,b)$. 

(Note: This is the technique alluded to earlier of taking the standard part
of a distribution. If we just output $(a,b)$ with $(P(\godel{\phi}) \in
(a,b))\in \compZ$, then we might output e.g. $(0,1/n)$ for all $n \in \NN$, which has empty intersection. 
 Also note that we could take a much more basic theory than $\incompZ$; we could have a base theory  that says all true atomic
statements about $\QQ$, and take $\coh{\TT}(P)$ and $P \corr{\distTwo} P$ to be schema of quantifier-free formulas.)


#### Observation: $\distTwo$ is $\Delta_2$. 
Proof: Step 1 is $\Delta_2$ by the argument given at the beginning of this section.
Step 2 is computable, except that we need to check whether each new sentence $\sigma$ is consistent with $\incompZ$ and the previously printed sentences. To
check the consistency of a computably enumerable theory $S$, we ask our halting oracle whether not $M$ halts, where $M$ is a machine that enumerates all the
theorems of $S$, and halts iff it prints $\bot$. 


### Theorem 2.
  $\distTwo$ defines a coherent, self-reflective distribution. 

#### Proof.
 By the argument for $\dist$, if $T$ is consistent, it does not refute any behavior of $\distTwo$. So there is some fixed point
$\PP \corr{\distTwo} \PP$, and also $\distTwo$ behaves according to Step 2. 

The distribution $\PP$ provides an interpretation for the symbol $P$ satisfying coherence over $T$ and self-reflection in $\distTwo$. Hence the theory
$\incompZ$ is consistent, and so $\compZ$ is non-trivial. By construction, for each $\phi$ there is a unique (standard) real $\pptwo(\phi)$ that, for all
$\eps>0$,  lies in  the interval output by $\distTwo$ on $\phi$ and $\eps$.  

Now we argue that $\pptwo$ is coherent over $T$ and reflects itself in $\distTwo$. For any $\phi \in T$, since $\compZ \proves \coh{\TT}(P)$, we also 
have $\compZ \proves P(\godel{\phi}) = 1$. Thus, for all $\eps>0$ we have that  $\compZ \proves P(\godel{\phi}) \in (1-\eps,1+\eps)$, and therefore
$\pptwo(\phi)=1$. 
A very similar argument works to show the other coherence conditions and reflection. 
For example, if $\pptwo(\phi) \in (a,b)$, then we have $\compZ \proves P(\godel{\phi}) \in (a,b)$. By an instance of $P \corr{\distTwo} P$, also 
$\compZ \proves P(\godel{\distTwo(\godel{\phi}) \in (a,b)} )=1$, and hence $\pptwo(\distTwo(\godel{\phi}) \in (a,b))=1$. 


Thus $\distTwo$ computes a coherent distribution over $T$ which assigns probability 1 to each reflection statement for $\distTwo$. $\Box$





## Section 4. Discussion

$\Delta_2$ is roughly optimal for the properties of $\distTwo$; computable distributions can't even be coherent over essentially undecidable theories. 
(If we could compute a coherent distribution
over $T$, then for each $\phi$ we could wait for 1 or 0 to be excluded from the intervals we output for $\phi$, and thereby computably separate the provable
and refutable sentences, which is impossible.) 
A slightly stronger statement is that for any definable completion $\bar \PA$  of $\PA$, there is a distribution 
$\PP$ over completions of $T$ that is computable from $\bar \PA$, which is reflective for the definition of $\PP$ that uses $\bar \PA$ in Step 2 to complete
$\incompZ$. 

As mentioned earlier, $\distTwo$ is very obfuscated from $\TT$. In fact, if $T$ is strong enough, then $\distTwo(\con(T))=0$. Otherwise, since $\distTwo$
believes each sentence of $T$, by coherence and $T \proves \con(T) \to \refl(\distTwo)$, we would have that $\distTwo(\refl(\distTwo))>0$. But this is not
possible for a reflective, coherent distribution.


If our metatheory $K$ is strong enough to prove some facts like Kakutani's theorem, then
$K+\con(T)$ proves $\coh{T}(\distTwo)$ and $\refl(\distTwo)$. This likely roughly optimal: if the meta-theory even proves $\coh{T}(\distTwo)$, then it also
proves $\con(T)$. Probably $\PA$ is sufficient to prove the necessary first-order statements, since the second-order theory $\textsf{ACA}_0$ is probably
strong enough to prove a literal statement of Kakutani's  theorem, and $\PA$ is the first-order part of $\textsf{ACA}_0$. See for example
[Fixed point theory in weak second-order arithmetic, by  Naoki Shioji and Kazuyuki Tanaka ](http://ac.els-cdn.com/016800729090068D/1-s2.0-016800729090068D-main.pdf?_tid=3d42ae8e-8a7c-11e5-bc8b-00000aab0f6c&acdnat=1447470371_e5a2e3cf83ce2cab24002238a7262cb9),
though that paper only proves Kakutani in finite dimensions and the Tychonoff-Schauder theorem (in the  weaker system $\textsf{WKL}_0$).



### Questions


* We conjecture that a modification of $\distTwo$ might give a distribution $\distThree$ that satisfies the same properties, and also assigns probability 1 to the
statement $\coh{\TT}(\distThree)$.
* We also conjecture that Fallenstein's reflection principle for expectations can be similarly defined. 
* Can there be a distribution that is reflective and computably approximable (from below)? (This may be easy to refute.)
* Can a definable reflective distribution be coherent over a theory that proves some useful facts about the distribution?
* What are some weaker notions of reflection that can be computable or computably approximable (from below)? 
* What reflective properties of beliefs are needed for self-verification in the context of general decision-making?



Open questions (Christiano):

* What sorts of bad beliefs can be avoided given coherence and reflection?
* What are some weaker notions of reflection such that probability distributions can
be coherent, reflective, and also assign high probability to their own reflectivity?