OAI/Probability/FKMaps/SimpleWalk.lean
102 declarations, 0 contain sorry, 0 declared as axioms
- def
OAI.FKCRT.SimpleWalk.kernelline 11Source documentation
Exact probabilities for the symmetric nearest-neighbour walk on the integers.
def kernel : ℕ → ℤ → ℝ | 0,z => if z=0 then 1 else 0 | n+1,z => (kernel n (z-1)+kernel n (z+1))/2
- lemma
OAI.FKCRT.SimpleWalk.kernel_zeroline 15 - lemma
OAI.FKCRT.SimpleWalk.kernel_succline 16 - lemma
OAI.FKCRT.SimpleWalk.kernel_symmline 17 - lemma
OAI.FKCRT.SimpleWalk.kernel_nonnegline 23 - lemma
OAI.FKCRT.SimpleWalk.kernel_supportline 27 - def
OAI.FKCRT.SimpleWalk.killedline 42Source documentation
The walk killed on first visiting -1, with both endpoints nonnegative.
def killed : ℕ → ℕ → ℕ → ℝ | 0,a,b => if a=b then 1 else 0 | n+1,0,b => killed n 1 b/2 | n+1,a+1,b => (killed n a b+killed n (a+2) b)/2
- lemma
OAI.FKCRT.SimpleWalk.killed_nonnegline 47 - theorem
OAI.FKCRT.SimpleWalk.killed_reflectionline 56Source documentation
Discrete reflection principle; this is an identity of the actual killed transition recursion, not an assumed excursion law.
theorem killed_reflection (n a b : ℕ) : killed n a b = kernel n ((b:ℤ)-a)-kernel n ((b:ℤ)+a+2) := by …Mentions: OAI.FKCRT.SimpleWalk.killed, OAI.FKCRT.SimpleWalk.kernel
- lemma
OAI.FKCRT.SimpleWalk.killed_symmline 81 - def
OAI.FKCRT.SimpleWalk.chooseIntline 86Source documentation
Binomial coefficients extended by zero to negative lower arguments.
def chooseInt (n : ℕ) (k : ℤ) : ℝ := if 0≤k then (n.choose k.toNat:ℝ) else 0
- lemma
OAI.FKCRT.SimpleWalk.chooseInt_zeroline 88 - lemma
OAI.FKCRT.SimpleWalk.chooseInt_pascalline 98 - lemma
OAI.FKCRT.SimpleWalk.kernel_binomialline 112 - lemma
OAI.FKCRT.SimpleWalk.chooseInt_adjacentline 138 - lemma
OAI.FKCRT.SimpleWalk.kernel_adjacentline 152 - theorem
OAI.FKCRT.SimpleWalk.killed_entranceline 173Source documentation
Exact entrance density, including the zero-time and unreachable cases.
theorem killed_entrance (n b : ℕ) : killed n 0 b = (2*((b:ℝ)+1)/((n:ℝ)+b+2))*kernel n b := by …Mentions: OAI.FKCRT.SimpleWalk.killed, OAI.FKCRT.SimpleWalk.kernel
- def
OAI.FKCRT.SimpleWalk.signline 192 - abbrev
OAI.FKCRT.SimpleWalk.Pathline 194 - def
OAI.FKCRT.SimpleWalk.pathSumline 196 - lemma
OAI.FKCRT.SimpleWalk.pathSum_zeroline 199 - lemma
OAI.FKCRT.SimpleWalk.pathSum_consline 201 - def
OAI.FKCRT.SimpleWalk.splitPathline 205 - lemma
OAI.FKCRT.SimpleWalk.sum_path_succline 211 - def
OAI.FKCRT.SimpleWalk.pathMassline 217Source documentation
Uniform nearest-neighbour path counting probability.
def pathMass (n : ℕ) (P : Path n → Prop) : ℝ := …
Mentions: OAI.FKCRT.SimpleWalk.Path
- lemma
OAI.FKCRT.SimpleWalk.pathMass_congrline 220 - lemma
OAI.FKCRT.SimpleWalk.pathMass_succline 223 - lemma
OAI.FKCRT.SimpleWalk.pathMass_endpointline 230 - def
OAI.FKCRT.SimpleWalk.nonnegativePathline 244 - lemma
OAI.FKCRT.SimpleWalk.nonnegativePath_consline 247 - lemma
OAI.FKCRT.SimpleWalk.pathMass_killedline 262 - theorem
OAI.FKCRT.SimpleWalk.pathMass_reflectionline 304Source documentation
Reflection counts actual nonnegative paths, including all parity cases.
theorem pathMass_reflection (n a b : ℕ) : pathMass n (fun d => nonnegativePath a d ∧ (a:ℤ)+pathSum d n=b)= kernel n ((b:ℤ)-a)-kernel n ((b:ℤ)+a+2) := by …Mentions: OAI.FKCRT.SimpleWalk.pathMass, OAI.FKCRT.SimpleWalk.nonnegativePath, OAI.FKCRT.SimpleWalk.pathSum, OAI.FKCRT.SimpleWalk.kernel
- def
OAI.FKCRT.TreeCoding.binaryMassline 318 - lemma
OAI.FKCRT.TreeCoding.binaryMass_nonnegline 320 - lemma
OAI.FKCRT.TreeCoding.binaryMass_totalline 322 - lemma
OAI.FKCRT.TreeCoding.binaryMass_momentline 326 - def
OAI.FKCRT.TreeCoding.binaryOffspringline 339 - lemma
OAI.FKCRT.TreeCoding.binaryOffspring_varianceline 352 - lemma
OAI.FKCRT.TreeCoding.binaryOffspring_sigmaline 363 - def
OAI.FKCRT.TreeCoding.binaryDegreeline 367Source documentation
Binary paths really sample critical, variance-one even offspring.
def binaryDegree (s : Bool) : ℕ := if s then 2 else 0
- instance
OAI.FKCRT.TreeCoding.(instance at line 369)line 369 - instance
OAI.FKCRT.TreeCoding.(instance at line 370)line 370 - def
OAI.FKCRT.TreeCoding.coinLawline 372 - lemma
OAI.FKCRT.TreeCoding.coinLaw_singletonline 374 - instance
OAI.FKCRT.TreeCoding.(instance at line 377)line 377 - lemma
OAI.FKCRT.TreeCoding.binaryDegree_preservingline 382 - lemma
OAI.FKCRT.TreeCoding.binaryStepline 402 - def
OAI.FKCRT.TreeCoding.binaryArrayline 405 - lemma
OAI.FKCRT.TreeCoding.binaryArray_preservingline 407 - lemma
OAI.FKCRT.TreeCoding.binaryArray_totalStepline 415 - lemma
OAI.FKCRT.TreeCoding.coinPath_singletonline 419 - lemma
OAI.FKCRT.TreeCoding.coinPath_eventline 426 - lemma
OAI.FKCRT.TreeCoding.binary_kernelline 439Source documentation
The recursive symmetric kernel is the exact endpoint law used by the already-proved finite-variance conditioned bridge invariance principle.
lemma binary_kernel (N : ℕ) (z : ℤ) : (binaryOffspring.iidLaw N).real {d | totalStep d=z}=SimpleWalk.kernel N z := by …Mentions: OAI.FKCRT.TreeCoding.totalStep, OAI.FKCRT.SimpleWalk.kernel
- def
OAI.FKCRT.TreeCoding.arrayWalkline 457 - def
OAI.FKCRT.TreeCoding.ArrayGoodline 460 - lemma
OAI.FKCRT.TreeCoding.arrayWalk_codeEmbeddingline 463 - lemma
OAI.FKCRT.TreeCoding.arrayGood_rangeline 466 - lemma
OAI.FKCRT.TreeCoding.CriticalEvenOffspring.iid_good_integralline 482Source documentation
The actual good-array restriction is the weighted finite code sum.
lemma CriticalEvenOffspring.iid_good_integral (p : CriticalEvenOffspring) (N : ℕ) (F : (Fin N → ℕ) → ℝ) : (∫ d,if ArrayGood d then F d else 0 ∂p.iidLaw N)= ∑ d : Code N,codeWeight p d*F (codeEmbedding N d) := by …Mentions: OAI.FKCRT.TreeCoding.CriticalEvenOffspring, OAI.FKCRT.TreeCoding.ArrayGood, OAI.FKCRT.TreeCoding.Code, OAI.FKCRT.TreeCoding.codeWeight, OAI.FKCRT.TreeCoding.codeEmbedding
- theorem
OAI.FKCRT.TreeCoding.CriticalEvenOffspring.code_iid_integralline 521Source documentation
No informal conditioning is used: finite code expectations are exactly normalized restriction of the iid offspring law to the good event.
theorem CriticalEvenOffspring.code_iid_integral (p : CriticalEvenOffspring) (n : ℕ) (F : (Fin (2*n+1) → ℕ) → ℝ) : (∫ c,F (codeEmbedding (2*n+1) c) ∂p.codeLaw n)= (∫ d,if ArrayGood d then F d else 0 ∂p.iidLaw (2*n+1))/codePartition p (2*n+1) := by …Mentions: OAI.FKCRT.TreeCoding.CriticalEvenOffspring, OAI.FKCRT.TreeCoding.codeEmbedding, OAI.FKCRT.TreeCoding.ArrayGood, OAI.FKCRT.TreeCoding.codePartition
- lemma
OAI.FKCRT.TreeCoding.arrayWalk_binaryArrayline 530 - def
OAI.FKCRT.TreeCoding.SimpleExcursionline 534 - lemma
OAI.FKCRT.TreeCoding.binaryArray_goodline 537 - lemma
OAI.FKCRT.TreeCoding.binary_partitionline 540 - theorem
OAI.FKCRT.TreeCoding.binary_code_integralline 548Source documentation
Exact simple-excursion representation of the binary conditioned tree law.
theorem binary_code_integral (n : ℕ) (F : (Fin (2*n+1) → ℕ) → ℝ) : (∫ c,F (codeEmbedding (2*n+1) c) ∂binaryOffspring.codeLaw n)= ((2*n+1:ℕ):ℝ)/SimpleWalk.kernel (2*n+1) (-1) * ∫ d,if SimpleExcursion d then F (binaryArray d) else 0 ∂Measure.pi (fun _ : Fin (2*n+1) => coinLaw) := by …Mentions: OAI.FKCRT.TreeCoding.codeEmbedding, OAI.FKCRT.SimpleWalk.kernel, OAI.FKCRT.TreeCoding.SimpleExcursion, OAI.FKCRT.TreeCoding.binaryArray, OAI.FKCRT.TreeCoding.coinLaw
- def
OAI.FKCRT.SimpleWalk.splitPathAtline 570 - lemma
OAI.FKCRT.SimpleWalk.pathSum_append_leftline 576 - lemma
OAI.FKCRT.SimpleWalk.pathSum_append_rightline 587 - lemma
OAI.FKCRT.SimpleWalk.nonnegativePath_appendline 597 - lemma
OAI.FKCRT.SimpleWalk.pathMass_appendline 617 - theorem
OAI.FKCRT.SimpleWalk.pathMass_killed_middleline 632Source documentation
Exact fixed-middle-point Markov factorization of killed path counts.
theorem pathMass_killed_middle (n m a b c : ℕ) : pathMass (n+m) (fun d => nonnegativePath a d ∧ (a:ℤ)+pathSum d n=b ∧ (a:ℤ)+pathSum d (n+m)=c)= killed n a b*killed m b c := by …Mentions: OAI.FKCRT.SimpleWalk.pathMass, OAI.FKCRT.SimpleWalk.nonnegativePath, OAI.FKCRT.SimpleWalk.pathSum, OAI.FKCRT.SimpleWalk.killed
- def
OAI.FKCRT.SimpleWalk.firstHitline 660Source documentation
Probability of a first visit to -1, starting at a nonnegative integer.
def firstHit {n : ℕ} (a : ℕ) (d : Path n) : Prop := …Mentions: OAI.FKCRT.SimpleWalk.Path
- lemma
OAI.FKCRT.SimpleWalk.firstHit_lastline 663 - lemma
OAI.FKCRT.SimpleWalk.pathMass_firstHitline 689 - theorem
OAI.FKCRT.SimpleWalk.firstHit_formulaline 711Source documentation
Ballot/first-hitting formula, without parity or reachability restrictions.
theorem firstHit_formula (n a : ℕ) : pathMass (n+1) (firstHit a)=((a:ℝ)+1)/((n:ℝ)+1)*kernel (n+1) ((a:ℤ)+1) := by …Mentions: OAI.FKCRT.SimpleWalk.pathMass, OAI.FKCRT.SimpleWalk.firstHit, OAI.FKCRT.SimpleWalk.kernel
- lemma
OAI.FKCRT.SimpleWalk.pathMass_trueline 731 - lemma
OAI.FKCRT.SimpleWalk.pathMass_endpoint_fromline 734 - lemma
OAI.FKCRT.SimpleWalk.firstHit_append_middleline 741Source documentation
Cutting a first-hitting path at a specified nonnegative intermediate level.
lemma firstHit_append_middle {n m : ℕ} (a b : ℕ) (d : Path n) (e : Path m) : (firstHit a (Fin.append d e) ∧ (a:ℤ)+pathSum d n=b)↔ (nonnegativePath a d ∧ (a:ℤ)+pathSum d n=b) ∧ firstHit b e := by …Mentions: OAI.FKCRT.SimpleWalk.Path, OAI.FKCRT.SimpleWalk.firstHit, OAI.FKCRT.SimpleWalk.pathSum, OAI.FKCRT.SimpleWalk.nonnegativePath
- def
OAI.FKCRT.SimpleWalk.traceSizeline 770 - def
OAI.FKCRT.SimpleWalk.tracePointsline 775Source documentation
Successive specified heights, with free terminal suffix.
def tracePoints (a R : ℕ) : (xs : List (ℕ×ℕ)) → Path (traceSize R xs) → Prop | [],_ => True | x::xs,d => (a:ℤ)+pathSum (splitPathAt x.1 (traceSize R xs) d).1 x.1=x.2 ∧ tracePoints x.2 R xs (splitPathAt x.1 (traceSize R xs) d).2 /-- The same specified heights, together with nonnegative segments and final first hit. -/Mentions: OAI.FKCRT.SimpleWalk.Path, OAI.FKCRT.SimpleWalk.traceSize, OAI.FKCRT.SimpleWalk.pathSum, OAI.FKCRT.SimpleWalk.splitPathAt, OAI.FKCRT.SimpleWalk.segments
- def
OAI.FKCRT.SimpleWalk.traceExcursionline 781Source documentation
The same specified heights, together with nonnegative segments and final first hit.
def traceExcursion (a R : ℕ) : (xs : List (ℕ×ℕ)) → Path (traceSize R xs) → Prop | [],d => firstHit a d | x::xs,d => (nonnegativePath a (splitPathAt x.1 (traceSize R xs) d).1 ∧ (a:ℤ)+pathSum (splitPathAt x.1 (traceSize R xs) d).1 x.1=x.2) ∧ traceExcursion x.2 R xs (splitPathAt x.1 (traceSize R xs) d).2Mentions: OAI.FKCRT.SimpleWalk.Path, OAI.FKCRT.SimpleWalk.traceSize, OAI.FKCRT.SimpleWalk.firstHit, OAI.FKCRT.SimpleWalk.nonnegativePath, OAI.FKCRT.SimpleWalk.splitPathAt, OAI.FKCRT.SimpleWalk.pathSum
- def
OAI.FKCRT.SimpleWalk.traceFreeWeightline 788 - def
OAI.FKCRT.SimpleWalk.traceKilledWeightline 792 - lemma
OAI.FKCRT.SimpleWalk.traceExcursion_iffline 796 - theorem
OAI.FKCRT.SimpleWalk.pathMass_tracePointsline 810Source documentation
Actual unrestricted finite-dimensional probabilities factor into free kernels.
theorem pathMass_tracePoints (a R : ℕ) (xs : List (ℕ×ℕ)) : pathMass (traceSize R xs) (tracePoints a R xs)=traceFreeWeight a xs := by …Mentions: OAI.FKCRT.SimpleWalk.pathMass, OAI.FKCRT.SimpleWalk.traceSize, OAI.FKCRT.SimpleWalk.tracePoints, OAI.FKCRT.SimpleWalk.traceFreeWeight
- theorem
OAI.FKCRT.SimpleWalk.pathMass_traceExcursionline 824Source documentation
Actual nonnegative first-hitting finite-dimensional probabilities have the reflected-kernel product, with the exact terminal first-hitting factor.
theorem pathMass_traceExcursion (a R : ℕ) (xs : List (ℕ×ℕ)) : pathMass (traceSize R xs) (traceExcursion a R xs)=traceKilledWeight a R xs := by …Mentions: OAI.FKCRT.SimpleWalk.pathMass, OAI.FKCRT.SimpleWalk.traceSize, OAI.FKCRT.SimpleWalk.traceExcursion, OAI.FKCRT.SimpleWalk.traceKilledWeight
- lemma
OAI.FKCRT.SimpleWalk.killed_le_kernelline 838 - lemma
OAI.FKCRT.SimpleWalk.traceKilledWeight_nonnegline 842 - lemma
OAI.FKCRT.SimpleWalk.traceFreeWeight_nonnegline 848 - lemma
OAI.FKCRT.SimpleWalk.traceKilledWeight_eq_zeroline 853 - def
OAI.FKCRT.SimpleWalk.uniformLawline 877Source comment
The inherited product-law realization, not a fresh informal conditioning.def uniformLaw (N : ℕ) : Measure (Path N) := Measure.pi (fun _ => coinLaw)
Mentions: OAI.FKCRT.SimpleWalk.Path
- instance
OAI.FKCRT.SimpleWalk.uniformLaw_probabilityline 879 - lemma
OAI.FKCRT.SimpleWalk.uniformLaw_singletonline 882 - lemma
OAI.FKCRT.SimpleWalk.uniformLaw_realline 887 - lemma
OAI.FKCRT.SimpleWalk.firstHit_zero_iffline 899 - lemma
OAI.FKCRT.SimpleWalk.firstHit_mass_posline 902 - def
OAI.FKCRT.SimpleWalk.excursionLawline 913Source documentation
Uniform binary walks conditioned on their first hit of -1 at the odd endpoint.
def excursionLaw (n : ℕ) : Measure (Path (2*n+1)) := …
Mentions: OAI.FKCRT.SimpleWalk.Path
- instance
OAI.FKCRT.SimpleWalk.excursionLaw_probabilityline 916 - lemma
OAI.FKCRT.SimpleWalk.excursionLaw_realline 924 - lemma
OAI.FKCRT.SimpleWalk.excursionLaw_aeline 934 - lemma
OAI.FKCRT.SimpleWalk.excursionLaw_integralline 937 - lemma
OAI.FKCRT.SimpleWalk.binary_code_integralline 944 - lemma
OAI.FKCRT.SimpleWalk.pathSum_parityline 962