Question: In Bonn, we've been have a discussion on the topic in the title: 

> 
> Suppose that A and B is are classes and that there are injections from A to B and fom B to A. Does it follow that there is a bijection between A and B?
> 
> 
> 

Example: Let A the class of sets of cardinality one and let B be the class of sets of cardinality two. There is an injection 

A -> B sending a to {a, emptyset},

B-> A sending b to {{b}}.

Does it follow that there is a bijection between A and B?

Answer: 
Since the question has arisen whether the standard
arguments really do work with classes, let me post this
answer giving some fuller details about one comparatively
concrete way to do it. Other methods are also possible.

I shall work in the theory of Goedel-Bernays GB set theory
(without global choice), a general setting for treating
classes, which forms a conservative extension of ZF. This
theory includes as a special case the traditional treatment
of classes as definable collections in ZF, since every
model of ZF, when augmented with its definable classes,
forms a model of GB. Thus, the GB context seems the most
comprehensive way to answer (and if you prefer ZF, then
just imagine that all classes here are definable from
parameters).

Suppose that $A$ and $B$ are classes and that we have class
functions $F:A\to B$ and $G:B\to A$ which are injective, as
in the question. Let $A\_0=A-\operatorname{ran}(G)$, which is a class,
since it is definable from $A$ and $G$. Let us say that a
sequence $\langle x\_0,x\_1,x\_2,\ldots\rangle$ is a
*back-and-forth-iteration sequence* if $x\_0\in A$ and
$x\_{2n+1}=F(x\_{2n})$ and $x\_{2n+2}=G(x\_{2n+1})$ for all natural numbers $n$. Let $A\_n$
be the elements $a\_{2n}$ that appear at the even
coordinates of a back-and-forth iteration sequence with
$a\_0\in A\_0$. This notion is definable from $F$ and $G$, and the point is that we have a uniform presentation of the $A\_n$ in a single class $\{(n,a)\mid a\in A\_n\}$.
Let $A^+=\bigcup\_n A\_n$, which is a class definable from
$F$ and $G$.

Let $H$ be the function $(F\upharpoonright
A^+)\cup(G^{-1}\upharpoonright A-A^+)$. I claim that this
is the desired bijection between $A$ and $B$. First, it is
clearly a class that is definable from $F$ and $G$. Second,
it is a function from $A$ to $B$. Note that if $a\in A\_n$,
then $G(F(a))\in A\_{n+1}\subset A^+$, and so $F(a)$ is not
$G^{-1}(a')$ for any $a'\in A-A^+$. Thus, the function $H$
is injective. Secondly, if $b\in B$ and $G(b)\in A\_n$, then
it must be that $n\geq 1$ and so $b=F(a')$ for some $a'\in
A\_{n-1}\subset A^+$, putting $b\in\operatorname{ran}(H)$. Otherwise,
$G(b)\notin A^+$, and so again $b\in\operatorname{ran}(H)$. So $H$ is a
bijection. QED

Some of the other proofs can also be formalized for
classes, if one simply uses the sequences as I did here for
iterating.
This is an interesting question. I think there are some issues which the others did not mention yet. But I'm not an expert at all, I might be wrong. Please leave me a comment!

In the following, I work in $ZF$. Thus, a class is just a formula. There are some constructions and relations of sets which directly carry over to classes. For example $A=B$ means that the formulas of $A,B$ are equivalent.

Let's sketch the proof for classes. Let $A,B$ classes, $f : A \to B$, $g : B \to A$ injective maps. Define the classes $A\_n \subseteq A, B\_n \subseteq B$ recursively by $A\_0=A, B\_0 = B, A\_{n+1} = g[B\_n], B\_{n+1}=f[A\_n]$. Then $h : A \to B$, defined by $f$ on $\cap\_n A\_n \cup (\cup\_n A\_{2n} \setminus A\_{2n+1})$ and by $g^{-1}$ in the rest, is well-defined and a bijection.

Unions, cuts, images of functions etc. are not the problem. But what about the recursion? What we really need here is a recursion scheme for classes. Actually there is a theorem which might be called the transfinite recursion scheme for classes:

> 
> Let $R$ be a well-founded and set-like relation of the class $A$ and $F : A \times V \to V$ a function. Then there is a function $G : A \to V$, such that for all $x \in A$
> 
> 
> $G(x)=F(x,G|\_{\{y \in A : y R x\}})$.
> 
> 
> 

However, note that the images of $G$ are sets, not proper classes. We can't use that theorem here.

I think we need a meta-theorem stating that the above also holds when $V$ is replaced by the set of formulas and $R=\mathbb{N}$. Also, the meta-world should be able to talk about functions. But this is not plausible at all, since the resulting formula won't have to be finite, right?

For example, try to define a formula $G(n)$ recursively by $G(0)=\phi\_0$ (doesn't matter what $\phi\_n$ is) and $G(n)=G(n-1) \wedge \phi\_n$. Why should there be a formula $\psi(n,x)$ such that $\psi(n,x) \Leftrightarrow \wedge\_{i=0}^{n} \phi\_i$? I think we need a rather mighty logical calculus for that.

Also note that Francois' great answer [here](https://mathoverflow.net/questions/18042/axiom-of-infinity-needed-in-cantor-bernstein) (proving Schröder-Bernstein without the existence of the set $\omega$) also causes problems when you want to write down the formula for the part "...$\exists s : \{0,...,n\} \to A$ ...". Perhaps there is really no bijection between the two classes mentioned above (class of all singletons, and class of all 2-element sets)?