Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Sensitivity separation: TagPrefixFacts (complete source module)

Definition
BS2_b3ba934b_TagPrefixFacts

by yousofy · Oct 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

block-sensitivitysensitivitysensitivity-first-two-20261025

Complete Lean source module TagPrefixFacts from the two verified sensitivity separation proofs. The module supplies the definitions, auxiliary lemmas, and exact finite certificates used by its dependent modules. All original declarations and proof bodies are retained; only local import module paths are changed for Prove2Me. The final campaign goals are published separately as theorems with submitted solutions.

Definition code
import Definitions.Def_BS2_b3ba934b_ActualTargetAccounting
import Definitions.Def_BS2_b3ba934b_ActualKindFilters

set_option autoImplicit false
set_option maxHeartbeats 5000000
set_option maxRecDepth 10000

namespace ThreeBoundTagPrefixes
open OAI.Paper320 ThreeBoundWitness ThreeBoundProfiles ThreeBoundGradedCandidates
open ThreeBoundGradedCover ThreeBoundActualHeadCosts ThreeBoundAllKindHeadCosts
open ThreeBoundActualTargets
open scoped Classical BigOperators
noncomputable section
variable {n : ℕ} {I V : Type} [Fintype I] [Fintype V]

theorem kind_target_prefix_iff
    (S : Stage (Fin n) I V) (F : Fin n → (I → Bool) → Bool) (hF : Nested F)
    (i j : Fin n) (P : PairData S F i j) (x : ((V × Bool) × I) → Bool)
    (hQ : S.tolerance j ≤ 2) (w : V) (kind : Fin 8)
    (hk : Q2CandidateTypes.OfKind (fun z => F (S.guard j) z = true)
      (fun k z => F (P.strong k) z = true) (S.tolerance j) (failed S F j x w).card
      (child x w false) (child x w true) kind) (q : ℕ) :
    w ∈ targetPrefix S F P.strong j x q ↔ ThreeBoundQ2.positivePrefix q kind = true := by
  have hhigh := Q2CandidateTypes.ofKind_high (fun z => F (S.guard j) z = true)
    (fun k z => F (P.strong k) z = true) (S.tolerance j) (failed S F j x w).card
    (child x w false) (child x w true) kind hk
  have hH : w ∈ highHeads S F P.strong j x :=
    Finset.mem_filter.mpr ⟨Finset.mem_univ _,hhigh⟩
  have htP := fun b hp => target_of_positive S F P.strong j x w b hp
  have hpT := fun ht => positive_of_target_high S F hF i j P x w hH ht
  simp only [targetPrefix,Finset.mem_filter,Finset.mem_univ,true_and]
  fin_cases kind <;> simp only [Q2CandidateTypes.OfKind] at hk
  · have ht := htP 0 hk
    have hc := hk.1.2.1
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,ht,hc]
  · have ht := htP 1 hk.1
    have hc := hk.1.1.2.1
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,ht,hc]
  · have ht := htP 2 hk.1
    have hc := hk.1.1.2.1
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,ht,hc]
  · have hc := hk.1.2.1
    have hn : ¬ targetAt S F P.strong j x w := by
      intro ht
      apply hk.2
      simpa only [hc] using hpT ht
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,hn]
  · have hc := hk.1.2.1
    have hn : ¬ targetAt S F P.strong j x w := by
      intro ht
      apply hk.2
      simpa only [hc] using hpT ht
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,hn]
  · have hc := hk.2.1
    have hn : ¬ targetAt S F P.strong j x w := by
      intro ht
      have hh := ht.1
      omega
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,hn]
  · have ht := htP 1 hk.1
    have hc := hk.1.1.2.1
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,ht,hc]
  · have ht := htP 2 hk.1
    have hc := hk.1.1.2.1
    simp [ThreeBoundQ2.positivePrefix,ThreeBoundQ2.positiveLevel,ht,hc]

theorem prefix_high_eq
    (S : Stage (Fin n) I V) (F : Fin n → (I → Bool) → Bool) (hF : Nested F)
    (i j : Fin n) (P : PairData S F i j) (x : ((V × Bool) × I) → Bool)
    (hQ : S.tolerance j ≤ 2) (tag : V → Fin 8)
    (hk : ∀ w ∈ highHeads S F P.strong j x,
      Q2CandidateTypes.OfKind (fun z => F (S.guard j) z = true)
        (fun k z => F (P.strong k) z = true) (S.tolerance j) (failed S F j x w).card
        (child x w false) (child x w true) (tag w)) (q : ℕ) :
    targetPrefix S F P.strong j x q ∩ highHeads S F P.strong j x =
      (highHeads S F P.strong j x).filter fun w => ThreeBoundQ2.positivePrefix q (tag w) = true := by
  ext w
  simp only [Finset.mem_inter,Finset.mem_filter]
  constructor
  · rintro ⟨ht,hh⟩
    exact ⟨hh,(kind_target_prefix_iff S F hF i j P x hQ w (tag w) (hk w hh) q).1 ht⟩
  · rintro ⟨hh,ht⟩
    exact ⟨(kind_target_prefix_iff S F hF i j P x hQ w (tag w) (hk w hh) q).2 ht,hh⟩

theorem outside_high_eq
    (S : Stage (Fin n) I V) (F : Fin n → (I → Bool) → Bool) (hF : Nested F)
    (i j : Fin n) (P : PairData S F i j) (x : ((V × Bool) × I) → Bool)
    (hQ : S.tolerance j ≤ 2) (tag : V → Fin 8)
    (hk : ∀ w ∈ highHeads S F P.strong j x,
      Q2CandidateTypes.OfKind (fun z => F (S.guard j) z = true)
        (fun k z => F (P.strong k) z = true) (S.tolerance j) (failed S F j x w).card
        (child x w false) (child x w true) (tag w)) (q b : ℕ) :
    ((highHeads S F P.strong j x \ targetPrefix S F P.strong j x q).filter
      fun w => (failed S F j x w).card ≤ b) =
      (highHeads S F P.strong j x).filter fun w =>
        ThreeBoundQ2.positivePrefix q (tag w) = false ∧ ThreeBoundQ2.budget (tag w) ≤ b := by
  ext w
  simp only [Finset.mem_filter,Finset.mem_sdiff]
  by_cases hh : w ∈ highHeads S F P.strong j x
  · have ht := kind_target_prefix_iff S F hF i j P x hQ w (tag w) (hk w hh) q
    have hc := Q2CandidateTypes.ofKind_count (fun z => F (S.guard j) z = true)
      (fun k z => F (P.strong k) z = true) (S.tolerance j) (failed S F j x w).card
      (child x w false) (child x w true) (tag w) (hk w hh)
    rw [Q2CandidateTypes.budget_eq_enumerator] at hc
    simp only [hh,true_and,hc,ht]
    cases ThreeBoundQ2.positivePrefix q (tag w) <;> simp
  · simp [hh]

end
end ThreeBoundTagPrefixes

#print axioms ThreeBoundTagPrefixes.kind_target_prefix_iff
#print axioms ThreeBoundTagPrefixes.outside_high_eq
Source
Attached verified checkpoint block_sensitivity_three_bounds; lean_project/TagPrefixFacts.lean; original SHA-256 37625d9efa0163c9bb1fb859d5eaf3ee7862e3f1aac96302868f475f4bb1c04d; campaign https://prove2.me/campaigns/block-sensitivity-vs-sensitivity

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