import OAI.Combinatorics.ListHadwiger.RecursiveDistricts namespace OAI namespace LinearListHadwiger.Recursion open SimpleGraph Finset Stage attribute [local instance] Classical.propDecidable variable {V : Type} [Fintype V] [DecidableEq V] theorem junction_groups (G : SimpleGraph V) {a p : ℕ} (ha : 1≤a) (r : Fin a → V) (n : Fin (2*p) → V) (e : (Fin p × Bool) ≃ Fin (2*p)) (H D : Finset V) (F U : Set V) (hHD : Disjoint H D) (R : RoleRouting G r n F (↑H:Set V) D U) (M : RootedCliqueModel G R.fresh) (hMH : ∀ i, M.branch i⊆(↑H:Set V)) (hc : KConnectedOn G D (65536*Fintype.card (Roles a (2*p)))) : ∃ C : (Fin a ⊕ Fin p) → Set V, (∀ i, (G.induce (C i)).Connected) ∧ (∀ i j, i≠j → Disjoint (C i) (C j)) ∧ (∀ i j, i≠j → ∃ v∈C (.inl i), ∃ w∈C (.inl j), G.Adj v w) ∧ (∀ i, r i∈C (.inl i)) ∧ (∀ q, n (e q)∈C (.inr q.1)) := by classical let owner : Roles a (2*p) → Fin a ⊕ Fin p := Sum.elim Sum.inl (Sum.elim (fun j => Sum.inr (e.symm j).1) Sum.inl) let start := roleStart r n R.fresh let target (o : Roles a (2*p)) := (R.target o).val have htar : Function.Injective target := Subtype.val_injective.comp R.target_injective have hs : Function.Surjective owner := by intro i cases i with | inl i => exact ⟨.inl i,rfl⟩ | inr i => exact ⟨.inr (.inl (e (i,false))),by simp [owner]⟩ have hcpos : 1≤Fintype.card (Roles a (2*p)) := by simp only [Roles,Fintype.card_sum,Fintype.card_fin]; omega obtain ⟨E,hE,hEE,hED,htE⟩ := grouped_ends G D target htar (fun o => (R.target o).property) owner hs hcpos hc let B : Roles a (2*p) → Set V := Sum.elim (fun i => {r i}) (Sum.elim (fun j => {n j}) M.branch) have hB (o) : (G.induce (B o)).Connected := by rcases o with i|(j|i) · change (G.induce ({r i}:Set V)).Connected have : Nonempty ({r i}:Set V) := ⟨⟨r i,rfl⟩⟩ exact Connected.of_subsingleton · change (G.induce ({n j}:Set V)).Connected have : Nonempty ({n j}:Set V) := ⟨⟨n j,rfl⟩⟩ exact Connected.of_subsingleton · exact M.connected i have hxB (o) : start o∈B o := by rcases o with i|(j|i) · rfl · rfl · exact M.root_mem i have hBP (o q) (hne : owner o≠owner q) : Disjoint (B o) {v | v∈(R.route q).val.support} := by apply Set.disjoint_left.mpr intro v hv hw rcases o with i|(j|i) · have he : v=r i := hv subst v have hneq : Sum.inl i≠q := fun h => hne (congrArg owner h) exact Set.disjoint_left.mp (R.disjoint _ _ hneq) (R.route (.inl i)).val.start_mem_support hw · have he : v=n j := hv subst v have hneq : Sum.inr (Sum.inl j)≠q := fun h => hne (congrArg owner h) exact Set.disjoint_left.mp (R.disjoint _ _ hneq) (R.route (.inr (.inl j))).val.start_mem_support hw · obtain ⟨j,rfl,hv'⟩ := R.new_only q v hw (hMH i hv) have hij : i≠j := by intro h; subst j; exact hne rfl exact Set.disjoint_left.mp (M.disjoint i j hij) hv (hv'.symm ▸ M.root_mem j) have hBB (o q) (hne : owner o≠owner q) : Disjoint (B o) (B q) := by apply Set.disjoint_left.mpr intro v hv hw rcases q with j|(j|j) · have he : v=r j := hw exact Set.disjoint_left.mp (hBP o (.inl j) hne) hv (he.symm ▸ (R.route (.inl j)).val.start_mem_support) · have he : v=n j := hw exact Set.disjoint_left.mp (hBP o (.inr (.inl j)) hne) hv (he.symm ▸ (R.route (.inr (.inl j))).val.start_mem_support) · rcases o with i|(i|i) · have he : v=r i := hv exact Set.disjoint_left.mp (hBP (.inr (.inr j)) (.inl i) (Ne.symm hne)) hw (he.symm ▸ (R.route (.inl i)).val.start_mem_support) · have he : v=n i := hv exact Set.disjoint_left.mp (hBP (.inr (.inr j)) (.inr (.inl i)) (Ne.symm hne)) hw (he.symm ▸ (R.route (.inr (.inl i))).val.start_mem_support) · exact Set.disjoint_left.mp (M.disjoint i j (fun h => hne (congrArg Sum.inl h))) hv hw have hEP (i o) (hne : i≠owner o) : Disjoint (E i) {v | v∈(R.route o).val.support} := by apply Set.disjoint_left.mpr intro v hv hw have he := R.target_only o v hw (hED i hv) exact Set.disjoint_left.mp (hEE i (owner o) hne) hv (he.symm ▸ htE o) have hEB (i o) (hne : i≠owner o) : Disjoint (E i) (B o) := by apply Set.disjoint_left.mpr intro v hv hw rcases o with j|(j|j) · have he : v=r j := hw exact Set.disjoint_left.mp (hEP i (.inl j) hne) hv (he.symm ▸ (R.route (.inl j)).val.start_mem_support) · have he : v=n j := hw exact Set.disjoint_left.mp (hEP i (.inr (.inl j)) hne) hv (he.symm ▸ (R.route (.inr (.inl j))).val.start_mem_support) · exact Finset.disjoint_left.mp hHD (hMH j hw) (hED i hv) let C := extended E B owner start target R.route have hC (i) : (G.induce (C i)).Connected := extended_connected E B owner start target R.route hE hB hxB htE i have hCC : ∀ i j, i≠j → Disjoint (C i) (C j) := extended_disjoint E B owner start target R.route hEE hBB hEB hEP hBP (fun o q hne => R.disjoint o q (fun h => hne (congrArg owner h))) have hBC (o) : B o⊆C (owner o) := fun _ hv => Or.inr ⟨o,rfl,Or.inl hv⟩ refine ⟨C,hC,hCC,?_,fun i => hBC (.inl i) rfl,?_⟩ · intro i j hij obtain ⟨v,hv,w,hw,he⟩ := M.adjacent i j hij exact ⟨v,hBC (.inr (.inr i)) hv,w,hBC (.inr (.inr j)) hw,he⟩ · intro q have hmem := hBC (.inr (.inl (e q))) rfl simpa only [owner,Sum.elim_inr,Sum.elim_inl,e.symm_apply_apply] using hmem end LinearListHadwiger.Recursion namespace LinearListHadwiger.Recursion open Finset Stage Footprint SmallList Filter open scoped Topology attribute [local instance] Classical.propDecidable variable {V : Type} [Fintype V] [DecidableEq V] lemma outer_size_cutoff : ∃ T : ℕ, ∀ t : ℕ, T≤t → (t:ℝ)^(53/50:ℝ)+(t:ℝ)≤(t:ℝ)^(11/10:ℝ) := by have he : ∀ᶠ x : ℝ in atTop, 1≤x ∧ 2≤x^(1/25:ℝ) := (eventually_ge_atTop 1).and ((tendsto_rpow_atTop (by norm_num : (0:ℝ)<1/25)).eventually (eventually_ge_atTop 2)) obtain ⟨S,hS⟩ := (eventually_atTop.mp he) refine ⟨⌈S⌉₊,fun t ht => ?_⟩ obtain ⟨h1,h2⟩ := hS t ((Nat.le_ceil S).trans (by exact_mod_cast ht)) have hle : (t:ℝ)≤(t:ℝ)^(53/50:ℝ) := by simpa using Real.rpow_le_rpow_of_exponent_le h1 (by norm_num : (1:ℝ)≤53/50) have heq : (t:ℝ)^(11/10:ℝ)=(t:ℝ)^(53/50:ℝ)*(t:ℝ)^(1/25:ℝ) := by rw [←Real.rpow_add (by positivity : (0:ℝ) mem_sdiff.mpr ⟨mem_univ _,fun hz => disjoint_left.mp hZH hz hv⟩ have hcc : KConnectedOn G (univ\Z) (2*a) := by exact Knitting.kConnected_mono (Knitting.delete_connected G hc (subset_univ Z) (by omega)) (by omega) obtain ⟨Q⟩ := Second.exists_in_region (univ\Z) (univ\Z) H J (2*a) (Subset.refl _) hHsub hJS hcc (by have := hHc.1; dsimp [K₀] at this; omega) (by have := hJc.1; dsimp [K₀] at this; omega) have hF : univ\(univ.image r\univ.image r)=(univ:Finset V) := by simp have hRu : R.domain=univ\(univ.image r\univ.image r) := by rwa [hF] obtain ⟨routing⟩ := combine_systems (univ.image r) H J r n hr hn hrn (fun i => mem_image.mpr ⟨i,mem_univ _,rfl⟩) hZH hZJ hJH.symm R hRu P hPR hRH Q refine Or.inl ⟨H,J,_,⟨routing⟩,hJH.symm,hHc,hJc,?_⟩ change listChromaticNumber G≤ell G (univ\(X∪Y))+c*(64*a) at hloss dsimp [c] at hloss nlinarith end LinearListHadwiger.Recursion end OAI