From comments in Pairing in Presburger arithmetic it looks like using Peano Arithmetic we can compare cardinalities of sets. How exactly to do this?
1 Answers
There are a couple steps to this.
I'll first make things simpler by shifting attention from PA to PA$_{exp}$ - this is just like PA, but our language is expanded to include the binary function symbol "$exp$," our induction scheme is expanded to apply to all formulas in this larger language, and we add axioms saying that $exp$ behaves like it should (specifically: for all $a,b$ we have $exp(a,0)=1$ and $exp(a, b+1)=a\cdot exp(b)$). Once you understand how this version of the problem works, just observe that Godel's $\beta$ function lets us get away with only $+$ and $\times$.
Next, we need to decide how exactly we're going to represent finite sets in $\mathcal{N}=(\mathbb{N};+,\times,exp)$. There are many ways to do this; one way is to identify a number $a$ with the set $$set(a):=\{i: \mbox{ for some prime $p$, we have }p^i\vert a\mbox{ but }p^{i+1}\not\vert a\}.$$
Now the relation "$set(a)\subseteq set(b)$" is definable as
For each prime $p\vert a$ there is some prime $q\vert b$ such that for all $i$ we have $$p^i\vert a\iff q^i\vert b.$$
From this in turn we can define the relation "$set(a)=set(b)$," and finally define the canonical representative for a number $a$, $can(a)$, as the smallest $b$ such that $set(b)=set(a)$. It's now easy to check that
$\vert set(a)\vert=\vert set(a')\vert$ iff the primes dividing $can(a)$ are exactly those dividing $can(a')$
(the point being that when we pass from $x$ to $can(x)$, we use as few primes as possible and as small primes as possible). And all of this is definable in $\mathcal{N}$.
EDIT: To be super-explicit, here's how it all gets put together. We express "The set coded by $x$ is of strictly smaller cardinality than the set coded by $y$" as
For every $x'$ and $y'$, if $can(x,x')$ and $can(y,y')$ then every prime dividing $x'$ also divides $y'$ but there is a prime dividing $y'$ which does not divide $x'$,
where "$can(u,v)$" is the relation (intuitively meaning "$v=can(u)$") defined by
$subset(u,v)$ and $subset(v,u)$ and for all $w<v$ either $\neg subset(w,u)$ or $\neg subset(u,w)$,
where "$subset(m,n)$" is the relation (intuitively meaning "the set coded by $m$ is a subset of the set coded by $n$") defined by
for every prime $p$ dividing $m$ there is a prime $q$ dividing $n$ such that for all $i$ we have $p^i\vert m$ iff $q^i\vert n$.
All of this nests together to give a single, very long, first-order formula.
More generally, using $exp$ we can reason satisfactorily about finite sequences, by representing a finite sequence $$\langle a_1,..., a_n\rangle$$ by the number $$\prod_{0\le i\le n}p_i^{a_i+1},$$ where $p_i$ denotes the $i$th prime. (The "$+1$" is required to avoid ambiguity - think about what would happen if $a_n=0$.) The key step behind this is the prime counting relation, $$C(p,i)\equiv p\mbox{ is the $i$th prime};$$ this relation is definable in $\mathcal{N}$ as
There is some $n$ such that $(1)$ the power of $2$ in $n$ is $1$, $(2)$ the power of $p$ in $n$ is $i+1$, and $(3)$ for each prime $q<p$.
This winds up being incredibly useful, so while it's not needed here I think it's still worth mentioning.
Finally, note that rather than talk about provability in the theory PA$_{exp}$ I've really just talked about definability in $\mathcal{N}$ - in a particular application/analysis, we need to check that all the "relevant properties" of the coding we're using are actually provable in PA$_{exp}$. But this theory is so strong that this generally is basically immediate.

- 245,398
-
Is there a way to formulate as a existenstially and universally quantified sentence structure? – Turbo Jul 31 '19 at 23:35
-
@Turbo I have no idea what that means. Everything above is definable in first-order logic in the usual sense, so yes I think? Can you pin down a specific point in the post which is confusing? – Noah Schweber Aug 01 '19 at 00:24
-
Everything is fine however I want to see the formal mathematical statements. – Turbo Aug 01 '19 at 01:30
-
@Turbo Which formal mathematical statements? And I still don't know what an "existentially and universally quantified sentence structure" is. I can for example write a formula $\varphi(x,y)$ in the language of PA$_{exp}$ such that (in the standard model) $\varphi(a,b)$ holds iff the set coded by $a$ has smaller cardinality than the set coded by $b$; would that be a satisfying answer? – Noah Schweber Aug 01 '19 at 01:32
-
Perhaps $\varphi(x,y)$ would suffice. – Turbo Aug 01 '19 at 01:54
-
@Turbo OK, that's exactly what the second part of my answer does - $\varphi(x,y)$ is just "Every prime dividing $can(x)$ also divides $can(y)$ but not conversely," where "$can(-)$" is defined just before that. – Noah Schweber Aug 01 '19 at 02:19
-
@Turbo I've added a fairly explicit definition of $\varphi$. But it really is just taking the sequence of definitions above and putting them together appropriately. Does this help? (If not, what other point is at issue?) – Noah Schweber Aug 01 '19 at 02:26
-
Is there a way to define bijection between sets as a formula $\psi$? – Turbo Aug 01 '19 at 03:03
-
@Turbo Yes, following the same sorts of ideas. A bijection between two sets is a set of ordered pairs satisfying certain properties; so you want to talk about numbers coding sets of pairs which appropriately relate to the powers of primes occurring in the two input numbers. All of this is straightforward but tedious. – Noah Schweber Aug 01 '19 at 04:21
-
It is tedious but what and how those properties are encoded would be interesting. – Turbo Aug 01 '19 at 04:31
-
@Turbo Not really - it's just an exercise in being careful. For example, here's one way to do it: a number $c$ codes a bijection from the set coded by $a$ to the set coded by $b$ iff: (1) whenever $x$ is in the set coded by $a$ there is exactly one $y$ in the set coded by $b$ such that $2^x3^y$ is in the set coded by $c$; (2) whenever $y$ is in the set coded by $b$ there is exactly one $x$ in the set coded by $a$ such that $2^x3^y$ is in the set coded by $c$; and (3) every number in the set coded by $c$ has the form $2^x3^y$ for some $x$ in the set coded by $a$ and $y$ in the set coded by $b$. – Noah Schweber Aug 01 '19 at 04:37
-
(This is using definitions we already have for "- is in the set coded by -," since as usual we're going to have a lot of nesting.) Again, the point is that all of this is boring - prime factorization lets us brute-force code everything we want to without doing anything clever. It's a good idea to try a couple for yourself; you'll understand it that way better than if you just see a bunch of examples. The important thing really is to convince yourself that it is fully automatic. – Noah Schweber Aug 01 '19 at 04:41
-
@Turbo Did my previous comments help? If not, it might be helpful to ask a separate question (since this comment thread is getting a bit long). – Noah Schweber Aug 17 '19 at 14:14
-
Do we need $+$ and $\times$ in the argument you provided? Seems $(\mathbb N,+,\mathsf{exp})$ or $(\mathbb N,\times,\mathsf{exp})$ suffices? – Turbo Jan 05 '21 at 06:05
-
@NoahSchwber Also what is a bound on $\mathsf{can}(a)$? – Turbo Jan 05 '21 at 06:19
-
@1.. Well, there are more details to the argument, I just gave a sketch. Since $(\mathbb{N};\times,\mathsf{exp})$ interprets $(\mathbb{N}; +,\times)$ (pick a prime and consider its powers), multiplication and exponentiation are enough since addition and multiplication are enough (I included exponentiation but it's actually unnecessary). I don't know about $(\mathbb{N}; +,\mathsf{exp})$ though, I don't see how to make that work. – Noah Schweber Jan 05 '21 at 06:22
-
@1.. "Also what is a bound on $\mathsf{can}(a)$?" Well, trivially $\mathsf{can}(a)\le a$. In general, you can compute $\mathsf{can}(a)$ via a "greedy algorithm:" if we let $\mathsf{set}(a)={b_0>b_1>...>b_k}$, then $$\mathsf{can}(a)=\prod_{0\le i\le k}p_i^{b_i+1}.$$ (On that note, it looks like I made an indexing error in my definition of $\mathsf{set}(a)$: it should be ${i: $ for some prime $p$, $p^{i+1}\vert a$ but $p^{i+2}\not\vert a}$ to handle the case of $i=0$.) – Noah Schweber Jan 05 '21 at 06:28
-
(And reiterating my comment of a year ago, I think it would be best to ask further questions separately - this comment thread is getting rather long, and I think the original question has been addressed.) – Noah Schweber Jan 05 '21 at 06:29
-
@1.. Have I answered your questions? – Noah Schweber Mar 03 '21 at 04:30