Lean module · Foundations
BanditRLProof.LowerBounds.PrefixCodePruning
Generated source map for this Lean module.
Module map
Imports
BanditRLProof.LowerBounds.PrefixCodeSiblings
Imported by
Declarations
Open an item to read its exact compact statement and source link. Detailed teaching notes are linked when registered.
theorem
BanditRLProof.LowerBounds.deepest_parent_incomparable
Compiled
A deepest leaf with no sibling has a parent incomparable with every other word.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.deepest_parent_incomparableReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem deepest_parent_incomparable {α : Type*} (code : BinaryPrefixCode α) (a : α) (w : List Bool) (b : Bool) (ha : code.encode a = w ++ [b]) (hmax : ∀ i, (code.encode i).length ≤ (code.encode a).length) (hmissing : ∀ i, code.encode i ≠ w ++ [!b]) : ∀ i, i ≠ a → (¬ code.encode i <+: w) ∧ (¬ w <+: code.encode i)
def
BanditRLProof.LowerBounds.BinaryPrefixCode.replaceWord
Compiled
Replace one word by an incomparable nonempty word, preserving code validity.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.BinaryPrefixCode.replaceWordReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def BinaryPrefixCode.replaceWord {α : Type*} [DecidableEq α] (code : BinaryPrefixCode α) (a : α) (w : List Bool) (hw : w ≠ []) (hsep : ∀ i, i ≠ a → (¬ code.encode i <+: w) ∧ (¬ w <+: code.encode i)) : BinaryPrefixCode α
def
BanditRLProof.LowerBounds.BinaryPrefixCode.pruneDeepest
Compiled
Legal deletion of the last bit of a deepest sibling-free leaf.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.BinaryPrefixCode.pruneDeepestReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def BinaryPrefixCode.pruneDeepest {α : Type*} [DecidableEq α] (code : BinaryPrefixCode α) (a : α) (w : List Bool) (b : Bool) (hw : w ≠ []) (ha : code.encode a = w ++ [b]) (hmax : ∀ i, (code.encode i).length ≤ (code.encode a).length) (hmissing : ∀ i, code.encode i ≠ w ++ [!b]) : BinaryPrefixCode α
theorem
BanditRLProof.LowerBounds.expectedCodeLength_replaceWord
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.expectedCodeLength_replaceWordReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem expectedCodeLength_replaceWord {α : Type*} [Fintype α] [DecidableEq α] (p : α → ℝ) (code : BinaryPrefixCode α) (a : α) (w : List Bool) (hw : w ≠ []) (hsep : ∀ i, i ≠ a → (¬ code.encode i <+: w) ∧ (¬ w <+: code.encode i)) : expectedCodeLength p (code.replaceWord a w hw hsep) = expectedCodeLength p code + p a * (w.length - (code.encode a).length : ℝ)
theorem
BanditRLProof.LowerBounds.expectedCodeLength_pruneDeepest
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.expectedCodeLength_pruneDeepestReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem expectedCodeLength_pruneDeepest {α : Type*} [Fintype α] [DecidableEq α] (p : α → ℝ) (code : BinaryPrefixCode α) (a : α) (w : List Bool) (b : Bool) (hw : w ≠ []) (ha : code.encode a = w ++ [b]) (hmax : ∀ i, (code.encode i).length ≤ (code.encode a).length) (hmissing : ∀ i, code.encode i ≠ w ++ [!b]) : expectedCodeLength p (code.pruneDeepest a w b hw ha hmax hmissing) = expectedCodeLength p code - p a
theorem
BanditRLProof.LowerBounds.expectedCodeLength_pruneDeepest_le
Compiled
Pruning remains cost-nonincreasing when the removed symbol has zero mass.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.expectedCodeLength_pruneDeepest_leReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem expectedCodeLength_pruneDeepest_le {α : Type*} [Fintype α] [DecidableEq α] (p : α → ℝ) (code : BinaryPrefixCode α) (a : α) (w : List Bool) (b : Bool) (hp : 0 ≤ p a) (hw : w ≠ []) (ha : code.encode a = w ++ [b]) (hmax : ∀ i, (code.encode i).length ≤ (code.encode a).length) (hmissing : ∀ i, code.encode i ≠ w ++ [!b]) : expectedCodeLength p (code.pruneDeepest a w b hw ha hmax hmissing) ≤ expectedCodeLength p code
def
BanditRLProof.LowerBounds.totalCodeLength
Compiled
Structural termination measure, independent of source probabilities.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.totalCodeLengthReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def totalCodeLength {α : Type*} [Fintype α] (code : BinaryPrefixCode α) : ℕ
theorem
BanditRLProof.LowerBounds.totalCodeLength_pruneDeepest
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.totalCodeLength_pruneDeepestReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem totalCodeLength_pruneDeepest {α : Type*} [Fintype α] [DecidableEq α] (code : BinaryPrefixCode α) (a : α) (w : List Bool) (b : Bool) (hw : w ≠ []) (ha : code.encode a = w ++ [b]) (hmax : ∀ i, (code.encode i).length ≤ (code.encode a).length) (hmissing : ∀ i, code.encode i ≠ w ++ [!b]) : totalCodeLength (code.pruneDeepest a w b hw ha hmax hmissing) + 1 = totalCodeLength code
theorem
BanditRLProof.LowerBounds.exists_minimal_totalCodeLength_competitor
Compiled
Choose a structurally minimal no-worse competitor without assuming cost-minimizer existence.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.exists_minimal_totalCodeLength_competitorReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem exists_minimal_totalCodeLength_competitor {α : Type*} [Fintype α] (p : α → ℝ) (original : BinaryPrefixCode α) : ∃ code : BinaryPrefixCode α, expectedCodeLength p code ≤ expectedCodeLength p original ∧ ∀ other : BinaryPrefixCode α, expectedCodeLength p other ≤ expectedCodeLength p original → totalCodeLength code ≤ totalCodeLength other
theorem
BanditRLProof.LowerBounds.exists_competitor_with_deepest_siblings
Compiled
Normalize any competitor so that each deepest leaf has its sibling present.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.exists_competitor_with_deepest_siblingsReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem exists_competitor_with_deepest_siblings {α : Type*} [Fintype α] [DecidableEq α] [Nontrivial α] (p : α → ℝ) (hp : ∀ i, 0 ≤ p i) (original : BinaryPrefixCode α) : ∃ code : BinaryPrefixCode α, expectedCodeLength p code ≤ expectedCodeLength p original ∧ ∀ a w b, code.encode a = w ++ [b] → (∀ i, (code.encode i).length ≤ (code.encode a).length) → ∃ j, code.encode j = w ++ [!b]
theorem
BanditRLProof.LowerBounds.exists_no_worse_deepest_sibling_pair
Compiled
Every competitor has a no-worse code containing a deepest sibling pair.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.exists_no_worse_deepest_sibling_pairReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem exists_no_worse_deepest_sibling_pair {α : Type*} [Fintype α] [DecidableEq α] [Nontrivial α] (p : α → ℝ) (hp : ∀ i, 0 ≤ p i) (original : BinaryPrefixCode α) : ∃ code : BinaryPrefixCode α, expectedCodeLength p code ≤ expectedCodeLength p original ∧ ∃ a j w b, a ≠ j ∧ code.encode a = w ++ [b] ∧ code.encode j = w ++ [!b] ∧ ∀ i, (code.encode i).length ≤ (code.encode a).length