> in constructivism Cantor's "proof" isn't a proof at all!
Are you sure about that, and could you point me to a reference if so? It was my understanding that Cantor's proof works perfectly well in a constructive setting.
For example, we can represent real numbers in a constructive way as functions from a natural number to a digit, where we interpret f(N) as giving us the Nth decimal place. We can represent an infinite list in the same way: taking a natural number and giving the value at that list position (a real number is hence an infinite list of digits).
Hence we can construct a function F which takes in a list of real numbers (a function mapping natural numbers to functions-mapping-natural-numbers-to-digits) and gives out a real number (a function mapping natural numbers to digits). Given a number N, this function looks up the Nth digit of the Nth number in the list, and returns a different digit (e.g. one more, modulo 10). Formally, in some Agda-like notation, it would be something like:
Digit = Member of {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
inc : Digit -> Digit
inc(0) = 1
...
inc(9) = 0
List(t) = Natural -> t
Real = List(Digit)
Real = Natural -> Digit
F : List(Real) -> Real
F : (Natural -> Real) -> Real
F : (Natural -> (Natural -> Digit)) -> (Natural -> Digit)
F(list)(n) = inc(list(n)(n))
Cantor's proof is then a function which takes a list L and returns a proof that F(L) doesn't occur in L. We can represent non-occurrence using a function taking a natural number N and returning a proof that the Nth element of L differs from F(L) (this is a list of proofs!). We can represent proofs that two numbers differ by using a natural number, which gives (one of) the decimal places at which those numbers have different digits. We know from the definition of F that F(L) will differ from the Nth value in the list, and more specifically that it will differ at the Nth decimal place. It's easy to prove that distinct digits are different, since the set of digits is finite (although the exact encoding depends on the logical system being used). Hence we just need to show that `inc(N) != N`, and use that as proof that `F(L)(N) != L(N)(N)`, and hence `F(L)` doesn't occur in `L`:
-- Proof that x != y, however you want to represent that (e.g. 'Equal x y -> Empty')
Differ(t) : (x : t) -> (y : t) -> Set of proofs that x != y
incDiffers : (d : Digit) -> Differ(Digit)(d, inc(d))
incDiffers(0) = 0 != 1
...
incDiffers(9) = 9 != 0
-- Proof that two reals differ, which is a natural and a proof that they differ
-- at that digit
RealsDiffer(x, y) = {n : Natural | Differ(Digit)(x(n), y(n))}
-- Proof that F(L) differs from everything in L. This is because the Nth element of L
-- differs from F(L) at (at least) the Nth decimal place.
cantor : (L : List(Real)) -> (n : Natural) -> RealsDiffer(L(n), F(L))
cantor(L)(n) = (n, incDiffers(L(n)(n)))