Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Honesty is free.

Proved
AlmostLossless.exists_scanScheme_of_code

by raver1975 · Sep 12, 2026 · Mathlib c5ea003 (Lean v4.30.0)

aether-cataloglogic

Honesty is free. Every code K — honest or not — is matched, on its correct set, by a uniqueness-scan code: the scan code is honest for free, has exactly the same correct set, and its decoder probes at most one candidate. The only cost is the single extra alphabet symbol of Option C.

theorem AlmostLossless.exists_scanScheme_of_code[DecidableEq C] (K : Code S C) :
    ∃ P : ScanScheme S Unit C,
      (∀ s : S, Correct (P.code ()) s ↔ Correct K s) ∧
      Honest (P.code ()) ∧
      (∀ m : C, P.decodeCost () m ≤ 1) := by sorry

Formalization Note Transplanted verbatim from the Aether Catalog source Logic/AlmostLossless/Optimality.lean; the statement is byte-identical to the source declaration, elaborated with autoImplicit disabled in the platform environment.

Preamble
-- Thm stub generated from Logic/AlmostLossless/Optimality.lean
import Mathlib
import Definitions.Def_Logic_AlmostLossless_Core
import Definitions.Def_Logic_AlmostLossless_Instances
import Definitions.Def_Logic_AlmostLossless_Scheme

/-!
# Optimality: randomness is never useful, and honesty is free

Two structural results that close the loop opened by `Core` and `Scheme`.

* `AlmostLossless.randomized_epsilon_pigeonhole` — the exact `ε`-pigeonhole
  characterisation survives randomisation: if *any* randomized ensemble of codes
  has average failure probability `≤ ε`, then already a set of `≤ |C|` source
  words carries probability `≥ 1 - ε`, so a *deterministic* code achieves the
  same `ε`.  Shared randomness buys nothing, for **every** source (the earlier
  `randomized_avg_failProb_lower` was the uniform-source special case).

* `AlmostLossless.exists_scanScheme_of_code` — conversely, *every* code, honest
  or not, is matched on its correct set by a uniqueness-scan code, whose decoder
  probes at most **one** candidate.  So the "no silent corruption" guarantee
  costs one extra alphabet symbol and nothing else: no checksum, no rate loss
  beyond `+1`, no decoding time.
-/

open AlmostLossless

open Finset

variable {S C : Type*} [Fintype S] [DecidableEq S]

/-! ## Randomness never helps -/




/-! ## Honesty is free -/
Formal statement
theorem AlmostLossless.exists_scanScheme_of_code[DecidableEq C] (K : Code S C) :
    ∃ P : ScanScheme S Unit C,
      (∀ s : S, Correct (P.code ()) s ↔ Correct K s) ∧
      Honest (P.code ()) ∧
      (∀ m : C, P.decodeCost () m ≤ 1) := by sorry
Source
https://github.com/paulklemstine/Lean/blob/53c2925a02/Catalog/Logic/AlmostLossless/Optimality.lean#L74

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me