<p>You must be careful here. You are using set-theoretic concepts (cardinal, continuum) outside set theory. There is potential for confusion.</p>

<p>Your question can be understood in several ways.</p>

<p>Maybe you are asking whether there can be uncountably many terms of a given type. The answer is: obviously not since there are only countably many finite strings, and eact term is a string (or a finite tree if we think of abstract syntax). You might be asking this question because you claim that "the elements of types are terms". This, in my opinion, is a very damaging view of types. It is like saying that the elements of $\mathbb{R}$ are only certain expressions which denote real numbers.</p>

<p>Another possibility is that you are asking whether there is a model of type theory in which some of the types are interpreted as uncountable sets. The answer is yes, for example the set-theoretic type model in which types are sets. In this case $\mathtt{nat} \to \mathtt{bool}$ has the power of continuum because it is the sets of all infinite boolean sequences.</p>

<p>You could be asking whether <em>inside</em> type theory we can prove that there are types of the cardinality of continuum. In this case the question does not make sense because the notion "cardinality of continuum" is something that only make sense in set theory. You need to rephrase it so that it makes sense in type theory, but there are complications. Cardinality just does not behave the same way in type theory as it does in set theory. For example, you cannot show that cardinals (whatever you think they are) are linearly ordered. But we can still define special cases. Thus we can define the notion of an <em>uncountable</em> type:</p>

<pre><code>Definition uncountable (A : Type) :=
   forall f : nat -&gt; A, exists x : A, forall n : nat, ~ (f n = x).
</code></pre>

<p>In words, $A$ is uncountable if for every sequence $f : \mathbb{N} \to A$ there exists $x : A$ such that $x$ is not in the image of $f$. The Baire space $\mathbb{N}^\mathbb{N}$ is uncountable:</p>

<pre><code>Theorem baire_uncountable : uncountable (nat -&gt; nat).
Proof.
  intro f.
  exists (fun n =&gt; S (f n n)).
  intro n.
  intro E.
  absurd (f n n = S (f n n)).
  - auto.
  - pattern (f n) at 1.
    rewrite E.
    reflexivity.
Qed.
</code></pre>

<p>So, classically this would mean that the cardinality of the Baire space is larger than $\aleph_0$, but as I said, cardinalities inside type theory, and in constructive mathematics in general, behave a lot less nicely than in set theory.</p>

CC BY-SA 3.0
2017-06-15T16:36:08.270Z
Shouldn't the definition for uncountable be `exists x : A, forall f : nat -> A, forall n : nat, ~ (f n = x)`? There is some `x` which is not in the image of any sequence `f`? As it reads now, for each sequence `f` there is an `x` not in its image (which is not the definition of an uncountable set `A`). If so, the theorem doesn't appear to hold...
Alex Nelson
CC BY-SA 3.0
2017-06-15T18:52:41.740Z
No. According to your definition there are no uncountable sets. You have your order of quantifiers backwards. Consider the reals: is there a real $x$ which is not in the image of any sequence? (How about the constant sequence $x, x, x, \ldots$?)
Andrej Bauer
CC BY-SA 3.0
2014-05-07T20:38:38.270Z
2014-05-07T20:38:38.270Z
Andrej Bauer
<p>Are types which correspond to sets with cardinality of continuum possible in MLTT (or in any other constructive theory)? </p>

<p>On the first sight, they aren't, since elements of types are terms and we have only countable number of terms.</p>

<p>Does it mean that sets with cardinality of a continuum really doesn't exist and just a nice abstraction which simplifies mathematics a lot?</p>

CC BY-SA 3.0
2014-05-08T21:46:53.183Z
You should probably take a look at [Skolem's paradox](http://en.wikipedia.org/wiki/Skolem%27s_paradox): the class of all sets only has countably many elements, when viewed from the "outside" (at least for certain models).
cody
<lo.logic><type-theory><constructive-mathematics>
Types which correspond to sets of cardinality of continuum
Konstantin Solomatov
# Types which correspond to sets of cardinality of continuum

(Asked by: username_0 on 2014-05-07)

Are types which correspond to sets with cardinality of continuum possible in MLTT (or in any other constructive theory)?

On the first sight, they aren't, since elements of types are terms and we have only countable number of terms.

Does it mean that sets with cardinality of a continuum really doesn't exist and just a nice abstraction which simplifies mathematics a lot?

**Tags:** lo.logic, type-theory, constructive-mathematics
> **Comments:**
> **username_1**: You should probably take a look at [Skolem's paradox](http://en.wikipedia.org/wiki/Skolem%27s_paradox): the class of all sets only has countably many elements, when viewed from the "outside" (at least for certain models).  

---

## 1 answers

### Answer by username_2 on 2014-05-07. Score: 20 | Accepted answer

You must be careful here. You are using set-theoretic concepts (cardinal, continuum) outside set theory. There is potential for confusion.
Your question can be understood in several ways.
Maybe you are asking whether there can be uncountably many terms of a given type. The answer is: obviously not since there are only countably many finite strings, and eact term is a string (or a finite tree if we think of abstract syntax). You might be asking this question because you claim that "the elements of types are terms". This, in my opinion, is a very damaging view of types. It is like saying that the elements of $\mathbb{R}$ are only certain expressions which denote real numbers.
Another possibility is that you are asking whether there is a model of type theory in which some of the types are interpreted as uncountable sets. The answer is yes, for example the set-theoretic type model in which types are sets. In this case $\mathtt{nat} \to \mathtt{bool}$ has the power of continuum because it is the sets of all infinite boolean sequences.
You could be asking whether inside type theory we can prove that there are types of the cardinality of continuum. In this case the question does not make sense because the notion "cardinality of continuum" is something that only make sense in set theory. You need to rephrase it so that it makes sense in type theory, but there are complications. Cardinality just does not behave the same way in type theory as it does in set theory. For example, you cannot show that cardinals (whatever you think they are) are linearly ordered. But we can still define special cases. Thus we can define the notion of an uncountable type:
Definition uncountable (A : Type) :=
   forall f : nat -> A, exists x : A, forall n : nat, ~ (f n = x).

In words, $A$ is uncountable if for every sequence $f : \mathbb{N} \to A$ there exists $x : A$ such that $x$ is not in the image of $f$. The Baire space $\mathbb{N}^\mathbb{N}$ is uncountable:
Theorem baire_uncountable : uncountable (nat -> nat).
Proof.
  intro f.
  exists (fun n => S (f n n)).
  intro n.
  intro E.
  absurd (f n n = S (f n n)).
  - auto.
  - pattern (f n) at 1.
    rewrite E.
    reflexivity.
Qed.

So, classically this would mean that the cardinality of the Baire space is larger than $\aleph_0$, but as I said, cardinalities inside type theory, and in constructive mathematics in general, behave a lot less nicely than in set theory.

> **Comments:**
> **username_3**: Shouldn't the definition for uncountable be `exists x : A, forall f : nat -> A, forall n : nat, ~ (f n = x)`? There is some `x` which is not in the image of any sequence `f`? As it reads now, for each sequence `f` there is an `x` not in its image (which is not the definition of an uncountable set `A`). If so, the theorem doesn't appear to hold...  
> **username_2**: No. According to your definition there are no uncountable sets. You have your order of quantifiers backwards. Consider the reals: is there a real $x$ which is not in the image of any sequence? (How about the constant sequence $x, x, x, \ldots$?)  

---

