Repository navigation
feat: the transductive best-answer task and the closure of its alternatives - #364
Conversation
…atives Co-Authored-By: Claude Code <noreply@github.com>
There was a problem hiding this comment.
🟡 reuse — request_changes claude/claude-opus-5-5
The earlier copies of the baiTask API are gone: transductiveTask is now an abbrev of the generalised baiTask, and the closure and altCost results are new. isOpen_answerSet_transductiveTask still repeats the proof of isOpen_answerSet_baiTask, and one general lemma for a continuous mean would cover both.
LMLExplore/Identification/Task/Transductive.lean:81—isOpen_answerSet_transductiveTaskcopies the proof ofisOpen_answerSet_baiTask(BestArm/Basic.lean:238-245): the samemem_answerSet_baiTask_iff/simprewrite into⋂ j ∈ {i}ᶜ, {mean · j < mean · i}, thenisOpen_biInterandisOpen_lt, with different continuity terms. This PR already widensbaiTasktomean : Θ → ι → ℝ, so one lemma can serve both. Fix: GeneraliseisOpen_answerSet_baiTaskto[TopologicalSpace Θ] [Finite ι] (hmean : ∀ b, Continuous fun θ ↦ mean θ b) (a : ι) : IsOpen ((baiTask ν mean).answerSet a), proved withisOpen_lt (hmean b) (hmean a). Get theidcase fromcontinuous_applyand updateisOpen_answerSet_baiTask_restrict. Get the transductive case asisOpen_answerSet_baiTask ν (fun j ↦ continuous_const.inner continuous_id) i, or delete the transductive copy.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5-5 · 23s · 88.1k in (54.6k cache read, 33.5k cache write) / 2.4k out tokens · reviewing this diff · rubric ·
There was a problem hiding this comment.
🟡 generality — request_changes claude/claude-opus-5-5
The earlier duplication is fixed: baiTask now takes an answer type ι and transductiveTask is an abbrev for it. One special-case proof remains: isOpen_answerSet_transductiveTask repeats the proof of isOpen_answerSet_baiTask, and both should come from one openness lemma for a continuous mean functional.
LMLExplore/Identification/Task/Transductive.lean:82—isOpen_answerSet_transductiveTaskrepeats the proof ofisOpen_answerSet_baiTask(BestArm/Basic.lean:238-245), changing only the continuity witness fromcontinuous_applytocontinuous_const.inner continuous_id. Both are special cases of one statement about a continuous mean functional. Fix: In theMeanFunctionalsection of BestArm/Basic.lean, addlemma isOpen_answerSet_baiTask_of_continuous [TopologicalSpace Θ] [Finite ι] (hmean : ∀ a, Continuous fun θ ↦ mean θ a) (a : ι) : IsOpen ((baiTask ν mean).answerSet a). DeriveisOpen_answerSet_baiTaskfrom it withcontinuous_apply, and derive the transductive lemma from it withfun j ↦ continuous_const.inner continuous_id, or drop the transductive lemma.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5-5 · 19s · 77.6k in (51.6k cache read, 25.9k cache write) / 1.9k out tokens · reviewing this diff · rubric ·
AI review — changes requestedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
Generalize `baiTask` and its answer-agnostic lemmas (`M_`, `ν_`, `correct_`, `comap_`, `subsingleton_correct_`, `correct_baiTask_eq_singleton_iff`, `isSingleAnswer_`, `mem_alt_`, `mem_answerSet_`, `charTime_..._eq_inv_answerValue`) from the arm type to any answer type `ι`, make `transductiveTask` an abbreviation of `baiTask` for the values `⟪z i, θ⟫`, and delete its copied API. Prove the slope step of the closure argument with Mathlib's `eq_of_norm_le_re_inner_eq_norm_sq` and split it into a private lemma. Co-Authored-By: Claude Code <noreply@github.com>
Add isOpen_answerSet_baiTask_of_continuous, derive isOpen_answerSet_baiTask from it, and drop isOpen_answerSet_transductiveTask, which is now its instance for the continuous maps θ ↦ ⟪z i, θ⟫. Co-Authored-By: Claude Code <noreply@github.com>
There was a problem hiding this comment.
🟡 documentation — request_changes claude/claude-opus-5-5
The new transductive file and its public declarations are documented accurately. The generalised baiTask docstring still gives the old type mean : Θ → α → ℝ, which no longer matches its signature.
LMLExplore/Identification/Task/Classical.lean:113— ThebaiTaskdocstring opens with "the mean functionalmean : Θ → α → ℝ", but the variable is nowmean : Θ → ι → ℝ(line 111). The docstring was not updated when the definition was generalised, so it contradicts the signature. Fix: Rewrite the first sentence withmean : Θ → ι → ℝand answersι, and say that classical best arm identification is the caseι = α. Merge this with the 'More generally' paragraph instead of keeping both.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5-5 · 22s · 45.7k in (39.2k cache read, 6.5k cache write) / 2k out tokens · reviewing this diff · rubric ·
AI review — approvedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
Co-Authored-By: Claude Code <noreply@github.com>
9bf2855
This PR defines the transductive best-answer task of linear identification,
transductiveTask ν z, and proves the closure of its alternatives as a finite union of half-spaces. This is the Identification roadmap's Layer 9.1 (Linear tasks): "For a finite set𝒵of answers inE, define the transductive best-answer taskargmax_{z∈𝒵}⟨z,θ⟩[FJJR19]; best arm identification is the case𝒵=φ(α)."Generalised
baiTask(Identification/Task/Classical.lean):baiTask ν meannow takesmean : Θ → ι → ℝwith an arbitrary answer typeι(previouslyι = α). Its API (correct_baiTask,subsingleton_correct_baiTask,correct_baiTask_eq_singleton_iff,isSingleAnswer_baiTask) and theMeanFunctionalmaterial ofIdentification/Task/BestArm/Basic.lean(mem_alt_baiTask_iff,mem_answerSet_baiTask_iff,charTime_baiTask_eq_inv_answerValue, …) hold at this generality unchanged. Every existing use is the caseι = αand needs no change.Openness (
Identification/Task/BestArm/Basic.lean): newisOpen_answerSet_baiTask_of_continuous: for finitely many answers and a mean functional continuous in the model, the answer sets ofbaiTask ν meanare open.isOpen_answerSet_baiTask(the casemean = id) is now derived from it.New file
LMLExplore/Identification/Task/Transductive.lean, inLMLExplore.Identification:transductiveTask ν z : IdentTask α E ι 𝓨is theabbrevbaiTask ν (fun θ i ↦ ⟪z i, θ⟫): modelsθin a real inner product spaceE, answers a familyz : ι → E(a finite set𝒵 ⊆ Eis the case(↑) : 𝒵 → E), correct answer theiwith the largest⟪z i, θ⟫, admissible models those with a unique best answer. Its single-answer property, alternatives, answer sets (open byisOpen_answerSet_baiTask_of_continuous) and characteristic timeT*(θ) = D(θ, ¬i)⁻¹are those ofbaiTask. Linear best arm identification istransductiveTask ν φ = baiTask ν (fun θ a ↦ ⟪φ a, θ⟫), the roadmap's "best arm identification is the case𝒵 = φ(α)"; as Layer 9.1 asks, the linear tasks get no separate definitions.closure_alt_transductiveTask: for finitely many distinct answers,closure (alt i) = ⋃ j : {j // j ≠ i}, {λ | ⟪z i - z j, λ⟫ ≤ 0}, andmem_closure_alt_transductiveTaskproves the hard inclusion. Starting from a point where somej ≠ iscores at least as much asi, take, among the best answers other thani, the one farthest fromz i, and move along the direction fromz ito it. This gives a unique best answer other thani. The injectivity hypothesis is needed: withz i = z jfor somej ≠ i, the answeriis never correct, and the right-hand side is all ofEwhile the alternatives need not be dense.altCost_transductiveTask_eq_iInf: for a transportation cost continuous on these half-spaces,D(θ, w, ¬i) = min_{j ≠ i} inf {cost_θ(w, λ) | ⟪z i - z j, λ⟫ ≤ 0}. This follows fromIdentTask.altCost_eq_biInf_of_subset_closure.Consumer: Layer 9.2 (Characteristic time) states
T*(θ)⁻¹ = max_w min_{z ≠ z*} ⟨θ, z* - z⟩² / (2 ‖z* - z‖²_{V_w⁻¹})"as the case of the half-spaces{λ : ⟨z* - z, λ⟩ ≤ 0}of Layer 3.6".closure_alt_transductiveTaskhas exactly the shape of the two closure hypotheses (h_alt,h_closure, withy j = z i - z jandc j = 0) ofIdentTask.altCost_gaussianReal_innerandIdentTask.answerValue_gaussianReal_innerin the open PR #362, which is independent of this one. WithcharTime_baiTask_eq_inv_answerValue, these two give 9.2. Nothing here depends on #362.Layer 9.1 is complete after this PR. Layer 9 still needs 9.2 (once #362 lands), the RAGE elimination algorithm of 9.3 (which also needs the phased-elimination constructor of Layer 0.5) and the GLRT and asymptotic optimality results of 9.4.
Mathematical source: T. Fiez, L. Jain, K. Jamieson and L. Ratliff, Sequential experimental design for transductive linear bandits, NeurIPS 2019, Section 2 and Theorem 1, cited in the file. The API and the closure statement follow the existing
baiTaskmaterial inIdentification/Task/Classical.leanandIdentification/Task/BestArm/Basic.lean. No Mathlib material is vendored. Nothing is renamed or removed.Roadmap: Identification
🤖 Generated with Claude Code