🎬 Applied Research

Algebraic Video Repair

If corruption can be modeled as one of the 168 automorphisms of PSL(2,7) applied incorrectly, then repair is simply finding that automorphism and applying its inverse. Error correction as group theory.

93%

Detection rate
(3 errors/block)

<2%

False positive
rate across all modes

168

Automorphisms
in the search space

The Central Idea

Traditional error correction treats corruption as noise β€” random, statistical, to be smoothed away. We treat corruption as structure: a valid algebraic transformation applied in the wrong context.

Video macroblocks (16Γ—16 pixels) are mapped to 7-element Fano structures. Each block's 7 features β€” mean brightness, texture variance, horizontal/vertical/diagonal gradients, and U/V chroma β€” must satisfy the incidence relations of the Fano plane. When they don't, something changed one of the 7 values.

The repair engine searches through the 168 automorphisms of PSL(2,7) to find which transformation best explains the corruption, then applies its inverse. This reframes error correction from a statistical problem into a group-theoretic search.

Architecture

πŸ” Trouble Detector

Predictive diagnostics. Monitors algebraic signatures at three levels:

  • ↓ Below: Constraint failures at lower levels first β€” Fano violations precede Golay violations, like seismic precursors
  • β†’ Same-level: Automorphism distribution shifts from uniform to clustered β€” certain transforms become over-represented
  • ↑ Above: Invalid configurations form their own emergent "shadow algebra"

⚑ Fano Core

The algebraic backbone. Implements:

  • β€’ 7-point, 7-line incidence structure with semantic line labels
  • β€’ 168-element automorphism group PSL(2,7)
  • β€’ Constraint validation β€” does a state satisfy all incidence relations?
  • β€’ Automorphism search β€” find the transform that maps corrupted β†’ valid

🧠 Belief Algebra

A philosophical framework for treating unknowns. The core insight: an "error" under constraint C may be a "truth" under a different constraint C'.

Stage Attitude Action
FearUnknown = errorMaximum validation
ToleranceUnknown = processableRepair if needed
CuriosityUnknown = opportunitySeek novel patterns
WisdomUnknown = different truthFind the automorphism

πŸ—ΊοΈ Spatial Algebra

Addresses a weakness found in benchmarks: spatial adjacency scoring was very low (0.03–0.10) because the original mapping used point values rather than relationships between neighbors.

The fix: map gradient directions to Fano points, not pixel values. 7 Fano points ↔ 7 discrete gradient directions covering [0Β°, 180Β°). Fano lines become gradient compatibility rules. Repair changes from "fix a pixel" to "find a compatible gradient pattern" β€” edge-aware, structure-preserving.

Repair Strategies

The repair engine tries strategies in order of algebraic sophistication, falling back to simpler methods when the algebra can't fully solve the problem:

1.

Single-error correction

Try each of the 7 positions, find a valid Fano state. Fast, handles most common corruption.

2.

Automorphism search

Search the 168 automorphisms for the best mapping from corrupted β†’ valid. The core group-theoretic approach.

3.

Parallel universes

Generate 7 repair candidates and score each. Inspired by the multi-universe computation in the composable algebra thread.

4.

Neighbor voting

Use neighbor consensus for ambiguous cases. Spatial context resolves algebraic ties.

5.

Interpolation fallback

For corruption beyond algebraic recovery. Not every problem has a clean group-theoretic solution.

Corruption Model

Six corruption types are classified, each mapping to a real-world failure mode:

Single Value

Transmission errors β€” one value changed

Missing Data

Dropped packets, bad sectors β€” data gaps

Transposition

Buffer issues β€” values swapped

Duplication

Read errors β€” repeated data

Burst

Physical media damage β€” contiguous region

Adversarial

Intentional corruption β€” worst case

Benchmark Results

Tested against Knock-Knock (1940) β€” 139 MB, 10,132 frames, 960Γ—720 H.264.

Error Detection Rate

1 error / block 54%
2 errors / block 85%
3 errors / block 93%

False positive rate: 0–2% across all modes

Where Fano Excels

  • βœ“ Block-level detection β€” operates where FFmpeg cannot (sub-frame granularity)
  • βœ“ Near-zero false positives β€” algebraic constraints are either satisfied or not
  • βœ“ Corruption typing β€” can distinguish burst from transposition from adversarial
  • ~ Block repair β€” moderate improvement (3.7–6.0% of blocks); FFmpeg better at stream-level recovery

Recommended Pipeline

Fano detection β†’ Fano single-error repair β†’ FFmpeg transcode β†’ PSNR/SSIM verify

Fano excels at detection and classification; FFmpeg excels at stream-level recovery. They complement, not replace, each other.

The Streaming Protocol (ASP)

The Algebraic Streaming Protocol combines three ideas:

IOP Chain β€” "Gesture as Proof"

Each transformation IS a proof. Consecutive transforms compose algebraically: T₁ ∘ Tβ‚‚ ∘ T₃ = Tcombined. The chain of operations is both the data and the verification that the data is valid.

AVF Codec β€” Algebraic Video Format

Video format with built-in repair metadata. Transforms are automorphism indices (8 bits each), and consecutive transforms compose to simpler forms. The compression itself is a Fano-algebraic operation.

Secure vs Vulnerable Fano Lines

Fano lines are labeled by semantic function β€” the "secure" tonic line {B,C,E} vs the "risky" tritone line {F,G,B} . These map to protocol paths: high-confidence vs speculative data channels, like TLS confidence levels.

Strongest Future Direction

Encoding-time Fano-structured redundancy. The current approach applies Fano analysis after corruption. The bigger opportunity: add algebraic parity data during encoding, so the Fano structure is part of the file format itself. This would enable true algebraic recovery at decode time, not just detection and partial repair.

Connections to Other Threads

The Fano Repair project is an applied engineering application of the CAExperiments algebra research. Join our Discord to discuss, or leave your email to be notified when we publish the code.