First apply the Cantor theorem by diagonalization. If an injection existed, it would define a surjection by the unique inverse value on 's image, and by elsewhere. The set cannot equal for any , since would be equivalent to . This contradicts surjectivity. There is no injection from the power set of the real line into the real line.
For the opposite type of encoding, let , an injective map from to . Give its canonical binary expansion, choosing the terminating expansion with trailing zeros whenever two expansions exist. If the binary digits of are , define a real-number pairing by separated digits:
This uses ternary digits only , alternating the two input digit sequences. If two outputs first differ at ternary position , that difference has magnitude , while every later digit together contributes at most . Their outputs therefore differ. The digits recover both binary sequences, hence both inputs. Neither output endpoint nor occurs because the input numbers lie strictly between zero and one. Thus is an injection from into . The ternary construction avoids an unjustified decimal-interleaving argument at ambiguous expansions.
For a finite modification of the identity on the real line, let have size , and sort it uniquely as . Its finite record is . It determines completely, with the identity used outside the recorded points. Repeatedly applying the pairing gives an injection for every positive finite : take and . Encode by
Different lengths occupy disjoint intervals , and within a fixed length the record is recoverable. Hence
Indeed the cardinality is exactly that of : the functions that alter only , assigning it an arbitrary real value, give an injection in the other direction, and the Cantor-Schröder-Bernstein theorem applies.