Skip to content

Commit 6fcd412

Browse files
Update TuranDensity.lean
1 parent 06d5019 commit 6fcd412

2 files changed

Lines changed: 19 additions & 90 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Extremal/TuranDensity.lean

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public import Mathlib.Combinatorics.SimpleGraph.DeleteEdges
1111
public import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic
1212
public import Mathlib.Data.Nat.Choose.Cast
1313

14+
import Mathlib.Topology.Instances.Real.Lemmas
15+
1416
/-!
1517
# Turán density
1618
@@ -78,11 +80,15 @@ noncomputable def turanDensity (H : SimpleGraph W) :=
7880

7981
theorem isGLB_turanDensity (H : SimpleGraph W) :
8082
IsGLB { (extremalNumber n H / n.choose 2 : ℝ) | n ∈ Set.Ici 2 } (turanDensity H) := by
81-
apply Real.isGLB_limUnder_of_bddBelow_antitoneOn_Ici
82-
· refine ⟨0, fun x ⟨_, _, hx⟩ ↦ ?_⟩
83+
have h_bdd : BddBelow { (extremalNumber n H / n.choose 2 : ℝ) | n ∈ Set.Ici 2 } := by
84+
refine ⟨0, fun x ⟨_, _, hx⟩ ↦ ?_⟩
8385
rw [← hx]
8486
positivity
85-
· exact antitoneOn_extremalNumber_div_choose_two H
87+
refine Real.isGLB_of_tendsto_antitoneOn_bddBelow_nat_Ici ?_
88+
(antitoneOn_extremalNumber_div_choose_two H) h_bdd
89+
have h_tto := Real.tendsto_atTop_csInf_of_antitoneOn_bddBelow_nat_Ici
90+
(antitoneOn_extremalNumber_div_choose_two H) h_bdd
91+
rwa [← h_tto.limUnder_eq] at h_tto
8692

8793
theorem turanDensity_eq_csInf (H : SimpleGraph W) :
8894
turanDensity H = sInf { (extremalNumber n H / n.choose 2 : ℝ) | n ∈ Set.Ici 2 } :=
@@ -92,8 +98,8 @@ theorem turanDensity_eq_csInf (H : SimpleGraph W) :
9298
/-- The **Turán density** of a simple graph `H` is well-defined. -/
9399
theorem tendsto_turanDensity (H : SimpleGraph W) :
94100
Tendsto (fun n ↦ (extremalNumber n H / n.choose 2 : ℝ)) atTop (𝓝 (turanDensity H)) := by
95-
have h_tendsto := Real.tendsto_csInf_of_bddBelow_antitoneOn_Ici
96-
(isGLB_turanDensity H).bddBelow (antitoneOn_extremalNumber_div_choose_two H)
101+
have h_tendsto := Real.tendsto_atTop_csInf_of_antitoneOn_bddBelow_nat_Ici
102+
(antitoneOn_extremalNumber_div_choose_two H) (isGLB_turanDensity H).bddBelow
97103
rwa [turanDensity, h_tendsto.limUnder_eq]
98104

99105
/-- `extremalNumber n H` is asymptotically equivalent to `turanDensity H * n.choose 2` as `n`

Mathlib/Topology/Instances/NNReal/Lemmas.lean

Lines changed: 8 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Authors: Johan Commelin
55
-/
66
module
77

8-
public import Mathlib.Algebra.Order.Monoid.Canonical.Basic
98
public import Mathlib.Data.NNReal.Basic
109
public import Mathlib.Topology.Algebra.InfiniteSum.Order
1110
public import Mathlib.Topology.Algebra.InfiniteSum.Ring
@@ -221,93 +220,17 @@ def powOrderIso (n : ℕ) (hn : n ≠ 0) : ℝ≥0 ≃o ℝ≥0 :=
221220

222221
section Monotone
223222

224-
/-- A monotone, bounded above sequence `f : ℕ → ℝ` has the finite limit `iSup f`. -/
225-
theorem _root_.Real.tendsto_ciSup_of_bddAbove_monotone {f : ℕ → ℝ}
226-
(h_bdd : BddAbove (range f)) (h_mon : Monotone f) :
227-
Tendsto f atTop (𝓝 (iSup f)) := by
228-
obtain ⟨B, h_lub⟩ := Real.exists_isLUB (range_nonempty f) h_bdd
229-
have h_sup : iSup f = B := h_lub.csSup_eq (range_nonempty f)
230-
rw [h_sup]
231-
exact tendsto_atTop_isLUB h_mon h_lub
232-
233-
/-- An antitone, bounded below sequence `f : ℕ → ℝ` has the finite limit `iInf f`. -/
234-
theorem _root_.Real.tendsto_ciInf_of_bddBelow_antitone {f : ℕ → ℝ}
235-
(h_bdd : BddBelow (range f)) (h_ant : Antitone f) :
236-
Tendsto f atTop (𝓝 (iInf f)) := by
237-
obtain ⟨B, h_glb⟩ := Real.exists_isGLB (range_nonempty f) h_bdd
238-
have h_inf : iInf f = B := h_glb.csInf_eq (range_nonempty f)
239-
rw [h_inf]
240-
exact tendsto_atTop_isGLB h_ant h_glb
241-
242-
/-- A monotone, bounded above sequence `f : ℕ → ℝ` on `Ici k` has the finite
243-
limit `sSup (f '' Ici k)`. -/
244-
theorem _root_.Real.tendsto_csSup_of_bddAbove_monotoneOn_Ici {f : ℕ → ℝ} {k : ℕ}
245-
(h_bdd : BddAbove (f '' Ici k)) (h_mon : MonotoneOn f (Ici k)) :
246-
Tendsto f atTop (𝓝 (sSup (f '' Ici k))) := by
247-
rw [← range_add_eq_image_Ici] at h_bdd
248-
rw [Ici, ← monotone_add_nat_iff_monotoneOn_nat_Ici] at h_mon
249-
have h := Real.tendsto_ciSup_of_bddAbove_monotone h_bdd h_mon
250-
rwa [tendsto_add_atTop_iff_nat k, ← sSup_range,
251-
range_add_eq_image_Ici, image] at h
252-
253-
/-- An antitone, bounded below sequence `f : ℕ → ℝ` on `Ici k` has the finite
254-
limit `sInf (f '' Ici k)`. -/
255-
theorem _root_.Real.tendsto_csInf_of_bddBelow_antitoneOn_Ici {f : ℕ → ℝ} {k : ℕ}
256-
(h_bdd : BddBelow (f '' Ici k)) (h_ant : AntitoneOn f (Ici k)) :
257-
Tendsto f atTop (𝓝 (sInf (f '' Ici k))) := by
258-
rw [← range_add_eq_image_Ici] at h_bdd
259-
rw [Ici, ← antitone_add_nat_iff_antitoneOn_nat_Ici] at h_ant
260-
have h := Real.tendsto_ciInf_of_bddBelow_antitone h_bdd h_ant
261-
rwa [tendsto_add_atTop_iff_nat k, ← sInf_range,
262-
range_add_eq_image_Ici, image] at h
263-
264-
/-- The limit of a monotone, bounded above sequence `f : ℕ → ℝ` is a least upper bound
265-
of the sequence. -/
266-
theorem _root_.Real.isLUB_limUnder_of_bddAbove_monotone {f : ℕ → ℝ}
267-
(h_bdd : BddAbove (range f)) (h_mon : Monotone f) :
268-
IsLUB (range f) (limUnder atTop f) := by
269-
have h := Real.tendsto_ciSup_of_bddAbove_monotone h_bdd h_mon
270-
rw [h.limUnder_eq]
271-
exact isLUB_ciSup h_bdd
272-
273-
/-- The limit of an antitone, bounded below sequence `f : ℕ → ℝ` is a greatest lower bound
274-
of the sequence. -/
275-
theorem _root_.Real.isGLB_limUnder_of_bddBelow_antitone {f : ℕ → ℝ}
276-
(h_bdd : BddBelow (range f)) (h_ant : Antitone f) :
277-
IsGLB (range f) (limUnder atTop f) := by
278-
have h := Real.tendsto_ciInf_of_bddBelow_antitone h_bdd h_ant
279-
rw [h.limUnder_eq]
280-
exact isGLB_ciInf h_bdd
281-
282-
/-- The limit of an antitone, bounded below sequence `f : ℕ → ℝ` on `Ici k` is a least
283-
upper bound of the sequence. -/
284-
theorem _root_.Real.isLUB_limUnder_of_bddAbove_monotoneOn_Ici {f : ℕ → ℝ} {k : ℕ}
285-
(h_bdd : BddAbove (f '' Ici k)) (h_mon : MonotoneOn f (Ici k)) :
286-
IsLUB (f '' Ici k) (limUnder atTop f) := by
287-
have h := Real.tendsto_csSup_of_bddAbove_monotoneOn_Ici h_bdd h_mon
288-
rw [h.limUnder_eq]
289-
exact isLUB_csSup (image_nonempty.mpr nonempty_Ici) h_bdd
290-
291-
/-- The limit of an antitone, bounded below sequence `f : ℕ → ℝ` on `Ici k` is a greatest
292-
lower bound of the sequence. -/
293-
theorem _root_.Real.isGLB_limUnder_of_bddBelow_antitoneOn_Ici {f : ℕ → ℝ} {k : ℕ}
294-
(h_bdd : BddBelow (f '' Ici k)) (h_ant : AntitoneOn f (Ici k)) :
295-
IsGLB (f '' Ici k) (limUnder atTop f) := by
296-
have h := Real.tendsto_csInf_of_bddBelow_antitoneOn_Ici h_bdd h_ant
297-
rw [h.limUnder_eq]
298-
exact isGLB_csInf (image_nonempty.mpr nonempty_Ici) h_bdd
299-
300-
-- TODO remove `Real.tendsto_of_bddAbove_monotone` entirely
301223
/-- A monotone, bounded above sequence `f : ℕ → ℝ` has a finite limit. -/
302-
theorem _root_.Real.tendsto_of_bddAbove_monotone {f : ℕ → ℝ} (h_bdd : BddAbove (range f))
303-
(h_mon : Monotone f) : ∃ r : ℝ, Tendsto f atTop (𝓝 r) :=
304-
⟨iSup f, Real.tendsto_ciSup_of_bddAbove_monotone h_bdd h_mon⟩
224+
theorem _root_.Real.tendsto_of_bddAbove_monotone {f : ℕ → ℝ} (h_bdd : BddAbove (Set.range f))
225+
(h_mon : Monotone f) : ∃ r : ℝ, Tendsto f atTop (𝓝 r) := by
226+
obtain ⟨B, hB⟩ := Real.exists_isLUB (Set.range_nonempty f) h_bdd
227+
exact ⟨B, tendsto_atTop_isLUB h_mon hB⟩
305228

306-
-- TODO remove `Real.tendsto_of_bddBelow_antitone` entirely
307229
/-- An antitone, bounded below sequence `f : ℕ → ℝ` has a finite limit. -/
308-
theorem _root_.Real.tendsto_of_bddBelow_antitone {f : ℕ → ℝ} (h_bdd : BddBelow (range f))
309-
(h_ant : Antitone f) : ∃ r : ℝ, Tendsto f atTop (𝓝 r) :=
310-
⟨iInf f, Real.tendsto_ciInf_of_bddBelow_antitone h_bdd h_ant⟩
230+
theorem _root_.Real.tendsto_of_bddBelow_antitone {f : ℕ → ℝ} (h_bdd : BddBelow (Set.range f))
231+
(h_ant : Antitone f) : ∃ r : ℝ, Tendsto f atTop (𝓝 r) := by
232+
obtain ⟨B, hB⟩ := Real.exists_isGLB (Set.range_nonempty f) h_bdd
233+
exact ⟨B, tendsto_atTop_isGLB h_ant hB⟩
311234

312235
/-- An antitone sequence `f : ℕ → ℝ≥0` has a finite limit. -/
313236
theorem tendsto_of_antitone {f : ℕ → ℝ≥0} (h_ant : Antitone f) :

0 commit comments

Comments
 (0)