four_pow_le_central_binomtheoremApplies a library theorempropext, Classical.choice, Quot.sound
four_pow_le_central_binomLean 4Applies a library theoremFormally verified
/-- `4ⁿ ≤ (2n + 1) · C(2n, n)`: the central binomial coefficient is the largest of the `2n + 1`coefficients `C(2n, k)`, which sum to `4ⁿ`. This applies Mathlib's`Nat.four_pow_le_two_mul_add_one_mul_centralBinom`. -/theorem four_pow_le_central_binom (n : ℕ) : 4 ^ n ≤ (2 * n + 1) * centralBinom n := Nat.four_pow_le_two_mul_add_one_mul_centralBinom n
return_1d_not_summabletheoremProved here from basic factspropext, Classical.choice, Quot.sound
return_1d_not_summableLean 4Proved here from basic factsFormally verified
/-- **Pólya in dimension 1, analytically.** The probability that simple random walk on ℤ is atthe origin at time `2n` is `p₂ₙ = C(2n, n)/4ⁿ`, and `∑ p₂ₙ` (the expected number of returns)diverges, because `p₂ₙ ≥ 1/(2n + 1)`. By the criterion proved in the lesson (Theorem 1), thewalk is recurrent. -/theorem return_1d_not_summable : ¬ Summable (fun n : ℕ => (centralBinom n : ℝ) / 4 ^ n) := by intro h apply not_summable_one_div_two_mul_add_one refine Summable.of_nonneg_of_le (fun n => by positivity) (fun n => ?_) h have hle : (4 : ℝ) ^ n ≤ (2 * n + 1) * centralBinom n := by exact_mod_cast four_pow_le_central_binom n rw [div_le_div_iff₀ (by positivity) (by positivity)] linarith
return_prob_tendsto_zerotheoremProved here from basic factspropext, Classical.choice, Quot.sound
return_prob_tendsto_zeroLean 4Proved here from basic factsFormally verified
/-- Yet `p₂ₙ = C(2n, n)/4ⁿ → 0`: by `central_binom_sq_upper`, `p₂ₙ² ≤ 1/(2n + 1)`. The walk on ℤreturns with probability one, but the chance of being home at any given late time is small — onereason the expected return time is infinite. -/theorem return_prob_tendsto_zero : Tendsto (fun n : ℕ => (centralBinom n : ℝ) / 4 ^ n) atTop (𝓝 0) := by have hsq : Tendsto (fun n : ℕ => ((centralBinom n : ℝ) / 4 ^ n) ^ 2) atTop (𝓝 0) := by refine squeeze_zero (fun n => by positivity) (fun n => ?_) tendsto_one_div_add_atTop_nhds_zero_nat have hup : (2 * (n : ℝ) + 1) * (centralBinom n : ℝ) ^ 2 ≤ 16 ^ n := by exact_mod_cast central_binom_sq_upper n have h16 : ((4 : ℝ) ^ n) ^ 2 = 16 ^ n := by rw [← pow_mul, mul_comm, pow_mul]; norm_num rw [div_pow, h16, div_le_div_iff₀ (by positivity) (by positivity)] nlinarith [sq_nonneg (centralBinom n : ℝ)] have h := hsq.sqrt simp only [Real.sqrt_zero] at h refine h.congr (fun n => ?_) exact Real.sqrt_sq (by positivity)
/-- The 45° rotation (and scaling by `√2`) `(x, y) ↦ (x + y, x − y)` of ℤ², as an additive map. -/def rot : ℤ × ℤ →+ ℤ × ℤ where toFun v := (v.1 + v.2, v.1 - v.2) map_zero' := by simp map_add' u v := by ext <;> simp <;> ring
rot_injectivetheoremProved here from basic factspropext, Quot.sound
rot_injectiveLean 4Proved here from basic factsFormally verified
/-- The rotation is injective: from `x + y` and `x − y` one recovers `x` and `y`. -/theorem rot_injective : Function.Injective rot := by intro u v h simp only [rot, AddMonoidHom.coe_mk, ZeroHom.coe_mk, Prod.mk.injEq] at h ext <;> omega
rot_unit_stepstheoremProved here from basic factspropext, Classical.choice, Quot.sound
rot_unit_stepsLean 4Proved here from basic factsFormally verified
/-- The rotation maps the four unit steps bijectively onto the four diagonal steps (checked by`decide`; injectivity is `rot_injective`). So a uniformly random unit step becomes a pair of*independent* uniform `±1` steps, and simple random walk on ℤ² becomes two independent simplerandom walks on ℤ. -/theorem rot_unit_steps : unitSteps.image rot = diagSteps := by decide
nash_williams_divergestheoremProved here from basic factspropext, Classical.choice, Quot.sound
nash_williams_divergesLean 4Proved here from basic factsFormally verified
/-- **The Nash-Williams series for ℤ² diverges.** The edges joining the boundary of the box`[-k, k]²` to the boundary of `[-(k+1), k+1]²` form a cutset of `8k + 4` unit resistors; theNash-Williams inequality gives `R_eff(0 ↔ ∞) ≥ ∑ₖ 1/(8k + 4) = ∞`, so the walk on ℤ² isrecurrent. Proof: compare with the harmonic series. -/theorem nash_williams_diverges : ¬ Summable (fun k : ℕ => (1 : ℝ) / (8 * k + 4)) := by intro h have h2 : Summable (fun n : ℕ => (1 : ℝ) / ((n + 1 : ℕ) : ℝ)) := by refine Summable.of_nonneg_of_le (fun n => by positivity) (fun n => ?_) (h.mul_left 8) push_cast rw [div_le_iff₀ (by positivity)] field_simp nlinarith exact Real.not_summable_one_div_natCast ((summable_nat_add_iff 1).mp h2)
summable_inv_sqtheoremApplies a library theorempropext, Classical.choice, Quot.sound
summable_inv_sqLean 4Applies a library theoremFormally verified
/-- `∑ 1/n²` converges. In ℤ³ a unit flow from the origin spread evenly over spheres has energycomparable to `∑ₖ k² · (1/k²)² = ∑ 1/k²`, finite, so by T. Lyons' criterion the walk on ℤ³ istransient. This applies Mathlib's `Real.summable_one_div_nat_pow`. -/theorem summable_inv_sq : Summable (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 2) := Real.summable_one_div_nat_pow.mpr one_lt_two
peierls_tendstotheoremProved here from basic factspropext, Classical.choice, Quot.sound
peierls_tendstoLean 4Proved here from basic factsFormally verified
/-- **Peierls' estimate.** If there are at most `cₙ ≤ 4 · 3ⁿ` self-avoiding paths of length `n`from the origin and each is open with probability `pⁿ`, then for `p < 1/3` the expected number ofopen such paths, at most `cₙ pⁿ ≤ 4(3p)ⁿ`, tends to `0`. So the origin lies in an infinite opencluster with probability `0`, and `p_c(ℤ²) ≥ 1/3`. (The count `cₙ ≤ 4 · 3^{n-1}` is proved in thelesson; here it is a hypothesis.) -/theorem peierls_tendsto {c : ℕ → ℕ} (hc : ∀ n, c n ≤ 4 * 3 ^ n) {p : ℝ} (hp0 : 0 ≤ p) (hp : p < 1 / 3) : Tendsto (fun n => (c n : ℝ) * p ^ n) atTop (𝓝 0) := by have h3 : 3 * p < 1 := by linarith have hlim : Tendsto (fun n : ℕ => 4 * (3 * p) ^ n) atTop (𝓝 0) := by simpa using (tendsto_pow_atTop_nhds_zero_of_lt_one (by linarith) h3).const_mul 4 refine squeeze_zero (fun n => by positivity) (fun n => ?_) hlim have : (c n : ℝ) ≤ 4 * 3 ^ n := by exact_mod_cast hc n calc (c n : ℝ) * p ^ n ≤ (4 * 3 ^ n) * p ^ n := by gcongr _ = 4 * (3 * p) ^ n := by ring
dual_circuits_summabletheoremApplies a library theorempropext, Classical.choice, Quot.sound
dual_circuits_summableLean 4Applies a library theoremFormally verified
/-- **The dual half of Peierls' argument.** The number of dual circuits of length `n` surroundingthe origin is at most `n · 4 · 3ⁿ`, and each is closed with probability `qⁿ`, `q = 1 − p`. For`q < 1/3` the series `∑ n · 4 · 3ⁿ qⁿ` converges, so its tails tend to `0`; this gives`p_c(ℤ²) ≤ 2/3`. Uses Mathlib's `summable_pow_mul_geometric_of_norm_lt_one`. -/theorem dual_circuits_summable {q : ℝ} (hq0 : 0 ≤ q) (hq : q < 1 / 3) : Summable (fun n : ℕ => (n : ℝ) * 4 * 3 ^ n * q ^ n) := by have h := summable_pow_mul_geometric_of_norm_lt_one 1 (r := 3 * q) (by rw [Real.norm_eq_abs, abs_lt]; constructor <;> linarith) refine (h.mul_left 4).congr (fun n => ?_) ring
/-- Show that the rotation `(x, y) ↦ (x + y, x − y)` is injective.Hint: `intro u v h`, unfold with `simp only [rot, AddMonoidHom.coe_mk, ZeroHom.coe_mk,Prod.mk.injEq] at h`, then `ext <;> omega`. -/theorem rot_injective : Function.Injective rot := by sorry
Show the compiled solution
rot_injectiveLean 4Proved here from basic factsFormally verified
/-- The rotation is injective: from `x + y` and `x − y` one recovers `x` and `y`. -/theorem rot_injective : Function.Injective rot := by intro u v h simp only [rot, AddMonoidHom.coe_mk, ZeroHom.coe_mk, Prod.mk.injEq] at h ext <;> omega