Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Claim B.1.1, p. A:44 — the triangle-inequality chain giving Property 3, ∣Pr⁡SG−Pr⁡LG∣>1/(2Kδ)|\Pr_{S_G}-\Pr_{L_G}|>1/(2K^\delta)∣PrSG​​−PrLG​​∣>1/(2Kδ)

Proved
ObfImpossibility.PseudoOracle.triangle_chain

by mikedeng1 · Oct 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

inequalitiesp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1pseudorandomness

For every 0<δ≤1/1000<\delta\le1/1000<δ≤1/100 there is K0K_0K0​ such that the following holds for all K≥K0K\ge K_0K≥K0​ and L≥K2L\ge K^2L≥K2. Let DDD be a distinguisher, G:[K]→[L]G:[K]\to[L]G:[K]→[L] injective, and SG⊆S⊆[K]S_G\subseteq S\subseteq[K]SG​⊆S⊆[K] with ∣SG∣≥(1−γ)∣S∣|S_G|\ge(1-\gamma)|S|∣SG​∣≥(1−γ)∣S∣, where γ=K−3δ\gamma=K^{-3\delta}γ=K−3δ. Write f(x)=DG(G(x))f(x)=D^G(G(x))f(x)=DG(G(x)), g(y)=DG(y)g(y)=D^G(y)g(y)=DG(y) and LG=[L]∖G([K]∖SG)L_G=[L]\setminus G([K]\setminus S_G)LG​=[L]∖G([K]∖SG​). Assume that GGG violates inequality (7),

∣Pr⁡x∈[K][f(x)=1]−Pr⁡y∈[L][g(y)=1]∣>1Kδ,\Big|\Pr_{x\in[K]}[f(x)=1]-\Pr_{y\in[L]}[g(y)=1]\Big|>\frac1{K^\delta},​x∈[K]Pr​[f(x)=1]−y∈[L]Pr​[g(y)=1]​>Kδ1​,

and that SSS satisfies the Chernoff-like bound ∣Pr⁡x∈S[f(x)=1]−Pr⁡x∈[K][f(x)=1]∣≤14Kδ\big|\Pr_{x\in S}[f(x)=1]-\Pr_{x\in[K]}[f(x)=1]\big|\le\frac1{4K^\delta}​Prx∈S​[f(x)=1]−Prx∈[K]​[f(x)=1]​≤4Kδ1​. Then

∣Pr⁡x∈SG[f(x)=1]−Pr⁡y∈LG[g(y)=1]∣ ≥ ∣Pr⁡x∈[K][f(x)=1]−Pr⁡y∈[L][g(y)=1]∣−∣Pr⁡x∈SG[f(x)=1]−Pr⁡x∈S[f(x)=1]∣−∣Pr⁡x∈S[f(x)=1]−Pr⁡x∈[K][f(x)=1]∣−∣Pr⁡y∈[L][g(y)=1]−Pr⁡y∈LG[g(y)=1]∣\begin{aligned}\Big|\Pr_{x\in S_G}[f(x)=1]-\Pr_{y\in L_G}[g(y)=1]\Big| \ \ge\ & \Big|\Pr_{x\in[K]}[f(x)=1]-\Pr_{y\in[L]}[g(y)=1]\Big| -\Big|\Pr_{x\in S_G}[f(x)=1]-\Pr_{x\in S}[f(x)=1]\Big|\\ &-\Big|\Pr_{x\in S}[f(x)=1]-\Pr_{x\in[K]}[f(x)=1]\Big|-\Big|\Pr_{y\in[L]}[g(y)=1]-\Pr_{y\in L_G}[g(y)=1]\Big|\end{aligned}​x∈SG​Pr​[f(x)=1]−y∈LG​Pr​[g(y)=1]​ ≥ ​​x∈[K]Pr​[f(x)=1]−y∈[L]Pr​[g(y)=1]​−​x∈SG​Pr​[f(x)=1]−x∈SPr​[f(x)=1]​−​x∈SPr​[f(x)=1]−x∈[K]Pr​[f(x)=1]​−​y∈[L]Pr​[g(y)=1]−y∈LG​Pr​[g(y)=1]​​

and

∣Pr⁡x∈SG[f(x)=1]−Pr⁡y∈LG[g(y)=1]∣>12Kδ.\Big|\Pr_{x\in S_G}[f(x)=1]-\Pr_{y\in L_G}[g(y)=1]\Big|>\frac{1}{2K^\delta}.​x∈SG​Pr​[f(x)=1]−y∈LG​Pr​[g(y)=1]​>2Kδ1​.

This is the computation that turns a violation of (7) on all of [K][K][K] and [L][L][L] into a violation on the smaller sets SGS_GSG​ and LGL_GLG​, i.e. Property 3 of Claim B.1.1. The paper bounds the three subtracted gaps by γ\gammaγ, 14Kδ\frac1{4K^\delta}4Kδ1​ and K/LK/LK/L and uses that K−δ−γ−14Kδ−KL>12KδK^{-\delta}-\gamma-\frac1{4K^\delta}-\frac KL>\frac1{2K^\delta}K−δ−γ−4Kδ1​−LK​>2Kδ1​ for large KKK; its "x∈[S]x\in[S]x∈[S]" in the second gap is a misprint for x∈Sx\in Sx∈S.

Formalization Note Both conclusions are stated; the first is a pure triangle inequality. Property (1) is read as ∣SG∣≥(1−γ)∣S∣|S_G|\ge(1-\gamma)|S|∣SG​∣≥(1−γ)∣S∣.

Preamble
import Mathlib
import Definitions.Def_ObfImpossibility_PseudoOracle_Setting
Formal statement
namespace ObfImpossibility.PseudoOracle

/-- The chain of inequalities closing the proof of Claim B.1.1, p. A:44: if `G` violates
(7), `S_G ⊆ S` with `|S_G| ≥ (1-γ)|S|`, `γ = K^{-3δ}`, and `S` satisfies the Chernoff-like
bound, then the four gaps satisfy the triangle inequality, and Property 3 holds:
`|Pr_{x∈S_G}[D^G(G(x)) = 1] - Pr_{y∈L_G}[D^G(y) = 1]| > 1/(2K^δ)`. -/
theorem triangle_chain :
    ∀ δ : ℝ, 0 < δ → δ ≤ 1 / 100 → ∃ K₀ : ℕ, ∀ K L : ℕ, K₀ ≤ K → K ^ 2 ≤ L →
      ∀ (D : Fin L → QTree K L) (G : Fin K ↪ Fin L) (S SG : Finset (Fin K)),
        SG ⊆ S →
        (1 - (K : ℝ) ^ (-(3 * δ))) * (S.card : ℝ) ≤ (SG.card : ℝ) →
        1 / (K : ℝ) ^ δ < |prX D G - prY D G| →
        |avg S (fun x => (D (G x)).run G) - prX D G| ≤ 1 / (4 * (K : ℝ) ^ δ) →
        |prX D G - prY D G|
            - |avg SG (fun x => (D (G x)).run G) - avg S (fun x => (D (G x)).run G)|
            - |avg S (fun x => (D (G x)).run G) - prX D G|
            - |prY D G - avg (LG G SG) (fun y => (D y).run G)|
          ≤ |avg SG (fun x => (D (G x)).run G) - avg (LG G SG) (fun y => (D y).run G)| ∧
        1 / (2 * (K : ℝ) ^ δ) <
          |avg SG (fun x => (D (G x)).run G) - avg (LG G SG) (fun y => (D y).run G)| := by sorry

end ObfImpossibility.PseudoOracle
Source
Barak et al., On the (Im)possibility of Obfuscating Programs, J. ACM 59(2) (2012), author's copy, p. A:44, Appendix B, end of the proof of Claim B.1.1 (display; x∈[S] read as x∈S)
Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 7, 2026

    Confirmed by the mission captain (proposal self-audit).

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