Complete Binary Tree Cover Bound #
This module formalizes the minimal covering set cover S of a leaf subset S in a complete
binary tree of height h (n = 2 ^ h leaves) and proves the logarithmic cover-size bound of
[BS23], Section 5.6 (Definition 5.4 and Theorem 5.8, pp. 206–207).
Main definitions #
Cslib.CompleteBinaryTree.Node: nodes(level, index)in a complete binary tree of heighth.Cslib.CompleteBinaryTree.Covers:Covers W Sholds when the leaves descending fromWare preciselyS.Cslib.CompleteBinaryTree.cover: canonical minimal covering setcover SofS.
Main results #
Cslib.CompleteBinaryTree.covers_cover:cover ScoversS.Cslib.CompleteBinaryTree.card_cover_le_of_covers: every cover ofShas cardinality at least(cover S).card.Cslib.CompleteBinaryTree.card_cover_le: for1 ≤ randS.card + r = 2 ^ h,(cover S).card ≤ r * Real.logb 2 (2 ^ h / r)(Theorem 5.8).
Deviations from [BS23] #
- Theorem 5.8 writes
|S| = n - rwith1 ≤ r ≤ n; here the hypothesis is stated asS.card + r = 2 ^ htogether with1 ≤ rsor ≤ 2 ^ his built in without natural-number subtraction truncation. - In the
r₁ = 0branch of the inductive proof of Theorem 5.8 ([BS23], p. 207), the printed display writes|cover(S)| = |cover(S₂)|, omitting the+ 1for the full half's root;card_cover_leaccounts for that+ 1using1 ≤ r.
References #
- [BS23] Dan Boneh and Victor Shoup, A Graduate Course in Applied Cryptography, version 0.6, Section 5.6, Definition 5.4 and Theorem 5.8, pp. 206–207.
@[instance_reducible]
The root of the complete binary tree of height h.
@[instance_reducible]
instance Cslib.CompleteBinaryTree.instDecidableCoversLeaf {h : ℕ} (v : Node h) (i : Fin (2 ^ h)) :
Decidable (v.CoversLeaf i)
theorem Cslib.CompleteBinaryTree.card_cover_le {h r : ℕ} {S : Finset (Fin (2 ^ h))} (hr : 1 ≤ r) (hS : S.card + r = 2 ^ h) :
Theorem 5.8 ([BS23], p. 207): In a complete binary tree with n = 2 ^ h leaves,
for every 1 ≤ r ≤ n and every subset S of n - r leaves (written S.card + r = 2 ^ h so
r ≤ 2 ^ h is built in without natural-number subtraction truncation),
|cover(S)| ≤ r * log₂(n / r). In the r₁ = 0 case, the printed proof omits the + 1 for the
full half's root (|cover(S)| = |cover(S₂)|); the bound still holds because 1 ≤ r.