Wright–Fisher semigroup and moment duality
TheoremCauchy property of uniform contractions extends from a dense set#✓fully proved
Uniformly contractive operators that are Cauchy on a dense set are Cauchy everywhere.
theorem cauchySeq_apply_of_dense {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
{L : ℕ → E →L[ℝ] E} (hL : ∀ M, ‖L M‖ ≤ 1) {D : Set E}
(hD : Dense D) (h : ∀ d ∈ D, CauchySeq fun M => L M d) (f : E) :
CauchySeq fun M => L M f
Used by 1
TheoremLimits of uniform contractions extend from a dense set#✓fully proved
Limits of uniformly contractive operators extend from a dense set to the whole space.
theorem tendsto_apply_of_dense {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
{ι : Type*} {l : Filter ι} {T : ι → E →L[ℝ] E}
(hT : ∀ i, ‖T i‖ ≤ 1) {S : E →L[ℝ] E} (hS : ‖S‖ ≤ 1) {D : Set E}
(hD : Dense D) (h : ∀ d ∈ D, Tendsto (fun i => T i d) l (𝓝 (S d))) (f : E) :
Tendsto (fun i => T i f) l (𝓝 (S f))
Used by 1
TheoremWeierstrass approximation theorem on the unit interval#✓fully proved
Weierstrass approximation: polynomial functions are dense in C([0, 1], ℝ).
theorem dense_polynomialFunctions : Dense (polynomialFunctions I : Set C(I, ℝ))
Used by 3
TheoremNatural floor of a nonpositive multiple is zero#✓fully proved
If t ≤ 0, then the natural floor of t * M is zero.
theorem floor_mul_eq_zero {t : ℝ} (ht : t ≤ 0) (M : ℕ) : ⌊t * M⌋₊ = 0
TheoremPowers of a unital endomorphism fix the constant function#✓fully proved
Every power of a continuous linear endomorphism fixing 1 also fixes 1.
theorem pow_apply_one {R E : Type*} [Semiring R] [TopologicalSpace E] [AddCommMonoid E]
[Module R E] [One E] (T : E →L[R] E) (hT : T 1 = 1) (n : ℕ) :
(T ^ n) 1 = 1
Used by 1
TheoremPowers of a positive endomorphism are positive#✓fully proved
Every power of a positive continuous linear endomorphism is positive.
theorem pow_nonneg {R E : Type*} [Semiring R] [TopologicalSpace E] [AddCommMonoid E]
[Module R E] [PartialOrder E] (T : E →L[R] E)
(hT : ∀ {f : E}, 0 ≤ f → 0 ≤ T f) (n : ℕ) {f : E} (hf : 0 ≤ f) :
0 ≤ (T ^ n) f
Used by 1
DefinitionOne generation of the neutral Wright–Fisher chain#✓fully proved
One generation of the neutral Wright–Fisher chain with M gene copies, acting on continuous
functions of the allele frequency: (wfStep M f)(x) = ∑_k f(k/M) C(M, k) x^k (1 - x)^(M - k),
which for M ≥ 1 is the expected value of f at the next frequency Bin(M, x) / M (the M-th
Bernstein operator, Mathlib's bernsteinApproximation; the expectation is
ProbabilityTheory.integral_binomial). It is a linear
contraction. At M = 0 it returns the constant f 0 (Lean's k / 0 = 0; no population).
MathlibExt.Biology.PopulationGenetics.Diffusion.WrightFisherSemigroup.wfStep · 18 lines
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
calc ‖∑ k : Fin (M + 1), bernstein M k x • f (bernstein.z k)‖
≤ ∑ k : Fin (M + 1), ‖bernstein M k x • f (bernstein.z k)‖ := norm_sum_le _ _
_ ≤ ∑ k : Fin (M + 1), bernstein M k x * ‖f‖ := Finset.sum_le_sum fun k _ => by
rw [norm_smul, Real.norm_of_nonneg bernstein_nonneg]
exact mul_le_mul_of_nonneg_left (f.norm_coe_le_norm _) bernstein_nonneg
_ = ‖f‖ := by rw [← Finset.sum_mul, bernstein.probability, one_mul])
Used by 16
m generations · One Wright–Fisher generation acting on monomialsTheoremWright–Fisher step is the Bernstein operator#✓fully proved
wfStep M is the Bernstein approximation operator.
theorem wfStep_apply (M : ℕ) (f : C(I, ℝ)) : wfStep M f = bernsteinApproximation M f
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
Uses 1
TheoremOne Wright–Fisher generation is a sup-norm contraction#✓fully proved
One Wright–Fisher generation is a contraction for the sup norm.
theorem norm_wfStep_le (M : ℕ) : ‖wfStep M‖ ≤ 1
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
Uses 1 · Used by 1
TheoremOne Wright–Fisher generation fixes constants#✓fully proved
One Wright–Fisher generation fixes the constant function 1.
theorem wfStep_apply_one (M : ℕ) : wfStep M 1 = 1
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
Uses 1 · Used by 1
TheoremOne Wright–Fisher generation preserves nonnegativity#✓fully proved
One Wright–Fisher generation maps nonnegative functions to nonnegative functions.
theorem wfStep_nonneg (M : ℕ) {f : C(I, ℝ)} (hf : 0 ≤ f) : 0 ≤ wfStep M f
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
Uses 1 · Used by 1
TheoremIterated Wright–Fisher generations are sup-norm contractions#✓fully proved
Any number of Wright–Fisher generations is a contraction for the sup norm.
theorem norm_wfStep_pow_le (M m : ℕ) : ‖wfStep M ^ m‖ ≤ 1
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
Uses 2 · Used by 3
TheoremMoment duality, one generation (polynomial identity)#✓fully proved
For M ≥ 1 gene copies,
∑_i C(M, i) x^i (1 - x)^(M - i) (i/M)^n = ∑_k S(n, k) M_(k) / M^n · x^k: the n-th moment of
the frequency after one generation equals the generating function of the number of distinct
parents of n sampled genes. Holds for every real x.
theorem sum_binomial_mul_div_pow (M n : ℕ) (hM : M ≠ 0) (x : ℝ) :
∑ i ∈ Finset.range (M + 1),
(M.choose i : ℝ) * x ^ i * (1 - x) ^ (M - i) * ((i : ℝ) / M) ^ n =
∑ k ∈ Finset.range (n + 1), wfLineageProb M n k * x ^ k
noncomputable def wfLineageProb (M k j : ℕ) : ℝ :=
(Nat.stirlingSecond k j : ℝ) * (M.descFactorial j : ℝ) / (M : ℝ) ^ k
MathlibExt/Biology/PopulationGenetics/Coalescent/BlockCounting.lean:84
Sources
- Ethier & Griffiths (1993); Durrett (2008), §7.
Uses 1 · Used by 2
TheoremMoment duality, one generation#✓fully proved
If the allele count after one neutral Wright–Fisher
generation with M ≥ 1 gene copies is Bin(M, x), then
E_x[(X₁)^n] = ∑_k wfLineageProb M n k · x^k, where X₁ is the new frequency and
wfLineageProb M n k is the probability that n genes have k distinct parents.
theorem integral_binomial_div_pow (M n : ℕ) (hM : M ≠ 0) (x : I) :
∫ i, ((i : ℝ) / M) ^ n ∂(ProbabilityTheory.binomial M x) =
∑ k ∈ Finset.range (n + 1), wfLineageProb M n k * (x : ℝ) ^ k
noncomputable def wfLineageProb (M k j : ℕ) : ℝ :=
(Nat.stirlingSecond k j : ℝ) * (M.descFactorial j : ℝ) / (M : ℝ) ^ k
MathlibExt/Biology/PopulationGenetics/Coalescent/BlockCounting.lean:84
Uses 2
TheoremOne Wright–Fisher generation acting on monomials#✓fully proved
One generation maps x ^ n to ∑_k wfLineageProb M n k x ^ k.
theorem wfStep_X_pow (M n : ℕ) (hM : M ≠ 0) :
wfStep M ((X ^ n : ℝ[X]).toContinuousMapOn I) =
(∑ k ∈ Finset.range (n + 1), C (wfLineageProb M n k) * X ^ k).toContinuousMapOn I
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
noncomputable def wfLineageProb (M k j : ℕ) : ℝ :=
(Nat.stirlingSecond k j : ℝ) * (M.descFactorial j : ℝ) / (M : ℝ) ^ k
MathlibExt/Biology/PopulationGenetics/Coalescent/BlockCounting.lean:84
Uses 3 · Used by 1
TheoremMoment duality, m generations#✓fully proved
For M ≥ 1 and n ≤ N, m generations of the
Wright–Fisher chain map x ^ n to ∑_k ((wfLineageMatrix N M)^m) n k · x^k: the n-th moment
of the frequency after m generations is the generating function of the number of ancestors,
m generations back, of n sampled genes.
theorem wfStep_pow_X_pow (M m N : ℕ) (hM : M ≠ 0) (n : Fin (N + 1)) :
(wfStep M ^ m) ((X ^ (n : ℕ) : ℝ[X]).toContinuousMapOn I) =
(∑ k : Fin (N + 1),
C ((wfLineageMatrix N M ^ m) n k) * X ^ (k : ℕ)).toContinuousMapOn I
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
noncomputable def wfLineageMatrix (n M : ℕ) : Matrix (Fin (n + 1)) (Fin (n + 1)) ℝ :=
Matrix.of fun k j => wfLineageProb M k j
MathlibExt/Biology/PopulationGenetics/Coalescent/BlockCounting.lean:90
Uses 4 · Used by 1
DefinitionDual moment polynomial of Kingman's coalescent#✓fully proved
The dual moment polynomial ∑_k P_t(n → k) X^k, where for t ≥ 0,
P_t(n → k) = exp (t • G) n k is the probability that n lineages of Kingman's coalescent have
k ancestors time t earlier (time in units of M = 2N generations); evaluated at x it is
E_n[x^{A_t}] for the block-counting process A.
noncomputable def dualMomentPoly (t : ℝ) (n : ℕ) : ℝ[X] :=
∑ k : Fin (n + 1),
C (NormedSpace.exp (t • blockCountingGenerator n) (Fin.last n) k) * X ^ (k : ℕ)
noncomputable def blockCountingGenerator (n : ℕ) : Matrix (Fin (n + 1)) (Fin (n + 1)) ℝ :=
Matrix.of fun k j =>
if (j : ℕ) + 1 = k then ((k : ℕ).choose 2 : ℝ)
else if j = k then -((k : ℕ).choose 2 : ℝ) else 0
MathlibExt/Biology/PopulationGenetics/Coalescent/BlockCounting.lean:95
Uses 1 · Used by 9
DefinitionWright–Fisher semigroup on polynomials by moment duality#✓fully proved
The neutral Wright–Fisher diffusion semigroup on polynomials, defined by moment duality on
the monomial basis: polySemigroup t (X ^ n) = dualMomentPoly t n. It is meaningful for
t ≥ 0; the formula is defined, and the group law holds, for every real t.
noncomputable def polySemigroup (t : ℝ) : ℝ[X] →ₗ[ℝ] ℝ[X] :=
(Polynomial.basisMonomials ℝ).constr ℝ (dualMomentPoly t)
noncomputable def dualMomentPoly (t : ℝ) (n : ℕ) : ℝ[X] :=
∑ k : Fin (n + 1),
C (NormedSpace.exp (t • blockCountingGenerator n) (Fin.last n) k) * X ^ (k : ℕ)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:344
Uses 1 · Used by 11
TheoremDual semigroup on a monomial#✓fully proved
The dual semigroup on a monomial is the dual moment polynomial.
theorem polySemigroup_X_pow (t : ℝ) (n : ℕ) : polySemigroup t (X ^ n) = dualMomentPoly t n
noncomputable def polySemigroup (t : ℝ) : ℝ[X] →ₗ[ℝ] ℝ[X] :=
(Polynomial.basisMonomials ℝ).constr ℝ (dualMomentPoly t)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:351
noncomputable def dualMomentPoly (t : ℝ) (n : ℕ) : ℝ[X] :=
∑ k : Fin (n + 1),
C (NormedSpace.exp (t • blockCountingGenerator n) (Fin.last n) k) * X ^ (k : ℕ)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:344
Uses 2 · Used by 7
TheoremDual semigroup at time zero is the identity#✓fully proved
At time 0 the dual semigroup is the identity.
theorem polySemigroup_zero : polySemigroup 0 = LinearMap.id
noncomputable def polySemigroup (t : ℝ) : ℝ[X] →ₗ[ℝ] ℝ[X] :=
(Polynomial.basisMonomials ℝ).constr ℝ (dualMomentPoly t)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:351
Uses 4 · Used by 2
TheoremSemigroup law#✓fully proved
Semigroup law on polynomials, from exp ((s + t) • G) = exp (t • G) * exp (s • G) and
truncation consistency; holds for all real s, t.
theorem polySemigroup_add (s t : ℝ) :
polySemigroup (s + t) = polySemigroup s ∘ₗ polySemigroup t
noncomputable def polySemigroup (t : ℝ) : ℝ[X] →ₗ[ℝ] ℝ[X] :=
(Polynomial.basisMonomials ℝ).constr ℝ (dualMomentPoly t)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:351
Uses 6 · Used by 1
TheoremDual semigroup fixes the constant polynomial one#✓fully proved
The dual semigroup fixes the constant polynomial 1 (zero lineages stay zero).
theorem polySemigroup_one (t : ℝ) : polySemigroup t 1 = 1
noncomputable def polySemigroup (t : ℝ) : ℝ[X] →ₗ[ℝ] ℝ[X] :=
(Polynomial.basisMonomials ℝ).constr ℝ (dualMomentPoly t)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:351
TheoremConvergence on polynomials#✓fully proved
For t ≥ 0 and every polynomial p, ⌊tM⌋ generations
of the Wright–Fisher chain with M gene copies applied to p converge uniformly on [0, 1] to
polySemigroup t p as M → ∞ (moment duality plus Kingman's theorem for the lineage count).
theorem tendsto_wfStep_pow_floor_toContinuousMapOn (p : ℝ[X]) {t : ℝ} (ht : 0 ≤ t) :
Tendsto (fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) (p.toContinuousMapOn I)) atTop
(𝓝 ((polySemigroup t p).toContinuousMapOn I))
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
noncomputable def polySemigroup (t : ℝ) : ℝ[X] →ₗ[ℝ] ℝ[X] :=
(Polynomial.basisMonomials ℝ).constr ℝ (dualMomentPoly t)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:351
Uses 8 · Used by 2
TheoremRescaled Wright–Fisher iterates form a Cauchy sequence#✓fully proved
For every continuous f, the sequence (wfStep M)^⌊tM⌋ f is Cauchy in C([0, 1], ℝ): it
converges on the dense set of polynomials and the operators are contractions.
theorem cauchySeq_wfStep_pow_floor (t : ℝ) (f : C(I, ℝ)) :
CauchySeq fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
Uses 7 · Used by 3
DefinitionNeutral Wright–Fisher diffusion semigroup#✓fully proved
The neutral Wright–Fisher diffusion semigroup on C([0, 1], ℝ), time in units of M = 2N
generations: wfSemigroup t f is the uniform limit of (wfStep M)^⌊tM⌋ f as M → ∞
(tendsto_wfStep_pow_floor). For t < 0 it is the identity (a junk value: ⌊tM⌋₊ = 0).
MathlibExt.Biology.PopulationGenetics.Diffusion.WrightFisherSemigroup.wfSemigroup · 16 lines
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
refine le_of_tendsto ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).norm
(Eventually.of_forall fun M => ?_)
exact ((wfStep M ^ ⌊t * M⌋₊).le_opNorm f).trans
(mul_le_of_le_one_left (norm_nonneg f) (norm_wfStep_pow_le M _)))
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
Uses 3 · Used by 21
TheoremDiffusion approximation of the transition operators (Trotter–Kato, concrete form)#✓fully proved
For
every continuous f, ⌊tM⌋ generations of the neutral Wright–Fisher chain with M gene copies
applied to f converge uniformly on [0, 1] to wfSemigroup t f.
theorem tendsto_wfStep_pow_floor (t : ℝ) (f : C(I, ℝ)) :
Tendsto (fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f) atTop (𝓝 (wfSemigroup t f))
noncomputable def wfStep (M : ℕ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := bernsteinApproximation M
map_add' := fun f g => by
ext x
simp [bernsteinApproximation.apply, mul_add, Finset.sum_add_distrib]
map_smul' := fun c f => by
ext x
simp [bernsteinApproximation.apply, Finset.mul_sum, smul_eq_mul, mul_left_comm] }
1 (fun f => by
refine (ContinuousMap.norm_le _ (by positivity)).2 fun x => ?_
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul, bernsteinApproximation.apply]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:105
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Sources
- Ethier & Kurtz (1986), ch. 1, §6 (approximation theorems), and ch. 10.
Uses 3 · Used by 4
TheoremContraction#✓fully proved
sup_{[0,1]} |wfSemigroup t f| ≤ sup_{[0,1]} |f|.
theorem norm_wfSemigroup_le (t : ℝ) : ‖wfSemigroup t‖ ≤ 1
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 4 · Used by 2
TheoremDiffusion semigroup agrees with the dual semigroup on polynomials#✓fully proved
On polynomials the diffusion semigroup is the dual semigroup, for t ≥ 0.
theorem wfSemigroup_toContinuousMapOn {t : ℝ} (ht : 0 ≤ t) (p : ℝ[X]) :
wfSemigroup t (p.toContinuousMapOn I) = (polySemigroup t p).toContinuousMapOn I
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
noncomputable def polySemigroup (t : ℝ) : ℝ[X] →ₗ[ℝ] ℝ[X] :=
(Polynomial.basisMonomials ℝ).constr ℝ (dualMomentPoly t)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:351
Uses 5 · Used by 4
TheoremWright–Fisher semigroup at nonpositive times is the identity#✓fully proved
For t ≤ 0, wfSemigroup t is the identity (at t = 0 by definition of a semigroup; for
t < 0 this is a junk value of the definition).
theorem wfSemigroup_of_nonpos {t : ℝ} (ht : t ≤ 0) : wfSemigroup t = 1
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
TheoremWright–Fisher diffusion semigroup at time zero is the identity#✓fully proved
At time 0 the diffusion semigroup is the identity.
@[simp]
theorem wfSemigroup_zero : wfSemigroup 0 = 1
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 2 · Used by 2
TheoremMoment duality for the diffusion#✓fully proved
Moment duality for the diffusion (Ethier & Griffiths 1993). For t ≥ 0, the semigroup
applied to x ↦ x ^ n is ∑_k P_t(n → k) x^k, with P_t = exp (t • G) the transition matrix of
Kingman's block-counting process A; in process language E_x[(X_t)^n] = E_n[x^{A_t}] (the
processes themselves are not constructed here).
theorem wfSemigroup_X_pow {t : ℝ} (ht : 0 ≤ t) (n : ℕ) (x : I) :
wfSemigroup t ((X ^ n : ℝ[X]).toContinuousMapOn I) x =
∑ k : Fin (n + 1),
NormedSpace.exp (t • blockCountingGenerator n) (Fin.last n) k * (x : ℝ) ^ (k : ℕ)
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
noncomputable def blockCountingGenerator (n : ℕ) : Matrix (Fin (n + 1)) (Fin (n + 1)) ℝ :=
Matrix.of fun k j =>
if (j : ℕ) + 1 = k then ((k : ℕ).choose 2 : ℝ)
else if j = k then -((k : ℕ).choose 2 : ℝ) else 0
MathlibExt/Biology/PopulationGenetics/Coalescent/BlockCounting.lean:95
Uses 6 · Used by 1
TheoremSemigroup law#✓fully proved
Semigroup law for s, t ≥ 0.
theorem wfSemigroup_add {s t : ℝ} (hs : 0 ≤ s) (ht : 0 ≤ t) :
wfSemigroup (s + t) = wfSemigroup s * wfSemigroup t
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
TheoremWright–Fisher diffusion semigroup fixes constants#✓fully proved
The diffusion semigroup fixes constants (it is Markov: total mass 1).
theorem wfSemigroup_apply_one (t : ℝ) : wfSemigroup t 1 = 1
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 5 · Used by 2
TheoremPositivity#✓fully proved
The diffusion semigroup maps nonnegative functions to nonnegative functions.
theorem wfSemigroup_nonneg (t : ℝ) {f : C(I, ℝ)} (hf : 0 ≤ f) : 0 ≤ wfSemigroup t f
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 5 · Used by 3
TheoremStrong continuity#✓fully proved
wfSemigroup t f → f uniformly as t → 0⁺, for every continuous
f.
theorem tendsto_wfSemigroup_nhdsGE_zero (f : C(I, ℝ)) :
Tendsto (fun t => wfSemigroup t f) (𝓝[≥] 0) (𝓝 f)
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 14 · Used by 3
DefinitionNeutral Wright–Fisher generator on polynomials#✓fully proved
The neutral Wright–Fisher generator on polynomials, x (1 - x) / 2 · p''.
noncomputable def polyGenerator (p : ℝ[X]) : ℝ[X] :=
C (1 / 2 : ℝ) * X * (1 - X) * derivative (derivative p)
TheoremPolynomial generator agrees with the neutral Wright–Fisher generator#✓fully proved
polyGenerator is the neutral Wright–Fisher generator generator 0 evaluated on p.
theorem eval_polyGenerator (p : ℝ[X]) (x : ℝ) :
(polyGenerator p).eval x = generator 0 (fun y => p.eval y) x
noncomputable def polyGenerator (p : ℝ[X]) : ℝ[X] :=
C (1 / 2 : ℝ) * X * (1 - X) * derivative (derivative p)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:661
noncomputable def generator (σ : ℝ) (u : ℝ → ℝ) (x : ℝ) : ℝ :=
x * (1 - x) / 2 * deriv (deriv u) x + σ * x * (1 - x) * deriv u x
MathlibExt/Biology/PopulationGenetics/Diffusion/WrightFisher.lean:93
Uses 2 · Used by 1
TheoremGenerator on polynomials#✓fully proved
For every polynomial p,
(wfSemigroup t p - p) / t → x (1 - x) / 2 · p'' uniformly on [0, 1] as t → 0⁺.
theorem tendsto_wfSemigroup_sub_div (p : ℝ[X]) :
Tendsto (fun t : ℝ => t⁻¹ • (wfSemigroup t (p.toContinuousMapOn I) - p.toContinuousMapOn I))
(𝓝[>] 0) (𝓝 ((polyGenerator p).toContinuousMapOn I))
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
noncomputable def polyGenerator (p : ℝ[X]) : ℝ[X] :=
C (1 / 2 : ℝ) * X * (1 - X) * derivative (derivative p)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:661
Sources
- Ethier & Kurtz (1986), ch. 10; Durrett (2008), §7.
Uses 17 · Used by 1
TheoremPolynomial semigroup dynamics#✓fully proved
At every positive time, differentiating the existing Wright–Fisher semigroup on a polynomial equals applying the semigroup to its generator.
theorem hasDerivAt_wfSemigroup_toContinuousMapOn (p : ℝ[X]) {t : ℝ} (ht : 0 < t) :
HasDerivAt (fun s : ℝ => wfSemigroup s (p.toContinuousMapOn I))
(wfSemigroup t ((polyGenerator p).toContinuousMapOn I)) t
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
noncomputable def polyGenerator (p : ℝ[X]) : ℝ[X] :=
C (1 / 2 : ℝ) * X * (1 - X) * derivative (derivative p)
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:661
Uses 6 · Used by 2
TheoremSecond-moment bound for the Wright–Fisher semigroup#✓fully proved
The centered second moment grows at most linearly: T_t[(y-x)²](x) ≤ t/4.
theorem wfSemigroup_second_increment_le {t : ℝ} (ht : 0 ≤ t) (x : I) :
wfSemigroup t (((X - C (x : ℝ)) ^ 2 : ℝ[X]).toContinuousMapOn I) x ≤
(1 / 4 : ℝ) * t
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 7 · Used by 1
TheoremFourth-moment Kolmogorov bound for the Wright–Fisher semigroup#✓fully proved
The fourth centered increment of the neutral Wright–Fisher semigroup satisfies the uniform
Kolmogorov bound T_t[(y-x)⁴](x) ≤ (3/16)t².
theorem wfSemigroup_fourth_increment_le {t : ℝ} (ht : 0 ≤ t) (x : I) :
wfSemigroup t (((X - C (x : ℝ)) ^ 4 : ℝ[X]).toContinuousMapOn I) x ≤
(3 / 16 : ℝ) * t ^ 2
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 7 · Used by 1
DefinitionWright–Fisher semigroup as a positive operator#✓fully proved
The Wright–Fisher semigroup bundled as a positive continuous linear operator.
noncomputable def wfSemigroupPositive (t : ℝ) : C(I, ℝ) →P[ℝ] C(I, ℝ) :=
PositiveContinuousLinearMap.mk
(PositiveLinearMap.mk (wfSemigroup t).toLinearMap fun f g hfg => by
have hgf : 0 ≤ g - f := ContinuousMap.le_def.mpr fun x =>
sub_nonneg.mpr (ContinuousMap.le_def.mp hfg x)
apply ContinuousMap.le_def.mpr
intro x
have hx := ContinuousMap.le_def.mp (wfSemigroup_nonneg t hgf) x
rw [map_sub] at hx
exact sub_nonneg.mp hx)
(wfSemigroup t).continuous
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 2 · Used by 12
TheoremAction of the positive Wright–Fisher operator#✓fully proved
Bundling the operator as positive leaves its action on continuous functions unchanged.
@[simp]
theorem wfSemigroupPositive_apply (t : ℝ) (f : C(I, ℝ)) :
wfSemigroupPositive t f = wfSemigroup t f
noncomputable def wfSemigroupPositive (t : ℝ) : C(I, ℝ) →P[ℝ] C(I, ℝ) :=
PositiveContinuousLinearMap.mk
(PositiveLinearMap.mk (wfSemigroup t).toLinearMap fun f g hfg => by
have hgf : 0 ≤ g - f := ContinuousMap.le_def.mpr fun x =>
sub_nonneg.mpr (ContinuousMap.le_def.mp hfg x)
apply ContinuousMap.le_def.mpr
intro x
have hx := ContinuousMap.le_def.mp (wfSemigroup_nonneg t hgf) x
rw [map_sub] at hx
exact sub_nonneg.mp hx)
(wfSemigroup t).continuous
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:40
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 2 · Used by 1
TheoremPositive Wright–Fisher operator fixes constants#✓fully proved
The positive Wright–Fisher operator fixes the constant function 1.
@[simp]
theorem wfSemigroupPositive_apply_one (t : ℝ) : wfSemigroupPositive t 1 = 1
noncomputable def wfSemigroupPositive (t : ℝ) : C(I, ℝ) →P[ℝ] C(I, ℝ) :=
PositiveContinuousLinearMap.mk
(PositiveLinearMap.mk (wfSemigroup t).toLinearMap fun f g hfg => by
have hgf : 0 ≤ g - f := ContinuousMap.le_def.mpr fun x =>
sub_nonneg.mpr (ContinuousMap.le_def.mp hfg x)
apply ContinuousMap.le_def.mpr
intro x
have hx := ContinuousMap.le_def.mp (wfSemigroup_nonneg t hgf) x
rw [map_sub] at hx
exact sub_nonneg.mp hx)
(wfSemigroup t).continuous
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:40
Uses 2 · Used by 9
TheoremSemigroup law for the positive Wright–Fisher operator#✓fully proved
The positive-operator form of the Wright–Fisher semigroup law.
theorem wfSemigroupPositive_add {s t : ℝ} (hs : 0 ≤ s) (ht : 0 ≤ t) :
wfSemigroupPositive (s + t) =
(wfSemigroupPositive s).comp (wfSemigroupPositive t)
noncomputable def wfSemigroupPositive (t : ℝ) : C(I, ℝ) →P[ℝ] C(I, ℝ) :=
PositiveContinuousLinearMap.mk
(PositiveLinearMap.mk (wfSemigroup t).toLinearMap fun f g hfg => by
have hgf : 0 ≤ g - f := ContinuousMap.le_def.mpr fun x =>
sub_nonneg.mpr (ContinuousMap.le_def.mp hfg x)
apply ContinuousMap.le_def.mpr
intro x
have hx := ContinuousMap.le_def.mp (wfSemigroup_nonneg t hgf) x
rw [map_sub] at hx
exact sub_nonneg.mp hx)
(wfSemigroup t).continuous
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:40
Uses 3 · Used by 1
DefinitionTransition kernel of the neutral Wright–Fisher diffusion#✓fully proved
The transition kernel of the neutral Wright–Fisher diffusion at time t. For nonnegative t
it is the probabilistic transition corresponding to wfSemigroup t; for negative t, both the
operator and kernel are the identity junk value inherited from wfSemigroup.
noncomputable def wfTransitionKernel (t : ℝ) : Kernel I I :=
markovKernelOfPositiveOperator (wfSemigroupPositive t) (wfSemigroupPositive_apply_one t)
noncomputable def markovKernelOfPositiveOperator (T : C(E, ℝ) →P[ℝ] C(E, ℝ))
(hT : T 1 = 1) : Kernel E E :=
(exists_markovKernelOfPositiveOperator T hT).choose
MathlibExt/Probability/PositiveOperatorKernel.lean:152
noncomputable def wfSemigroupPositive (t : ℝ) : C(I, ℝ) →P[ℝ] C(I, ℝ) :=
PositiveContinuousLinearMap.mk
(PositiveLinearMap.mk (wfSemigroup t).toLinearMap fun f g hfg => by
have hgf : 0 ≤ g - f := ContinuousMap.le_def.mpr fun x =>
sub_nonneg.mpr (ContinuousMap.le_def.mp hfg x)
apply ContinuousMap.le_def.mpr
intro x
have hx := ContinuousMap.le_def.mp (wfSemigroup_nonneg t hgf) x
rw [map_sub] at hx
exact sub_nonneg.mp hx)
(wfSemigroup t).continuous
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:40
@[simp]
theorem wfSemigroupPositive_apply_one (t : ℝ) : wfSemigroupPositive t 1 = 1
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:60
Uses 3 · Used by 12
TheoremWright–Fisher transition kernel represents the semigroup#✓fully proved
Integration against the transition kernel agrees with the Wright–Fisher semigroup on every continuous test function and every initial allele frequency.
@[simp]
theorem integral_wfTransitionKernel (t : ℝ) (f : C(I, ℝ)) (x : I) :
∫ y, f y ∂wfTransitionKernel t x = wfSemigroup t f x
noncomputable def wfTransitionKernel (t : ℝ) : Kernel I I :=
markovKernelOfPositiveOperator (wfSemigroupPositive t) (wfSemigroupPositive_apply_one t)
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:73
noncomputable def wfSemigroup (t : ℝ) : C(I, ℝ) →L[ℝ] C(I, ℝ) :=
LinearMap.mkContinuous
{ toFun := fun f => limUnder atTop fun M : ℕ => (wfStep M ^ ⌊t * M⌋₊) f
map_add' := fun f g => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (f + g)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).add
(cauchySeq_wfStep_pow_floor t g).tendsto_limUnder
map_smul' := fun c f => by
refine tendsto_nhds_unique (cauchySeq_wfStep_pow_floor t (c • f)).tendsto_limUnder ?_
simpa using ((cauchySeq_wfStep_pow_floor t f).tendsto_limUnder).const_smul c }
1 (fun f => by
simp only [LinearMap.coe_mk, AddHom.coe_mk, one_mul]
⋯
MathlibExt/Biology/PopulationGenetics/Diffusion/Semigroup.lean:502
Uses 7 · Used by 3
TheoremWright–Fisher transition kernel is the identity at nonpositive times#✓fully proved
For nonpositive times, the Wright–Fisher transition is the identity kernel.
theorem wfTransitionKernel_of_nonpos {t : ℝ} (ht : t ≤ 0) :
wfTransitionKernel t = (Kernel.id : Kernel I I)
noncomputable def wfTransitionKernel (t : ℝ) : Kernel I I :=
markovKernelOfPositiveOperator (wfSemigroupPositive t) (wfSemigroupPositive_apply_one t)
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:73
Uses 9 · Used by 1
TheoremWright–Fisher transition kernel is the identity at time zero#✓fully proved
At time zero the Wright–Fisher transition is the identity kernel.
@[simp]
theorem wfTransitionKernel_zero : wfTransitionKernel 0 = (Kernel.id : Kernel I I)
noncomputable def wfTransitionKernel (t : ℝ) : Kernel I I :=
markovKernelOfPositiveOperator (wfSemigroupPositive t) (wfSemigroupPositive_apply_one t)
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:73
TheoremWright–Fisher transitions at time zero are Dirac masses#✓fully proved
Pointwise identity law for the transition kernel at time zero.
@[simp]
theorem wfTransitionKernel_zero_apply (x : I) : wfTransitionKernel 0 x = Measure.dirac x
noncomputable def wfTransitionKernel (t : ℝ) : Kernel I I :=
markovKernelOfPositiveOperator (wfSemigroupPositive t) (wfSemigroupPositive_apply_one t)
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:73
Uses 2
TheoremChapman–Kolmogorov equation for the Wright–Fisher diffusion#✓fully proved
Chapman–Kolmogorov law for the Wright–Fisher transition kernels. With Mathlib's convention,
K_t ∘ₖ K_s first evolves for time s and then for time t.
theorem wfTransitionKernel_add {s t : ℝ} (hs : 0 ≤ s) (ht : 0 ≤ t) :
wfTransitionKernel (s + t) = wfTransitionKernel t ∘ₖ wfTransitionKernel s
noncomputable def wfTransitionKernel (t : ℝ) : Kernel I I :=
markovKernelOfPositiveOperator (wfSemigroupPositive t) (wfSemigroupPositive_apply_one t)
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:73
Uses 6 · Used by 1
TheoremKernel form of Wright–Fisher moment duality#✓fully proved
Kernel form of Wright–Fisher moment duality: transition-kernel moments are the transition probabilities of Kingman's block-counting process.
theorem integral_wfTransitionKernel_X_pow {t : ℝ} (ht : 0 ≤ t) (n : ℕ) (x : I) :
∫ y, ((Polynomial.X ^ n : Polynomial ℝ).toContinuousMapOn I) y ∂wfTransitionKernel t x =
∑ k : Fin (n + 1),
NormedSpace.exp (t • blockCountingGenerator n) (Fin.last n) k * (x : ℝ) ^ (k : ℕ)
noncomputable def wfTransitionKernel (t : ℝ) : Kernel I I :=
markovKernelOfPositiveOperator (wfSemigroupPositive t) (wfSemigroupPositive_apply_one t)
MathlibExt/Biology/PopulationGenetics/Diffusion/TransitionKernel.lean:73
noncomputable def blockCountingGenerator (n : ℕ) : Matrix (Fin (n + 1)) (Fin (n + 1)) ℝ :=
Matrix.of fun k j =>
if (j : ℕ) + 1 = k then ((k : ℕ).choose 2 : ℝ)
else if j = k then -((k : ℕ).choose 2 : ℝ) else 0
MathlibExt/Biology/PopulationGenetics/Coalescent/BlockCounting.lean:95
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.