Lean module · Foundations
BanditRLProof.LowerBounds.PrefixCodeExchange
Generated source map for this Lean module.
Module map
Imports
BanditRLProof.LowerBounds.PrefixCodeConstruction
Imported by
BanditRLProof, BanditRLProof.LowerBounds.PrefixCodeSiblings, BanditRLProof.LowerBounds.UniformCoding
Declarations
Open an item to read its exact compact statement and source link. Detailed teaching notes are linked when registered.
def
BanditRLProof.LowerBounds.BinaryPrefixCode.relabel
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.BinaryPrefixCode.relabelReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def BinaryPrefixCode.relabel {α β : Type*} (code : BinaryPrefixCode α) (e : β ≃ α) : BinaryPrefixCode β where
def
BanditRLProof.LowerBounds.IsOptimalPrefixCode
Compiled
Full optimality against every code, not merely against a chosen candidate family.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.IsOptimalPrefixCodeReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def IsOptimalPrefixCode {α : Type*} [Fintype α] (p : α → ℝ) (code : BinaryPrefixCode α) : Prop
theorem
BanditRLProof.LowerBounds.expectedCodeLength_swap
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_swapReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem expectedCodeLength_swap {α : Type*} [Fintype α] [DecidableEq α] (p : α → ℝ) (code : BinaryPrefixCode α) (a b : α) (hab : a ≠ b) : expectedCodeLength p (code.relabel (Equiv.swap a b)) = expectedCodeLength p code + (p a - p b) * ((code.encode b).length - (code.encode a).length : ℝ)
theorem
BanditRLProof.LowerBounds.expectedCodeLength_swap_le
Compiled
Assigning a shorter word to a higher-probability symbol cannot increase cost.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.expectedCodeLength_swap_leReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem expectedCodeLength_swap_le {α : Type*} [Fintype α] [DecidableEq α] (p : α → ℝ) (code : BinaryPrefixCode α) (a b : α) (hab : a ≠ b) (hp : p a ≤ p b) (hl : (code.encode a).length ≤ (code.encode b).length) : expectedCodeLength p (code.relabel (Equiv.swap a b)) ≤ expectedCodeLength p code
theorem
BanditRLProof.LowerBounds.IsOptimalPrefixCode.length_antitone
Compiled
An optimal code orders lengths opposite to strictly ordered probabilities.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret · Chapter 14: Foundations of Information Theory
Canonical node identity
declaration:BanditRLProof.LowerBounds.IsOptimalPrefixCode.length_antitoneReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem IsOptimalPrefixCode.length_antitone {α : Type*} [Fintype α] [DecidableEq α] {p : α → ℝ} {code : BinaryPrefixCode α} (hopt : IsOptimalPrefixCode p code) (a b : α) (hp : p a < p b) : (code.encode b).length ≤ (code.encode a).length
theorem
BanditRLProof.LowerBounds.IsOptimalPrefixCode.entropy_sandwich
Compiled
Any global minimizer inherits the entropy sandwich; this does not assert existence.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.IsOptimalPrefixCode.entropy_sandwichReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem IsOptimalPrefixCode.entropy_sandwich {α : Type*} [Fintype α] [DecidableEq α] {p : α → ℝ} {code : BinaryPrefixCode α} (hopt : IsOptimalPrefixCode p code) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) : discreteEntropyBaseTwo Finset.univ p ≤ expectedCodeLength p code ∧ expectedCodeLength p code ≤ discreteEntropyBaseTwo Finset.univ p + 1
theorem
BanditRLProof.LowerBounds.one_le_expectedCodeLength
Compiled
The local nonempty-codeword convention forces at least one expected bit.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.one_le_expectedCodeLengthReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem one_le_expectedCodeLength {α : Type*} [Fintype α] (p : α → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) (code : BinaryPrefixCode α) : 1 ≤ expectedCodeLength p code
def
BanditRLProof.LowerBounds.singletonPrefixCode
Compiled
The singleton alphabet's nonempty one-bit code.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.singletonPrefixCodeReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def singletonPrefixCode (α : Type*) [Subsingleton α] : BinaryPrefixCode α where
theorem
BanditRLProof.LowerBounds.singletonPrefixCode_optimal
Compiled
The singleton base case has a genuine global optimum under the local convention.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.LowerBounds.singletonPrefixCode_optimalReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem singletonPrefixCode_optimal {α : Type*} [Fintype α] [Subsingleton α] (p : α → ℝ) (hp : ∀ i, 0 ≤ p i) (hs : ∑ i, p i = 1) : IsOptimalPrefixCode p (singletonPrefixCode α)