Use the coordinates of the code record. It is convenient to index every check, bulk or boundary, by a plaquette position with , whose qubits are those of that lie in the grid. The -type checks are the positions with even and ; the -type checks are the positions with odd and . For odd this reproduces the lists in the record.
Commutation. Two plaquette positions that share an edge have of opposite parity and share two qubits or none inside the grid; positions that share only a corner have the same parity, hence the same type. So checks of different type overlap on an even number of qubits.
Independence. Every qubit lies in at most two -type checks, namely those at diagonally opposite plaquette positions around it. A product of a set of -type checks is the identity exactly when every qubit lies in an even number of members of . So if two -type checks share a qubit, both are in or neither is, and a check containing a qubit that lies in no other -type check is not in .
The -type positions are connected under diagonal steps: from with even one reaches by steps that stay among the -type positions, since the bulk positions of one colour of a square board of side are connected by such steps, and each boundary position or is diagonally adjacent to a bulk position. Diagonally adjacent positions share exactly one qubit. Hence contains all -type checks or none. The corner qubit lies in the plaquette and in no other -type check, because the positions and , are not -type checks. So the plaquette is not in and is empty: the checks of type are independent. The -type checks are independent by the same argument with the corner qubit , which lies only in the plaquette . An -type product equals a -type product only if both are the identity, so the stabilizer group has rank and .
Logical operators. Let and . An -type check at position meets row in the two qubits if and in none otherwise, so commutes with all checks; similarly a -type check meets a column in two qubits or none, so commutes with all checks. and share the single qubit and anticommute. Two operators that commute with the stabilizer group and anticommute with each other cannot lie in it, so and are a pair of logical operators of the single encoded qubit.
All columns are equivalent. Fix and multiply the -type checks at positions , , . Each acts with on columns and in rows and (those inside the grid). For even the rows covered are ; for odd they are . In both cases every row is covered once, so the product is . Hence all differ by stabilizers. The same argument with the -type checks at positions , , shows that all differ by stabilizers.
Distance. Since , every Pauli operator commuting with all checks equals, up to a phase, with in the stabilizer group. Let be a product of operators on a set of qubits that commutes with all checks and is not a product of checks. commutes with , so , and then . Thus anticommutes with and with every , since these differ from by stabilizers. Anticommuting with means that contains an odd number of qubits of column . The columns are disjoint, so . Exchanging the roles of rows and columns, every non-trivial -type logical operator has weight at least .
A general Pauli operator is, up to a phase, a product . In a CSS code it commutes with all checks exactly when both factors do, and if it is not in the stabilizer group at least one factor is not; that factor has weight at least . Since has weight , the distance is exactly .