OAI/Computability/MaxCut/Encoding/Bit.lean
63 declarations, 0 contain sorry, 0 declared as axioms
- abbrev
OAI.OptimalMaxCut.TreeCode.Bitline 10 - abbrev
OAI.OptimalMaxCut.TreeCode.Branchline 11 - abbrev
OAI.OptimalMaxCut.TreeCode.Tableline 12 - def
OAI.OptimalMaxCut.TreeCode.Nodesline 14 - def
OAI.OptimalMaxCut.TreeCode.Leavesline 18 - instance
OAI.OptimalMaxCut.TreeCode.nodesFintypeline 22 - instance
OAI.OptimalMaxCut.TreeCode.leavesFintypeline 27 - instance
OAI.OptimalMaxCut.TreeCode.nodesDecidableEqline 32 - instance
OAI.OptimalMaxCut.TreeCode.leavesDecidableEqline 37 - theorem
OAI.OptimalMaxCut.TreeCode.card_leavesline 42 - def
OAI.OptimalMaxCut.TreeCode.gateline 53 - def
OAI.OptimalMaxCut.TreeCode.wordline 58Source documentation
The same complete 2s-ary tree code, with leaves canonically indexed by branch words instead of choosing an arbitrary bijection with Fin k.
def word {s : ℕ} : {m : ℕ} → (Nodes s m → Table s) → (Leaves s m → Bit) → Bit | 0, _, x => x () | _m + 1, F, x => gate (F (.inl ())) (fun gb => word (fun v => F (.inr (gb, v))) (fun i => x (gb, i)))Mentions: OAI.OptimalMaxCut.TreeCode.Nodes, OAI.OptimalMaxCut.TreeCode.Table, OAI.OptimalMaxCut.TreeCode.Leaves, OAI.OptimalMaxCut.TreeCode.Bit, OAI.OptimalMaxCut.TreeCode.gate
- inductive
OAI.OptimalMaxCut.TreeCode.Sliceline 63 - def
OAI.OptimalMaxCut.TreeCode.onSliceline 68Source documentation
Membership in the slice, for a tree of any total depth.
def onSlice {s : ℕ} : {j m : ℕ} → Slice s j → Nodes s m → Bool | _, 0, _, v => nomatch v | 0, _ + 1, .root, .inl _ => true | 0, _ + 1, .root, .inr _ => false | _ + 1, _ + 1, .next _ _, .inl _ => false | _ + 1, _ + 1, .next g child, .inr ((g', b), v) => if g' = g then onSlice (child b) v else false /-- Negate exactly the whole tables on the fixed slice, and no other table. -/Mentions: OAI.OptimalMaxCut.TreeCode.Slice, OAI.OptimalMaxCut.TreeCode.Nodes
- def
OAI.OptimalMaxCut.TreeCode.flipTablesline 77Source documentation
Negate exactly the whole tables on the fixed slice, and no other table.
def flipTables {s j m : ℕ} (S : Slice s j) (F : Nodes s m → Table s) : Nodes s m → Table s := fun v z => F v z + if onSlice S v then 1 else 0Mentions: OAI.OptimalMaxCut.TreeCode.Slice, OAI.OptimalMaxCut.TreeCode.Nodes, OAI.OptimalMaxCut.TreeCode.Table, OAI.OptimalMaxCut.TreeCode.onSlice
- theorem
OAI.OptimalMaxCut.TreeCode.bit_add_selfline 80 - theorem
OAI.OptimalMaxCut.TreeCode.bit_one_add_oneline 84 - theorem
OAI.OptimalMaxCut.TreeCode.gate_pair_flipline 88Source documentation
Simultaneously multiplying the two children in pair g by -1 leaves all inputs to the gate table fixed and multiplies its prefactor by -1.
theorem gate_pair_flip {s : ℕ} (F : Table s) (Z : Branch s → Bit) (g : Fin s) : gate F (fun gb => Z gb + if gb.1 = g then 1 else 0) = gate F Z + 1 := by …Mentions: OAI.OptimalMaxCut.TreeCode.Table, OAI.OptimalMaxCut.TreeCode.Branch, OAI.OptimalMaxCut.TreeCode.Bit, OAI.OptimalMaxCut.TreeCode.gate
- theorem
OAI.OptimalMaxCut.TreeCode.word_flipTablesline 108 - theorem
OAI.OptimalMaxCut.TreeCode.bit_casesline 156 - def
OAI.OptimalMaxCut.TreeCode.signline 161 - theorem
OAI.OptimalMaxCut.TreeCode.sign_zeroline 163 - theorem
OAI.OptimalMaxCut.TreeCode.sign_oneline 164 - theorem
OAI.OptimalMaxCut.TreeCode.sign_addline 166 - theorem
OAI.OptimalMaxCut.TreeCode.sign_sqline 170 - theorem
OAI.OptimalMaxCut.TreeCode.sign_add_oneline 173 - theorem
OAI.OptimalMaxCut.TreeCode.sign_sumline 177 - theorem
OAI.OptimalMaxCut.TreeCode.gate_signline 186Source documentation
The implemented gate is EXACTLY equation (gate-rule), not a replacement operator with only the same symmetry.
theorem gate_sign {s : ℕ} (F : Table s) (Z : Branch s → Bit) : sign (gate F Z) = (∏ g, sign (Z (g, false))) * sign (F (fun g => Z (g, false) + Z (g, true))) := by …Mentions: OAI.OptimalMaxCut.TreeCode.Table, OAI.OptimalMaxCut.TreeCode.Branch, OAI.OptimalMaxCut.TreeCode.Bit, OAI.OptimalMaxCut.TreeCode.sign, OAI.OptimalMaxCut.TreeCode.gate
- def
OAI.OptimalMaxCut.TreeCode.labelWordline 193 - theorem
OAI.OptimalMaxCut.TreeCode.labelWord_flipTablesline 196 - def
OAI.OptimalMaxCut.TreeCode.Oddline 202 - theorem
OAI.OptimalMaxCut.TreeCode.code_flipTablesline 205 - abbrev
OAI.OptimalMaxCut.TreeCode.SliceNodeline 212 - abbrev
OAI.OptimalMaxCut.TreeCode.SliceTablesline 215 - def
OAI.OptimalMaxCut.TreeCode.fillTablesline 219Source documentation
Fill the slice with independently supplied complete Boolean tables, leaving all outside tables at their fixed values.
def fillTables {s j m : ℕ} (S : Slice s j) (outside : Nodes s m → Table s) (inside : SliceTables (m := m) S) : Nodes s m → Table s := …Mentions: OAI.OptimalMaxCut.TreeCode.Slice, OAI.OptimalMaxCut.TreeCode.Nodes, OAI.OptimalMaxCut.TreeCode.Table, OAI.OptimalMaxCut.TreeCode.SliceTables
- def
OAI.OptimalMaxCut.TreeCode.insideFlipline 224Source documentation
The measure-preserving simultaneous negation of all slice-entry signs.
def insideFlip {s j m : ℕ} (S : Slice s j) : SliceTables (m := m) S ≃ SliceTables (m := m) S where …Mentions: OAI.OptimalMaxCut.TreeCode.Slice, OAI.OptimalMaxCut.TreeCode.SliceTables
- theorem
OAI.OptimalMaxCut.TreeCode.fillTables_insideFlipline 231 - theorem
OAI.OptimalMaxCut.TreeCode.conditional_code_mean_zeroline 242Source documentation
The precise conditional balancing assertion used in extraction Step 1. Rows, all outside tables, and the fixed slice are arbitrary and NOT averaged. Only independent uniform slice bits are averaged.
theorem conditional_code_mean_zero {A : Type*} {s j m : ℕ} (S : Slice s j) (hjm : j < m) (outside : Nodes s m → Table s) (R : Leaves s m → A → Bit) (φ : (A → Bit) → ℝ) (hφ : Odd φ) : (𝔼 inside : SliceTables (m := m) S, φ (labelWord (fillTables S outside inside) R)) = 0 := by …Mentions: OAI.OptimalMaxCut.TreeCode.Slice, OAI.OptimalMaxCut.TreeCode.Nodes, OAI.OptimalMaxCut.TreeCode.Table, OAI.OptimalMaxCut.TreeCode.Leaves, OAI.OptimalMaxCut.TreeCode.Bit, OAI.OptimalMaxCut.TreeCode.Odd, OAI.OptimalMaxCut.TreeCode.SliceTables, OAI.OptimalMaxCut.TreeCode.labelWord, OAI.OptimalMaxCut.TreeCode.fillTables
- def
OAI.OptimalMaxCut.TreeCode.rowKernelline 267Source documentation
Exactly retain the old whole row with probability r, otherwise draw an independent uniform whole row. This is not independent noise on its bits.
noncomputable def rowKernel (r : ℝ) (x y : H) : ℝ := …
- theorem
OAI.OptimalMaxCut.TreeCode.rowKernel_nonnegline 270 - theorem
OAI.OptimalMaxCut.TreeCode.rowKernel_sumline 277 - theorem
OAI.OptimalMaxCut.TreeCode.rowKernel_symmline 285 - def
OAI.OptimalMaxCut.TreeCode.rowsKernelline 288 - theorem
OAI.OptimalMaxCut.TreeCode.rowsKernel_nonnegline 292 - theorem
OAI.OptimalMaxCut.TreeCode.rowsKernel_sumline 296 - def
OAI.OptimalMaxCut.TreeCode.rowSmoothingline 301 - theorem
OAI.OptimalMaxCut.TreeCode.rowSmoothing_rangeline 304 - theorem
OAI.OptimalMaxCut.TreeCode.conditional_smoothed_code_mean_zeroline 323Source documentation
Exact conditional balancing survives whole-row resampling, with fixed rows/outside tables/slice. No probabilistic averaging of those contexts is used.
theorem conditional_smoothed_code_mean_zero {A H : Type*} [Fintype H] [DecidableEq H] [Nonempty H] {s j m : ℕ} (S : Slice s j) (hjm : j < m) (outside : Nodes s m → Table s) (evalRow : H → A → Bit) (r : ℝ) (R : Leaves s m → H) (φ : (A → Bit) → ℝ) (hφ : Odd φ) : (𝔼 inside : SliceTables (m := m) S, …Mentions: OAI.OptimalMaxCut.TreeCode.Slice, OAI.OptimalMaxCut.TreeCode.Nodes, OAI.OptimalMaxCut.TreeCode.Table, OAI.OptimalMaxCut.TreeCode.Bit, OAI.OptimalMaxCut.TreeCode.Leaves, OAI.OptimalMaxCut.TreeCode.Odd, OAI.OptimalMaxCut.TreeCode.SliceTables
- def
OAI.OptimalMaxCut.TreeCode.characterline 342Source documentation
Probability-normalized finite Walsh transform, expressed in the same sign-bit coordinates as the tree.
def character (q x : I → Bit) : ℝ := ∏ i, sign (q i * x i)
Mentions: OAI.OptimalMaxCut.TreeCode.Bit, OAI.OptimalMaxCut.TreeCode.sign
- theorem
OAI.OptimalMaxCut.TreeCode.bit_character_orthogonalityline 344 - theorem
OAI.OptimalMaxCut.TreeCode.character_symmline 353 - theorem
OAI.OptimalMaxCut.TreeCode.character_sum_orthogonalityline 356 - def
OAI.OptimalMaxCut.TreeCode.bitCoefficientline 371 - theorem
OAI.OptimalMaxCut.TreeCode.bitWalsh_inversionline 374 - theorem
OAI.OptimalMaxCut.TreeCode.gate_expansionline 393 - theorem
OAI.OptimalMaxCut.TreeCode.rowSmoothing_oneline 416 - theorem
OAI.OptimalMaxCut.TreeCode.rowSmoothing_sumline 422 - theorem
OAI.OptimalMaxCut.TreeCode.rowSmoothing_smulline 429 - theorem
OAI.OptimalMaxCut.TreeCode.rowSmoothing_tensorline 438Source documentation
Independence of whole-row resampling across disjoint complete subtrees.
theorem rowSmoothing_tensor (r : ℝ) (f : I → (J → H) → ℝ) (R : I × J → H) : rowSmoothing r (fun x => ∏ i, f i (fun j => x (i, j))) R = ∏ i, rowSmoothing r (f i) (fun j => R (i, j)) := by …Mentions: OAI.OptimalMaxCut.TreeCode.rowSmoothing
- theorem
OAI.OptimalMaxCut.TreeCode.rowSmoothing_pairsline 454Source documentation
A tensor product with one chosen member of each ordered pair. The unused subtrees are integrated with total mass exactly one.
theorem rowSmoothing_pairs {s : ℕ} (r : ℝ) (b : Fin s → Bool) (f : Branch s → (J → H) → ℝ) (R : Branch s × J → H) : rowSmoothing r (fun x => ∏ g, f (g, b g) (fun j => x ((g, b g), j))) R = ∏ g, rowSmoothing r (f (g, b g)) (fun j => R ((g, b g), j)) := by …Mentions: OAI.OptimalMaxCut.TreeCode.Branch, OAI.OptimalMaxCut.TreeCode.rowSmoothing
- theorem
OAI.OptimalMaxCut.TreeCode.sum_signline 475 - theorem
OAI.OptimalMaxCut.TreeCode.rowKernel_signline 481 - theorem
OAI.OptimalMaxCut.TreeCode.word_leaf_smoothingline 487