Download data/lean/OAI/Combinatorics/CliqueFree/Main.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.45 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/CliqueFree/Main.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/CliqueFree/Main.lean
-
curl -L -o Main.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/CliqueFree/Main.lean
3.45 kB
| import OAI.Combinatorics.CliqueFree.MaxDegree | |
| namespace OAI | |
| noncomputable section | |
| open scoped BigOperators | |
| open Finset | |
| Classical.propDecidable | |
| namespace CliqueFreeLog | |
| open CliqueFreeIndependence.WeightedGraph | |
| lemma sum_degrees_real {V : Type*} [Fintype V] (G : SimpleGraph V) : | |
| (β v, (G.degree v : β)) = 2 * (G.edgeFinset.card : β) := by | |
| classical | |
| exact_mod_cast G.sum_degrees_eq_twice_card_edges | |
| /-- The logarithmic independence bound for ordinary clique exclusion and the graph's own | |
| average degree, with a constant uniform in graph size and average degree. -/ | |
| theorem logarithmic_independence_bound (r : β) (hr : 4 β€ r) : | |
| β c : β, 0 < c β§ | |
| β {V : Type} [Fintype V] (G : SimpleGraph V), | |
| G.CliqueFree r β 2 β€ averageDegree G β | |
| c * (Fintype.card V : β) * Real.log (averageDegree G) / averageDegree G β€ | |
| (G.indepNum : β) := by | |
| classical | |
| obtain β¨B,hB,htriβ© := exists_optimizer_triangle_bound.{0} (r-2) | |
| let D : β := 3+3*B/2 | |
| have hD : 0 < D := by dsimp [D]; positivity | |
| refine β¨1/(16*D),by positivity,?_β© | |
| intro V _ G hf hd | |
| let d : β := averageDegree G | |
| have hd2 : 2 β€ d := hd | |
| have hdpos : 0 < d := by linarith | |
| have hn : (Fintype.card V : β) β 0 := by | |
| intro hn | |
| have hz : averageDegree G = 0 := by simp [averageDegree,hn] | |
| rw [hz] at hd | |
| norm_num at hd | |
| have hsum : (β v, (G.degree v : β)) = (Fintype.card V : β)*d := by | |
| rw [sum_degrees_real] | |
| dsimp [d, averageDegree] | |
| field_simp | |
| let A : Finset V := univ.filter fun v β¦ (G.degree v : β) β€ 2*d | |
| have hAcard : (Fintype.card V : β)/2 β€ (Fintype.card (A : Set V) : β) := by | |
| have he : Fintype.card (A : Set V) = A.card := Fintype.card_coe A | |
| rw [he] | |
| exact degree_cutoff_card G hdpos hsum | |
| have hk : r-2+2 = r := Nat.sub_add_cancel (by omega) | |
| have hfree : (G.induce (A : Set V)).CliqueFree (r-2+2) := by | |
| rw [hk] | |
| exact (G.cliqueFree_induce_iff _ _).2 hf.cliqueFreeOn | |
| have hdeg (v : (A : Set V)) : ((G.induce (A : Set V)).degree v : β) β€ 2*d := by | |
| have hv : (G.degree v : β) β€ 2*d := (mem_filter.1 v.property).2 | |
| exact (Nat.cast_le.2 (degree_induce_le G A v)).trans hv | |
| have hmax := maximum_degree_independence (r-2) hB.le (by linarith : 3 β€ 2*d) | |
| htri (G.induce (A : Set V)) hfree hdeg | |
| have hi : ((G.induce (A : Set V)).indepNum : β) β€ G.indepNum := | |
| Nat.cast_le.2 (indepNum_induce_le G A) | |
| have hlog : Real.log d β€ Real.log (2*d) := | |
| Real.log_le_log hdpos (by linarith) | |
| have hlog0 : 0 β€ Real.log d := Real.log_nonneg (by linarith) | |
| have hnum : (Fintype.card V : β)*Real.log d/2 β€ | |
| (Fintype.card (A : Set V) : β)*Real.log (2*d) := by | |
| have h1 := mul_le_mul_of_nonneg_right hAcard hlog0 | |
| have h2 := mul_le_mul_of_nonneg_left hlog (Nat.cast_nonneg (Ξ± := β) (Fintype.card (A : Set V))) | |
| nlinarith | |
| have hden : 0 < 8*D*d := by positivity | |
| have hcompare := div_le_div_of_nonneg_right hnum hden.le | |
| change (Fintype.card (A : Set V) : β)*Real.log (2*d)/(4*D*(2*d)) β€ _ at hmax | |
| have heq : (1/(16*D))*(Fintype.card V : β)*Real.log d/d = | |
| ((Fintype.card V : β)*Real.log d/2)/(8*D*d) := by | |
| field_simp | |
| ring | |
| change (1/(16*D))*(Fintype.card V : β)*Real.log d/d β€ _ | |
| rw [heq] | |
| apply hcompare.trans | |
| have hdeneq : 8*D*d = 4*D*(2*d) := by ring | |
| rw [hdeneq] | |
| exact hmax.trans hi | |
| end CliqueFreeLog | |
| end | |
| end OAI | |