Flip decoding of expander codes #
The flip decoder of Sipser and Spielman [SS96] corrects errors in the expander code
of a bipartite graph G (Cslib.BitString.ExpanderCode.code) by local moves. While some variable
has more violated than satisfied checks among its neighbours
(Cslib.BitString.ExpanderCode.IsFlippable), flip it. This is the algorithm of
[GuruswamiSharma2010, §1.1], and the procedure GEN-FLIP of [GuruswamiRudraSudan2025, §18.2.2,
Algorithm 18.2.1] with exact check bits.
- Each flip removes a violated check (
Cslib.BitString.ExpanderCode.card_unsat_flipOn_lt): flipping variableiexchanges its violated and satisfied neighbouring checks. So a run oftflips fromxhast ≤ #unsat(x) ≤ c · d(x, w)(Cslib.BitString.ExpanderCode.add_card_unsat_le_of_relatesInSteps), and at most the numbermof checks. - Progress [GuruswamiSharma2010, Lemma 5] (
Cslib.BitString.ExpanderCode.exists_isFlippable): if left degrees are at mostc, sets of at mostkvariables expand byαwith3 c < 4 α, andy ≠ wis within distancekof a codewordw, some variable is flippable. The errors have more thanc |E| / 2unique neighbours, all violated, so some error sees more thanc / 2violated checks. - Invariant [GuruswamiSharma2010, Lemma 6]
(
Cslib.BitString.ExpanderCode.hammingDist_lt_and_card_unsat_le): ifc · d(x, w) < (2 α - c) k, every word reached by flips stays at distance< kfromw. At distance exactlykthe unique neighbours of the errors would give at least(2 α - c) kviolated checks, more than thec · d(x, w)we started with. - Correctness (
Cslib.BitString.ExpanderCode.decode_eq): the deterministic decoderCslib.BitString.ExpanderCode.decode, run with any pivot rule that returns a flippable variable whenever one exists (Cslib.BitString.ExpanderCode.IsFlipRule), recoverswwithin#unsat(x)rounds. In particular, when3 c < 4 αand0 < k, it corrects every error pattern of weight at mostk / 2withinc · d(x, w)rounds (Cslib.BitString.ExpanderCode.decode_eq_of_two_mul_le).
For a lossless expander, α = c (1 - ε) with ε < 1 / 4 and k = γ n, the hypothesis
c · d(x, w) < (2 α - c) k reads d(x, w) < (1 - 2 ε) γ n, as in [GuruswamiSharma2010, §1.1.1].
The source assumes c-left-regularity; we only need left degrees at most c. The number of rounds
is counted abstractly: we do not formalize the O(n) data-structure implementation of
[GuruswamiSharma2010, §1.1.2] on a machine model.
Main definitions #
Cslib.BitString.ExpanderCode.IsFlippable: a variable with more violated than satisfied checks.Cslib.BitString.ExpanderCode.FlipStep: one move of the flip decoder.Cslib.BitString.ExpanderCode.IsFlipRule,Cslib.BitString.ExpanderCode.firstFlippable: pivot rules.Cslib.BitString.ExpanderCode.decode: the flip decoder with a bounded number of rounds.
Main results #
Cslib.BitString.flipOn_eq_add,Cslib.BitString.flipOn_singleton_eq_add_single: flips as additions.Cslib.BitString.ExpanderCode.card_unsat_flipOn_lt: flips decrease the number of violated checks.Cslib.BitString.ExpanderCode.add_card_unsat_le_of_relatesInSteps: the number of flips.Cslib.BitString.ExpanderCode.exists_isFlippable: progress.Cslib.BitString.ExpanderCode.hammingDist_lt_and_card_unsat_le: flips stay close to the codeword.Cslib.BitString.ExpanderCode.eq_of_flip_stuck: a word with no flippable variable reached fromxis the codeword.Cslib.BitString.ExpanderCode.decode_eq: correctness of flip decoding.Cslib.BitString.ExpanderCode.decode_eq_of_two_mul_le: flip decoding corrects up to half the expansion radius.
References #
Progress [GuruswamiSharma2010, Lemma 5]. If left degrees are at most c, sets of at most
k variables expand by α with 3 c < 4 α, and y ≠ w is within distance k of a codeword
w, some variable is flippable in y.
A pivot rule for the flip decoder: it returns only flippable variables, and returns none only when no variable is flippable.
Taking the first flippable variable of a list of all variables is a pivot rule.
Flipping variable i toggles exactly the checks adjacent to i.
Flipping variable i exchanges its violated and satisfied neighbouring checks.
Flipping a flippable variable decreases the number of violated checks.
A move of the flip decoder decreases the number of violated checks.
Number of flips: a run of t moves from x to y has t + #unsat(y) ≤ #unsat(x). In
particular the flip decoder stops after at most #unsat(x) ≤ c · d(x, w) moves
(card_unsat_le), and at most the number of checks.
Invariant [GuruswamiSharma2010, Lemma 6]. If c · d(x, w) < (2 α - c) k, every word
reached from x by moves of the flip decoder is at distance less than k from the codeword w
and violates at most as many checks as x.
Correctness of flip decoding [GuruswamiSharma2010, §1.1.1]. Under the hypotheses of
exists_isFlippable and hammingDist_lt_and_card_unsat_le, a word reached from x in which no
variable is flippable is the codeword w.
The flip decoder with pivot rule pick, run for at most n rounds: it flips the variable
returned by pick and stops when pick returns none.
decode_eq for every word reached from x.
Flip decoding [SS96] [GuruswamiSharma2010, §1.1]. If left degrees are at
most c, sets of at most k variables expand by α with 3 c < 4 α, w is a codeword and
c · d(x, w) < (2 α - c) k, then the flip decoder with any pivot rule, run for any number
n ≥ #unsat(x) of rounds, returns w. Since #unsat(x) ≤ c · d(x, w) (card_unsat_le),
n = c · d(x, w) rounds suffice.
Flip decoding up to half the expansion radius. If left degrees are at most c, sets of at
most k > 0 variables expand by α with 3 c < 4 α (ε < 1 / 4 for α = c (1 - ε)), and
x differs from the codeword w in at most k / 2 positions, then the flip decoder with any
pivot rule recovers w within c · d(x, w) rounds.