OAI/Combinatorics/KServer/Partitions.lean
223 declarations, 0 contain sorry, 0 declared as axioms
The actual true-prefix heavy-center recursion of §07. All physical and filtering steps are included in its potential budget, not only edit steps.
- lemma
OAI.KServer.Pilot.filtered_potentialline 18Source documentation
Exact filtering for a profile chosen from the old observation history. The old compact minimizer is a single admissible competitor on each old fiber.
lemma filtered_potential (w : Ω → ℝ) (hw : ∀ ω, 0 ≤ w ω) (H H' : Ω → ℕ) (hr : ∀ ω ν, H' ω = H' ν → H ω = H ν) (T : Template) (r : ℝ) (f g : Ω → Y → ℝ) (hg : ∀ y, Adapted H (fun ω => g ω y)) : avg w (fun ω => potential T r (fun y => posterior w H' (fun ν => f ν y) ω) (g ω)) ≤ avg w (fun ω => potential T r (fun y => posterior w H (fun ν => f ν y) ω) (g ω)) := by …Mentions: OAI.KServer.Pilot.Template, OAI.KServer.Pilot.potential
- lemma
OAI.KServer.FiniteExperiment.requestHistory_refinesline 70 - lemma
OAI.KServer.FiniteExperiment.pilot_filteringline 82Source documentation
The precise signed filtering contribution of the actual hidden optimum.
lemma pilot_filtering (s : Configuration k Y) (law : FiniteDistribution (Fin H → Y)) (T : Pilot.Template) (r : ℝ) (t : Fin H) (g : (Fin H → Y) → Y → ℝ) (hg : ∀ y, Adapted (requestHistory t.val) (fun σ => g σ y)) : avg law.val (fun σ => potential T r (muBefore s law t σ) (g σ)) ≤ avg law.val (fun σ => potential T r (mu s law t.val σ) (g σ)) := …Mentions: OAI.KServer.Configuration, OAI.KServer.FiniteDistribution, OAI.KServer.Pilot.Template, OAI.KServer.FiniteExperiment.requestHistory, OAI.KServer.FiniteExperiment.muBefore, OAI.KServer.FiniteExperiment.mu
- lemma
OAI.KServer.FiniteExperiment.pilot_physicalline 92Source documentation
Each realized physical update obeys the literal compact-pilot drift bound.
lemma pilot_physical (s : Configuration k Y) (law : FiniteDistribution (Fin H → Y)) (T : Pilot.Template) {γ δ r₀ τ : ℝ} (t : Fin H) (σ : Fin H → Y) (g : ℕ → Y → ℝ) (n p : ℕ) (hσ : 0 < law.val σ) (hr : 0 < r₀) (hτ : 2 ≤ τ) (hγ0 : 0 < γ) (hγ : γ ≤ min (T.σ/64) (1/(1+T.L))) (hδ0 : 0 < δ) (hδ : δ ≤ 1/4112) (hpow : 100*T.R ≤ γ*(2:ℝ)^p) (hg : ∀ j<n, ∀ y, g j y ∈ Set.Icc 0 1) (hgLip : ∀ j<n, ∀ y z, |g j y-g j z| ≤ T.L*(dist y z/radius r₀ τ j)) : ∑ j ∈ range n, max (potential T (radius r₀ τ j) (mu s law (t.val+1) σ) (g j)- potential T (radius r₀ τ j) (muBefore s law t σ) (g j)) 0 ≤ driftConstant T γ δ p*(1+Real.log ((k:ℝ)+1)) * ∑ y, nu s law t σ y * dist y (σ t) := by …Mentions: OAI.KServer.Configuration, OAI.KServer.FiniteDistribution, OAI.KServer.Pilot.Template, OAI.KServer.FiniteExperiment.mu, OAI.KServer.FiniteExperiment.muBefore, OAI.KServer.FiniteExperiment.nu
- theorem
OAI.KServer.FiniteExperiment.pilot_physical_budgetline 122Source documentation
The actual expected physical pilot increments are paid entirely by OPT.
theorem pilot_physical_budget (s : Configuration k Y) (law : FiniteDistribution (Fin H → Y)) (T : Pilot.Template) {γ δ r₀ τ : ℝ} (g : Fin H → (Fin H → Y) → ℕ → Y → ℝ) (n p : ℕ) (hr : 0 < r₀) (hτ : 2 ≤ τ) (hγ0 : 0 < γ) (hγ : γ ≤ min (T.σ/64) (1/(1+T.L))) (hδ0 : 0 < δ) (hδ : δ ≤ 1/4112) (hpow : 100*T.R ≤ γ*(2:ℝ)^p) (hg : ∀ t σ j, j<n → ∀ y, g t σ j y ∈ Set.Icc 0 1) (hgLip : ∀ t σ j, j<n → ∀ y z, |g t σ j y-g t σ j z| ≤ T.L*(dist y z/radius r₀ τ j)) : (∑ t : Fin H, avg law.val (fun σ => ∑ j ∈ range n, max (potential T (radius r₀ τ j) (mu s law (t.val+1) σ) (g t σ j)- potential T (radius r₀ τ j) (muBefore s law t σ) (g t σ j)) 0)) ≤ …Mentions: OAI.KServer.Configuration, OAI.KServer.FiniteDistribution, OAI.KServer.Pilot.Template, OAI.KServer.FiniteExperiment.mu, OAI.KServer.FiniteExperiment.muBefore
- theorem
OAI.KServer.FiniteExperiment.pilot_edit_budgetline 157Source documentation
All-step signed filtering plus physical drift, before any decision to edit. The edit charge is the literal difference of two achieved pilot minima.
theorem pilot_edit_budget (s : Configuration k Y) (law : FiniteDistribution (Fin H → Y)) (T : Pilot.Template) {γ δ r₀ τ : ℝ} (g : ℕ → (Fin H → Y) → ℕ → Y → ℝ) (n p : ℕ) (hr : 0 < r₀) (hτ : 2 ≤ τ) (hγ0 : 0 < γ) (hγ : γ ≤ min (T.σ/64) (1/(1+T.L))) (hδ0 : 0 < δ) (hδ : δ ≤ 1/4112) (hpow : 100*T.R ≤ γ*(2:ℝ)^p) (hg : ∀ t σ j, j<n → ∀ y, g t σ j y ∈ Set.Icc 0 1) (hgLip : ∀ t σ j, j<n → ∀ y z, |g t σ j y-g t σ j z| ≤ T.L*(dist y z/radius r₀ τ j)) (hga : ∀ t j, j<n → ∀ y, Adapted (requestHistory t) (fun σ => g t σ j y)) : (∑ t : Fin H, avg law.val (fun σ => ∑ j ∈ range n, …Mentions: OAI.KServer.Configuration, OAI.KServer.FiniteDistribution, OAI.KServer.Pilot.Template, OAI.KServer.FiniteExperiment.requestHistory
- def
OAI.KServer.HeavyCenters.templateline 242 - def
OAI.KServer.HeavyCenters.annulusline 252Source documentation
The exact annulus charged at a heavy update.
def annulus (x : Y) (r : ℝ) : Finset Y := …
- lemma
OAI.KServer.HeavyCenters.annulus_bump_oneline 255 - lemma
OAI.KServer.HeavyCenters.profile_weight_nonnegline 272 - lemma
OAI.KServer.HeavyCenters.profile_residual_boundline 283 - lemma
OAI.KServer.HeavyCenters.edit_integrand_dropline 301Source documentation
Pointwise objective decrease from the literal center replacement.
lemma edit_integrand_drop {r : ℝ} (hr : 0<r) (C : Finset Y) (x : Y) {z : Y → ℝ} (hz : Feasible template r z) (hfar : ∀ a∈C,8*r<dist a x) (hmiddle : ∀ i,r/4 ≤ dist i x → dist i x ≤ 256*r → z i=0) (hnear : ∃ s,dist s x<r/4 ∧ (1/2:ℝ) ≤ z s) (p : Y) : 127*(if p∈annulus x r then (1:ℝ) else 0) ≤ integrand template r (profile r C) z p- integrand template r (profile r (replace r C x)) z p := by …Mentions: OAI.KServer.HeavyCenters.template, OAI.KServer.HeavyCenters.annulus, OAI.KServer.HeavyCenters.profile, OAI.KServer.HeavyCenters.replace
- theorem
OAI.KServer.HeavyCenters.pilot_edit_dropline 352Source documentation
The genuine heavy edit decrease, from compact minimizer local structure; no pilot decrease is posed as a hypothesis.
theorem pilot_edit_drop {r γ δ : ℝ} (hr : 0<r) (C : Finset Y) (x : Y) {μ : Y → ℝ} (hμ : ∀ y,0≤μ y) (hγ0 : 0≤γ) (hγ : γ≤1/64) (hδ : δ≤1/4112) (hM : 0<Pilot.mass μ (Pilot.ball x (γ*r))) (hheavy : Pilot.mass μ (Pilot.ball x (51200*r)) ≤ (1+δ)*Pilot.mass μ (Pilot.ball x (γ*r))) (hfar : ∀ a∈C,8*r<dist a x) : 127*r*Pilot.mass μ (annulus x r) ≤ potential template r μ (profile r C)-potential template r μ (profile r (replace r C x)) := by …Mentions: OAI.KServer.Pilot.mass, OAI.KServer.Pilot.ball, OAI.KServer.HeavyCenters.annulus, OAI.KServer.HeavyCenters.template, OAI.KServer.HeavyCenters.profile, OAI.KServer.HeavyCenters.replace
- def
OAI.KServer.HeavyCenters.Activeline 422 - def
OAI.KServer.HeavyCenters.stepline 426 - lemma
OAI.KServer.HeavyCenters.step_separatedline 429 - def
OAI.KServer.HeavyCenters.centersline 447Source documentation
Initially empty. End-of-input states are frozen; requests before then use the genuine posterior at the new true prefix.
def centers (s : Configuration k Y) (law : FiniteDistribution (Fin H → Y)) (r γ δ : ℝ) (σ : Fin H → Y) : ℕ → Finset Y | 0 => ∅ | t+1 => if ht : t<H then step r γ δ (centers s law r γ δ σ t) (mu s law (t+1) σ) (σ ⟨t,ht⟩) else centers s law r γ δ σ tMentions: OAI.KServer.Configuration, OAI.KServer.FiniteDistribution, OAI.KServer.HeavyCenters.step
- lemma
OAI.KServer.HeavyCenters.centers_zeroline 454 - lemma
OAI.KServer.HeavyCenters.centers_succline 456 - lemma
OAI.KServer.HeavyCenters.centers_separatedline 462 - lemma
OAI.KServer.HeavyCenters.centers_adaptedline 473 - lemma
OAI.KServer.HeavyCenters.inner_mass_posline 489 - def
OAI.KServer.HeavyCenters.chargeline 501Source documentation
Exact annular charge made by a real center edit, zero on non-edit steps.
def charge (s : Configuration k Y) (law : FiniteDistribution (Fin H → Y)) (r γ δ : ℝ) (t : Fin H) (σ : Fin H → Y) : ℝ := …Mentions: OAI.KServer.Configuration, OAI.KServer.FiniteDistribution
- lemma
OAI.KServer.HeavyCenters.charge_nonnegline 506 - lemma
OAI.KServer.HeavyCenters.charge_le_dropline 514 - theorem
OAI.KServer.HeavyCenters.annulus_budgetline 531Source documentation
The source's all-step heavy-annulus budget for the actual adaptive construction, with a finite endpoint bound independent of law and horizon.
theorem annulus_budget (s : Configuration k Y) (law : FiniteDistribution (Fin H → Y)) {γ δ r₀ τ : ℝ} (n p : ℕ) (hr : 0<r₀) (hτ : 2≤τ) (hγ0 : 0<γ) (hγ : γ≤1/64) (hδ0 : 0<δ) (hδ : δ≤1/4112) (hpow : 51200≤γ*(2:ℝ)^p) : (∑ t : Fin H,avg law.val (fun σ => ∑ j∈range n, charge s law (radius r₀ τ j) γ δ t σ)) ≤ driftConstant template γ δ p*(1+Real.log ((k:ℝ)+1))* ∑ σ,law.val σ*optimalCost s (List.ofFn σ)+ ∑ j∈range n,2*radius r₀ τ j*(k:ℝ) := by …Mentions: OAI.KServer.Configuration, OAI.KServer.FiniteDistribution, OAI.KServer.HeavyCenters.charge, OAI.KServer.HeavyCenters.template
- lemma
OAI.KServer.OnlineLabels.unused_existsline 576 - def
OAI.KServer.OnlineLabels.stageline 587Source documentation
A finite coloring chosen at each insertion using only earlier colors.
def stage (hM : 0<M) (conflict : ℕ → Finset ℕ) (hcard : ∀ t, (conflict t).card<M) : ℕ → ℕ → Fin M | 0 => fun _ => ⟨0,hM⟩ | t+1 => fun j => if j=t then (unused_exists (conflict t) (stage hM conflict hcard t) (hcard t)).choose else stage hM conflict hcard t jMentions: OAI.KServer.OnlineLabels.unused_exists
- lemma
OAI.KServer.OnlineLabels.stage_step_oldline 594 - lemma
OAI.KServer.OnlineLabels.stage_stableline 599 - def
OAI.KServer.OnlineLabels.colorline 610Source documentation
Permanent color of a chronological record; later stages never modify it.
def color (hM : 0<M) (conflict : ℕ → Finset ℕ) (hcard : ∀ t, (conflict t).card<M) (i : ℕ) : Fin M := … - lemma
OAI.KServer.OnlineLabels.color_avoidsline 614 - theorem
OAI.KServer.OnlineLabels.color_injective_online 625Source documentation
If each simultaneous or cooldown pair was included when the later record was inserted, the fixed pool colors it injectively. This local premise is on record geometry, not an assumed random algorithm or cost estimate.
theorem color_injective_on (hM : 0<M) (conflict : ℕ → Finset ℕ) (hcard : ∀ t, (conflict t).card<M) (hbefore : ∀ t, ∀ j ∈ conflict t, j<t) (S : Set ℕ) (hpairs : ∀ i ∈ S, ∀ j ∈ S, j < i → j ∈ conflict i) : Set.InjOn (color hM conflict hcard) S := by …Mentions: OAI.KServer.OnlineLabels.color
- lemma
OAI.KServer.OnlineLabels.cooldown_cardline 638Source documentation
The source's 4M+4 pool has strictly more slots than the two reserved sets and two new records excluded by a one-step cooldown.
lemma cooldown_card (A B fresh : Finset ℕ) {N : ℕ} (hA : A.card ≤ N) (hB : B.card ≤ N) (hf : fresh.card ≤ 2) : (A∪B∪fresh).card < 4*N+4 := by … - abbrev
OAI.KServer.HeavyLabels.Poolline 661 - def
OAI.KServer.HeavyLabels.overlapline 662 - lemma
OAI.KServer.HeavyLabels.overlap_distanceline 665 - lemma
OAI.KServer.HeavyLabels.overlap_uniqueline 673 - lemma
OAI.KServer.HeavyLabels.unusedline 686 - def
OAI.KServer.HeavyLabels.freshline 697 - lemma
OAI.KServer.HeavyLabels.fresh_avoidsline 699 - def
OAI.KServer.HeavyLabels.insertedLabelline 703 - def
OAI.KServer.HeavyLabels.updatedLabelline 706 - lemma
OAI.KServer.HeavyLabels.inserted_reusesline 709 - lemma
OAI.KServer.HeavyLabels.existing_matchline 717 - lemma
OAI.KServer.HeavyLabels.inserted_diff_keptline 726 - lemma
OAI.KServer.HeavyLabels.update_injectiveline 735Source documentation
An actual update preserves injective active heavy labels.
lemma update_injective {C D : Finset Y} {rad : Y → ℝ} {label prev : Y → Pool Y} {x : Y} {r R : ℝ} (hr : 0<r) (hrad : ∀ a∈C,rad a≤20*r) (hR : R≤20*r) (hl : Set.InjOn label (C:Set Y)) : Set.InjOn (updatedLabel C D rad label prev x R) (replace r C x:Set Y) := by …Mentions: OAI.KServer.HeavyLabels.Pool, OAI.KServer.HeavyLabels.updatedLabel
- lemma
OAI.KServer.HeavyLabels.common_anchorline 763Source documentation
Every common coordinate label keeps its anchor, except for a genuine intersecting-ball reuse; in that case it moves at most40r.
lemma common_anchor {C D : Finset Y} {rad : Y → ℝ} {label prev : Y → Pool Y} {x a b : Y} {r R : ℝ} (hrad : ∀ a∈C,rad a≤20*r) (hR : R≤20*r) (hl : Set.InjOn label (C:Set Y)) (ha : a∈C) (hb : b∈replace r C x) (he : label a=updatedLabel C D rad label prev x R b) : a=b ∨ dist a b≤40*r := by …Mentions: OAI.KServer.HeavyLabels.Pool, OAI.KServer.HeavyLabels.updatedLabel
- def
OAI.KServer.PartitionProbabilities.positionline 790Source documentation
Normalized clipped position in the source radius interval
[r,2*r].def position (r a : ℝ) : ℝ := min (max (a/r-1) 0) 1
- lemma
OAI.KServer.PartitionProbabilities.position_rangeline 792 - lemma
OAI.KServer.PartitionProbabilities.position_monoline 796 - lemma
OAI.KServer.PartitionProbabilities.position_differenceline 800 - def
OAI.KServer.PartitionProbabilities.tailline 822Source documentation
The exact tail of the density in eq. tier-radius-density. The clipped formula includes both support endpoints (which have zero atom).
def tail (lam r a : ℝ) : ℝ := …
- lemma
OAI.KServer.PartitionProbabilities.tail_rangeline 825 - lemma
OAI.KServer.PartitionProbabilities.tail_antitoneline 834 - lemma
OAI.KServer.PartitionProbabilities.position_of_leline 841 - lemma
OAI.KServer.PartitionProbabilities.position_of_geline 845 - lemma
OAI.KServer.PartitionProbabilities.tail_of_leline 849 - lemma
OAI.KServer.PartitionProbabilities.tail_of_geline 853 - lemma
OAI.KServer.PartitionProbabilities.exp_difference_leline 857Source documentation
Elementary exponential secant bound, including arbitrary negative inputs.
lemma exp_difference_le (u v : ℝ) : Real.exp u-Real.exp v ≤ (u-v)*Real.exp u := by …
- theorem
OAI.KServer.PartitionProbabilities.tail_interval_boundline 867Source documentation
The source first-hit tail inequality, valid even if the interval crosses one or both endpoints of the radius support.
theorem tail_interval_bound {lam r a b : ℝ} (hlam : 0 < lam) (hr : 0 < r) (hab : a ≤ b) : tail lam r a-tail lam r b ≤ (lam*(b-a)/r)*(tail lam r a+1/(Real.exp lam-1)) := by …Mentions: OAI.KServer.PartitionProbabilities.tail
- def
OAI.KServer.PartitionProbabilities.prefixMissline 887Source documentation
Prefix miss probabilities for independent records in chronological order.
def prefixMiss (p : ℕ → ℝ) (n : ℕ) : ℝ := ∏ i ∈ range n, (1-p i)
- lemma
OAI.KServer.PartitionProbabilities.prefixMiss_zeroline 889 - lemma
OAI.KServer.PartitionProbabilities.prefixMiss_succline 890 - lemma
OAI.KServer.PartitionProbabilities.prefixMiss_rangeline 893 - theorem
OAI.KServer.PartitionProbabilities.first_hit_sumline 903Source documentation
Exact first-hit partition of the probability of at least one hit.
theorem first_hit_sum (p : ℕ → ℝ) (n : ℕ) : (∑ i ∈ range n, prefixMiss p i*p i)=1-prefixMiss p n := by … - theorem
OAI.KServer.PartitionProbabilities.first_hit_boundline 911Source documentation
First-hit separation bound after conditioning on presences. It sums the individual tail coefficients, rather than paying for all K² hits separately.
theorem first_hit_bound {p s : ℕ → ℝ} {c ε : ℝ} (n : ℕ) (hp : ∀ i, p i ∈ Set.Icc (0:ℝ) 1) (hc : 0 ≤ c) (hε : 0 ≤ ε) (hs : ∀ i < n, s i ≤ c*(p i+ε)) : (∑ i ∈ range n, prefixMiss p i*s i) ≤ c*(1+ε*n) := by … - def
OAI.KServer.PartitionProbabilities.productWeightline 939Source documentation
Literal independent product tape; independence is proved by multiplication, not postulated as an assumption about adaptive states.
def productWeight (w : ∀ i, Ω i → ℝ) (o : ∀ i, Ω i) : ℝ := ∏ i, w i (o i)
- def
OAI.KServer.PartitionProbabilities.probabilityline 941 - lemma
OAI.KServer.PartitionProbabilities.productWeight_nonnegline 946 - lemma
OAI.KServer.PartitionProbabilities.productWeight_sumline 949 - lemma
OAI.KServer.PartitionProbabilities.product_expectationline 955 - lemma
OAI.KServer.PartitionProbabilities.rectangle_probabilityline 961 - lemma
OAI.KServer.PartitionProbabilities.probability_rangeline 974 - lemma
OAI.KServer.PartitionProbabilities.complement_probabilityline 991 - def
OAI.KServer.PartitionProbabilities.firstSeparationline 1007Source documentation
Exactly the source separating-first-hit event in chronological order.
def firstSeparation (hit sep : ∀ i, Ω i → Prop) (o : ∀ i, Ω i) : Prop := …
- def
OAI.KServer.PartitionProbabilities.firstAtline 1010 - lemma
OAI.KServer.PartitionProbabilities.firstAt_uniqueline 1014 - lemma
OAI.KServer.PartitionProbabilities.firstSeparation_probabilityline 1021 - lemma
OAI.KServer.PartitionProbabilities.firstAt_probabilityline 1045Source documentation
Evaluation of one first-hit rectangle under the constructed product tape.
lemma firstAt_probability {hit sep : ∀ i, Ω i → Prop} (w : ∀ i, Ω i → ℝ) (hw : ∀ i, ∑ a, w i a=1) (i : Fin n) : probability w (firstAt hit sep i)= (∑ a, if sep i a then w i a else 0) * ∏ j ∈ univ.filter (fun j : Fin n => j < i), (1 - ∑ a, if hit j a then w j a else 0) := by …Mentions: OAI.KServer.PartitionProbabilities.probability, OAI.KServer.PartitionProbabilities.firstAt
- theorem
OAI.KServer.PartitionProbabilities.independent_first_hit_boundline 1084Source documentation
The chronological first-hit estimate under the literal finite product law. No independence is asserted for an adaptive filtration: this theorem applies only after its deterministic schedule and surviving indices have been fixed.
theorem independent_first_hit_bound {hit sep : ∀ i, Ω i → Prop} (w : ∀ i, Ω i → ℝ) (hw : ∀ i a, 0 ≤ w i a) (hw1 : ∀ i, ∑ a, w i a=1) (hsep : ∀ i a, sep i a → hit i a) {c ε : ℝ} (hc : 0 ≤ c) (hε : 0 ≤ ε) (hm : ∀ i, (∑ a, if sep i a then w i a else 0) ≤ c*((∑ a, if hit i a then w i a else 0)+ε)) : probability w (firstSeparation hit sep) ≤ c*(1+ε*n) := by …Mentions: OAI.KServer.PartitionProbabilities.probability, OAI.KServer.PartitionProbabilities.firstSeparation
- def
OAI.KServer.FiniteSurvival.weightline 1140Source documentation
A finite lifetime
dis alive at ages0,...,d.def weight (s : ℕ → ℝ) {N : ℕ} (d : Fin N) : ℝ := s d-s (d+1) - def
OAI.KServer.FiniteSurvival.probabilityline 1142 - lemma
OAI.KServer.FiniteSurvival.weight_nonnegline 1146 - lemma
OAI.KServer.FiniteSurvival.weight_sumline 1149 - lemma
OAI.KServer.FiniteSurvival.probability_livingline 1153 - theorem
OAI.KServer.FiniteSurvival.inverse_tailline 1180Source documentation
An actual finite probability law realizes every prescribed decreasing survival tail exactly; this is the finite inverse-tail construction, not an independence or randomness assumption.
theorem inverse_tail {s : ℕ → ℝ} {N : ℕ} (hs : Antitone s) (hs0 : s 0=1) (hsN : s N=0) : (∀ d : Fin N, 0 ≤ weight s d) ∧ (∑ d : Fin N, weight s d=1) ∧ ∀ a ≤ N, probability s (fun d : Fin N => a ≤ (d:ℕ))=s a := by …Mentions: OAI.KServer.FiniteSurvival.weight, OAI.KServer.FiniteSurvival.probability
- lemma
OAI.KServer.FiniteSurvival.probability_crossingline 1190Source documentation
The exact probability of a single-bin threshold crossing.
lemma probability_crossing (s : ℕ → ℝ) (N a b : ℕ) (hab : a ≤ b) (hb : b ≤ N) : probability s (fun d : Fin N => a ≤ (d:ℕ) ∧ (d:ℕ)<b)=s a-s b := by …Mentions: OAI.KServer.FiniteSurvival.probability
- def
OAI.KServer.FiniteRadius.gridline 1219 - lemma
OAI.KServer.FiniteRadius.grid_posline 1221 - def
OAI.KServer.FiniteRadius.pointline 1224 - lemma
OAI.KServer.FiniteRadius.point_monoline 1227 - lemma
OAI.KServer.FiniteRadius.point_rangeline 1230 - lemma
OAI.KServer.FiniteRadius.point_zeroline 1240 - def
OAI.KServer.FiniteRadius.survivalline 1247 - lemma
OAI.KServer.FiniteRadius.survival_finline 1250 - lemma
OAI.KServer.FiniteRadius.survival_zeroline 1253 - lemma
OAI.KServer.FiniteRadius.survival_lastline 1258 - lemma
OAI.KServer.FiniteRadius.survival_nonnegline 1261 - lemma
OAI.KServer.FiniteRadius.survival_antitoneline 1267 - def
OAI.KServer.FiniteRadius.weightsline 1278Source documentation
Weights of the actual finite radius outcome.
def weights (D : Finset ℝ) (lam r : ℝ) (i : Fin (grid D r).card) : ℝ := …
Mentions: OAI.KServer.FiniteRadius.grid
- lemma
OAI.KServer.FiniteRadius.weights_nonnegline 1281 - lemma
OAI.KServer.FiniteRadius.weights_sumline 1285 - lemma
OAI.KServer.FiniteRadius.grid_tailline 1291 - def
OAI.KServer.FiniteUniform.tailline 1323 - lemma
OAI.KServer.FiniteUniform.tail_nonnegline 1325 - lemma
OAI.KServer.FiniteUniform.tail_le_oneline 1326 - lemma
OAI.KServer.FiniteUniform.tail_of_leline 1327 - lemma
OAI.KServer.FiniteUniform.tail_of_geline 1330 - lemma
OAI.KServer.FiniteUniform.tail_antitoneline 1333 - lemma
OAI.KServer.FiniteUniform.tail_lipschitzline 1336 - def
OAI.KServer.FiniteUniform.survivalline 1345 - lemma
OAI.KServer.FiniteUniform.survival_finline 1347 - lemma
OAI.KServer.FiniteUniform.survival_zeroline 1349 - lemma
OAI.KServer.FiniteUniform.survival_lastline 1352 - lemma
OAI.KServer.FiniteUniform.survival_nonnegline 1353 - lemma
OAI.KServer.FiniteUniform.survival_antitoneline 1357 - def
OAI.KServer.FiniteUniform.weightsline 1366 - lemma
OAI.KServer.FiniteUniform.weights_nonnegline 1367 - lemma
OAI.KServer.FiniteUniform.weights_sumline 1369 - lemma
OAI.KServer.FiniteUniform.grid_tailline 1373 - lemma
OAI.KServer.FiniteUniform.query_tailline 1389 - def
OAI.KServer.FiniteUniform.thresholdsline 1406 - lemma
OAI.KServer.FiniteUniform.dist_thresholdline 1407 - abbrev
OAI.KServer.FiniteUniform.Outcomeline 1409 - def
OAI.KServer.FiniteUniform.radiusline 1410 - def
OAI.KServer.FiniteUniform.lawline 1411 - lemma
OAI.KServer.FiniteUniform.radius_rangeline 1412 - lemma
OAI.KServer.FiniteUniform.law_nonnegline 1415 - lemma
OAI.KServer.FiniteUniform.law_sumline 1416 - lemma
OAI.KServer.FiniteUniform.ball_probabilityline 1417 - def
OAI.KServer.FiniteUniform.separatesline 1426 - lemma
OAI.KServer.FiniteUniform.separates_commline 1429 - lemma
OAI.KServer.FiniteUniform.separation_orderedline 1431 - theorem
OAI.KServer.FiniteUniform.one_ball_boundline 1443 - structure
OAI.KServer.HeavySchedule.Dataline 1476 - def
OAI.KServer.HeavySchedule.initialline 1481 - def
OAI.KServer.HeavySchedule.runline 1484 - lemma
OAI.KServer.HeavySchedule.run_validline 1500 - def
OAI.KServer.HeavySchedule.birthline 1531 - lemma
OAI.KServer.HeavySchedule.radius_birthline 1540 - lemma
OAI.KServer.HeavySchedule.present_birthline 1558 - lemma
OAI.KServer.FiniteBallLaw.query_tailline 1598 - def
OAI.KServer.FiniteBallLaw.thresholdsline 1617 - lemma
OAI.KServer.FiniteBallLaw.dist_thresholdline 1619 - abbrev
OAI.KServer.FiniteBallLaw.Outcomeline 1622 - def
OAI.KServer.FiniteBallLaw.radiusline 1625 - def
OAI.KServer.FiniteBallLaw.lawline 1627 - lemma
OAI.KServer.FiniteBallLaw.law_nonnegline 1629 - lemma
OAI.KServer.FiniteBallLaw.law_sumline 1632 - lemma
OAI.KServer.FiniteBallLaw.radius_rangeline 1635 - lemma
OAI.KServer.FiniteBallLaw.ball_probabilityline 1638 - def
OAI.KServer.FiniteBallLaw.hitline 1642 - def
OAI.KServer.FiniteBallLaw.separatesline 1645 - lemma
OAI.KServer.FiniteBallLaw.separation_hitline 1649 - lemma
OAI.KServer.FiniteBallLaw.hit_minline 1654 - lemma
OAI.KServer.FiniteBallLaw.separation_intervalline 1658 - lemma
OAI.KServer.FiniteBallLaw.min_thresholdline 1675 - lemma
OAI.KServer.FiniteBallLaw.max_thresholdline 1680 - lemma
OAI.KServer.FiniteBallLaw.hit_probabilityline 1685 - lemma
OAI.KServer.FiniteBallLaw.separation_probabilityline 1691 - lemma
OAI.KServer.FiniteBallLaw.width_distanceline 1707 - lemma
OAI.KServer.FiniteBallLaw.one_ball_boundline 1711 - theorem
OAI.KServer.FiniteBallLaw.chronological_boundline 1724Source documentation
The finite radius tape realizes the exact source truncated-exponential first-hit bound for any fixed chronological list of present candidates.
theorem chronological_bound {n : ℕ} {lam r : ℝ} (hlam : 0 < lam) (hr : 0 < r) (centers : Fin n → Y) (x y : Y) : probability (fun _ : Fin n => law (Y:=Y) lam r) …Mentions: OAI.KServer.FiniteBallLaw.law
- lemma
OAI.KServer.FiniteBallLaw.lambda_posline 1737 - theorem
OAI.KServer.FiniteBallLaw.bounded_rosterline 1744Source documentation
With at most K² potentially hitting records the chronological estimate is 2λd/r, independent of the total number of previous insertions.
theorem bounded_roster {n K : ℕ} (hK : 1 ≤ K) (hn : n ≤ K^2) {r : ℝ} (hr : 0 < r) (centers : Fin n → Y) (x y : Y) : probability (fun _ : Fin n => law (Y:=Y) (Real.log (1+(K:ℝ)^2)) r) …Mentions: OAI.KServer.FiniteBallLaw.law
- def
OAI.KServer.Chronological.ageline 1778Source documentation
Number of later insertions in the fixed-radius neighbourhood of an entry.
def age (center : ℕ → Y) (I : Finset ℕ) (R : ℝ) (i : ℕ) : ℕ := by …
- def
OAI.KServer.Chronological.youngline 1783Source documentation
Chronological, not surviving, entries below an age cutoff.
def young (center : ℕ → Y) (I : Finset ℕ) (R : ℝ) (A : ℕ) : Finset ℕ := by …
- lemma
OAI.KServer.Chronological.mem_youngline 1787 - lemma
OAI.KServer.Chronological.age_monoline 1792 - lemma
OAI.KServer.Chronological.age_insertline 1801Source documentation
Adding the next insertion increments precisely neighbouring old entries.
lemma age_insert (center : ℕ → Y) (I : Finset ℕ) (R : ℝ) {i t : ℕ} (ht : t ∉ I) (hit : i < t) : age center (insert t I) R i = age center I R i + if dist (center i) (center t) ≤ R then 1 else 0 := by …Mentions: OAI.KServer.Chronological.age
- lemma
OAI.KServer.Chronological.age_newline 1814 - theorem
OAI.KServer.Chronological.local_age_countline 1828Source documentation
Actual age-count lemma. No independence or surviving-record assumption is used, and repeated centers are allowed.
theorem local_age_count (center : ℕ → Y) (I S : Finset ℕ) (R : ℝ) (A : ℕ) (hSI : S ⊆ I) (hyoung : ∀ i ∈ S, age center I R i < A) (hdiam : ∀ i ∈ S, ∀ j ∈ S, dist (center i) (center j) ≤ R) : S.card ≤ A := by …Mentions: OAI.KServer.Chronological.age
- def
OAI.KServer.Chronological.insertTestline 1852Source documentation
The exact test in the manuscript. Its input is a qualifying request, not a condition involving lifetimes, radii, allocation, or rounding.
def insertTest (center : ℕ → Y) (I : Finset ℕ) (r : ℝ) (K t : ℕ) (qualifies : Prop) : Prop := … - def
OAI.KServer.Chronological.scheduleline 1858Source documentation
Chronological insertion history after
trequests.qualifieswill be computed from the actual true-prefix posterior and the fixed tier parameter.def schedule (request : ℕ → Y) (r : ℝ) (K : ℕ) (qualifies : ℕ → Prop) : ℕ → Finset ℕ | 0 => ∅ | t+1 => by classical let I := schedule request r K qualifies t … - lemma
OAI.KServer.Chronological.schedule_beforeline 1865 - lemma
OAI.KServer.Chronological.qualified_coverageline 1879 - theorem
OAI.KServer.Chronological.reserved_countline 1907Source documentation
Reservation count for the complete chronological roster, by applying the local bound separately to each center in the finite metric.
theorem reserved_count [Fintype Y] (center : ℕ → Y) (I : Finset ℕ) {R : ℝ} (hR : 0 ≤ R) (A : ℕ) : (young center I R A).card ≤ Fintype.card Y * A := by …Mentions: OAI.KServer.Chronological.young
- theorem
OAI.KServer.SparseFirstHit.sparse_boundline 1942Source documentation
An error is paid only on indices that can hit a queried point. This permits a preallocated horizon-size tape without a horizon-size bound.
theorem sparse_bound {n : ℕ} {Ω : Fin n → Type*} [∀ i, Fintype (Ω i)] {hit sep : ∀ i, Ω i → Prop} (w : ∀ i, Ω i → ℝ) (hw : ∀ i a, 0 ≤ w i a) (hw1 : ∀ i, ∑ a, w i a=1) (hsep : ∀ i a, sep i a → hit i a) {c : ℝ} (ε : Fin n → ℝ) (hc : 0 ≤ c) (hε : ∀ i, 0 ≤ ε i) (hm : ∀ i, (∑ a, if sep i a then w i a else 0) ≤ c*((∑ a, if hit i a then w i a else 0)+ε i)) : probability w (firstSeparation hit sep) ≤ c*(1+∑ i, ε i) := by … - def
OAI.KServer.SparseFirstHit.candidatesline 1984 - lemma
OAI.KServer.SparseFirstHit.absent_hitline 1987 - theorem
OAI.KServer.SparseFirstHit.present_boundline 1994Source documentation
All previous insertion ordinals, with nonpresent records literally suppressed. Only potential hitters contribute the truncation error.
theorem present_bound {lam r : ℝ} (hlam : 0 < lam) (hr : 0 < r) (center : Fin H → Y) (present : Fin H → Prop) (x y : Y) : probability (fun _ : Fin H => law (Y:=Y) lam r) … - lemma
OAI.KServer.SparseFirstHit.close_centersline 2027 - lemma
OAI.KServer.SparseFirstHit.candidate_countline 2045 - theorem
OAI.KServer.SparseFirstHit.chronological_roster_boundline 2068Source documentation
Conditional on any actual presence pattern, the horizon-size radius tape has the stated K²-independent first-hit bound, by the literal age count.
theorem chronological_roster_bound {K : ℕ} (hK : 1 ≤ K) {r : ℝ} (hr : 0 < r) (center : ℕ → Y) (I : Finset ℕ) (present : Fin H → Prop) (hp : ∀ i, present i → (i:ℕ)∈I ∧ age center I (20*r) i<K^2) (x y : Y) (hxy : dist x y ≤ r) : probability (fun _ : Fin H => law (Y:=Y) (Real.log (1+(K:ℝ)^2)) r) … - def
OAI.KServer.RosterLifetimes.surviveline 2103Source documentation
Survival through
Nindependent retirement trials of rateq.def survive (q : ℝ) (N : ℕ) : ℝ := (1-q)^N
- lemma
OAI.KServer.RosterLifetimes.survive_rangeline 2105 - lemma
OAI.KServer.RosterLifetimes.survive_monoline 2110 - lemma
OAI.KServer.RosterLifetimes.survive_expline 2114 - lemma
OAI.KServer.RosterLifetimes.cubic_decayline 2120 - lemma
OAI.KServer.RosterLifetimes.actual_exponential_boundline 2129Source documentation
Explicit uniform version of K² exp(-(K-1))=O(1/K).
lemma actual_exponential_bound {x : ℝ} (hx : 2 ≤ x) : x^2*Real.exp (-(x-1)) ≤ 48/x := by … - lemma
OAI.KServer.RosterLifetimes.short_exponential_boundline 2142Source documentation
Explicit uniform auxiliary tail estimate. The denominator really is √K, not K; the two tapes are never identified.
lemma short_exponential_bound {x : ℝ} (hx : 2 ≤ x) : x*Real.exp (-((x-1)/Real.sqrt x)) ≤ 48/Real.sqrt x := by … - def
OAI.KServer.RosterLifetimes.actualPresenceline 2165Source documentation
Actual lifetime: ages 0,...,K-1 certain, trials K,...,K²-1, compulsory retirement at K².
def actualPresence (K a : ℕ) : ℝ := …
- def
OAI.KServer.RosterLifetimes.shortPresenceline 2170Source documentation
Auxiliary short lifetime: a trial on each positive age increment, compulsory retirement at K. It does not define the actual partition.
def shortPresence (K a : ℕ) : ℝ := …
- lemma
OAI.KServer.RosterLifetimes.actual_guaranteedline 2173 - lemma
OAI.KServer.RosterLifetimes.actual_cutoffline 2176 - lemma
OAI.KServer.RosterLifetimes.short_newline 2180 - lemma
OAI.KServer.RosterLifetimes.short_cutoffline 2183 - theorem
OAI.KServer.RosterLifetimes.actual_retirement_boundline 2189Source documentation
The source unconditional actual-first-coverer retirement estimate, including both stochastic and compulsory terms. The factor K² is the geometric roster count proved from chronological ages, not the total history.
theorem actual_retirement_bound (K : ℕ) (hK : 2 ≤ K) : 1/(K:ℝ)+(K:ℝ)^2*survive (1/(K:ℝ)) (K^2-K) ≤ 49/(K:ℝ) := by …Mentions: OAI.KServer.RosterLifetimes.survive
- theorem
OAI.KServer.RosterLifetimes.short_retirement_boundline 2205Source documentation
The auxiliary ramp can increase by at most this amount; its complete retirement calculation has a uniform 49/√K bound.
theorem short_retirement_bound (K : ℕ) (hK : 2 ≤ K) : 1/Real.sqrt K+(K:ℝ)*survive (1/Real.sqrt K) (K-1) ≤ 49/Real.sqrt K := by …Mentions: OAI.KServer.RosterLifetimes.survive
- lemma
OAI.KServer.ActualRoster.rate_rangeline 2235 - lemma
OAI.KServer.ActualRoster.survival_rangeline 2239 - lemma
OAI.KServer.ActualRoster.survival_antitoneline 2246 - abbrev
OAI.KServer.ActualRoster.Lifetimeline 2260 - def
OAI.KServer.ActualRoster.lifetimeLawline 2262 - lemma
OAI.KServer.ActualRoster.lifetime_nonnegline 2264 - lemma
OAI.KServer.ActualRoster.lifetime_sumline 2267 - def
OAI.KServer.ActualRoster.aliveline 2274Source documentation
Certain initial ages are included even on zero-weight tape outcomes; this makes deterministic coverage a pathwise property, not just an almost-sure one.
def alive (K a : ℕ) (d : Lifetime K) : Prop := a<K ∨ a≤(d:ℕ)
Mentions: OAI.KServer.ActualRoster.Lifetime
- lemma
OAI.KServer.ActualRoster.alive_youngline 2276 - lemma
OAI.KServer.ActualRoster.alive_certainline 2282 - lemma
OAI.KServer.ActualRoster.alive_probabilityline 2284 - lemma
OAI.KServer.ActualRoster.alive_antitoneline 2305 - lemma
OAI.KServer.ActualRoster.death_probabilityline 2310 - lemma
OAI.KServer.ActualRoster.ordinary_death_boundline 2323Source documentation
Before the compulsory age, the inverse-tail tape has exactly the source hazard 1/K once independent trials have begun.
lemma ordinary_death_bound {K a : ℕ} (hK : 1 ≤ K) (ha : a+1<K^2) : actualPresence K a-actualPresence K (a+1) ≤ (1/(K:ℝ))*actualPresence K a := by … - def
OAI.KServer.ActualRoster.presentline 2346 - lemma
OAI.KServer.ActualRoster.present_youngline 2349 - lemma
OAI.KServer.ActualRoster.young_presentline 2353 - def
OAI.KServer.ActualRoster.coveredline 2360 - def
OAI.KServer.ActualRoster.firstline 2364 - lemma
OAI.KServer.ActualRoster.first_some_iffline 2369 - lemma
OAI.KServer.ActualRoster.first_none_iffline 2396 - lemma
OAI.KServer.ActualRoster.qualified_coveredline 2403Source documentation
Deterministic source coverage on a qualifying insertion step, including zero-weight lifetime outcomes.
lemma qualified_covered (center : ℕ → Y) {r : ℝ} (hr : 0 < r) (hK : 0<K) (qualifies : ℕ → Prop) (t : ℕ) (ht : t<H) (hq : qualifies t) (life : Fin H → Lifetime K) (radii : Fin H → Outcome Y r) : ∃ i, covered center (schedule center r K qualifies (t+1)) r life radii (center t) i := by …Mentions: OAI.KServer.ActualRoster.Lifetime, OAI.KServer.ActualRoster.covered
- theorem
OAI.KServer.ActualRoster.first_hit_estimateline 2414Source documentation
Actual fixed-schedule first-hit probability under the complete finite radius tape, with the independently sampled lifetime tape fixed arbitrarily.
theorem first_hit_estimate (center : ℕ → Y) (I : Finset ℕ) {r : ℝ} (hr : 0 < r) (hK : 1 ≤ K) (life : Fin H → Lifetime K) (x y : Y) (hxy : dist x y ≤ r) : PartitionProbabilities.probability (fun _ : Fin H => law (Y:=Y) (Real.log (1+(K:ℝ)^2)) r) …Mentions: OAI.KServer.ActualRoster.Lifetime, OAI.KServer.PartitionProbabilities.probability