/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/importFormalConjecturesUtil
[Er87] Erdős, Paul, Problems and results on set systems and hypergraphs. Extremal problems
for finite sets (Visegrád, 1991), Bolyai Soc. Math. Stud. (1994), 217-227.
[Fo70] Folkman, Jon, Graphs with monochromatic complete subgraphs in every edge coloring.
SIAM J. Appl. Math. (1970), 19:340-345.
[NeRo75] Nešetřil, Jaroslav and Rödl, Vojtěch, Type theory of partition problems of graphs.
Recent advances in graph theory (Proc. Second Czechoslovak Sympos., Prague, 1974),
Academia, Prague (1975), 405-412.
Folkman–Nešetřil–Rödl (finite version) [Fo70, NeRo75]: For every n ≥ 1, there exists a
graph G (on a finite vertex set) that contains no $K_4$ and whose edges cannot be covered by
n triangle-free graphs.
More precisely: for every n : ℕ with 1 ≤ n, there exist a finite type V and a graph
G : SimpleGraph V with:
G.CliqueFree 4 (no $K_4$), and
For every family H : Fin n → SimpleGraph V of triangle-free graphs, G ≠ ⨆ i, H i.
This is the finite analogue of Problem 595. The proofs of Folkman [Fo70] and Nešetřil–Rödl
[NeRo75] give different explicit constructions.
@[categoryresearchsolved,AMS5]theoremerdos_595.variants.folkman_finite:answer(True)↔∀n:ℕ,1≤n→∃(V:Type*)(_:FintypeV)(G:SimpleGraphV),G.CliqueFree4∧∀(H:Finn→SimpleGraphV),(∀i,(Hi).CliqueFree3)→G≠⨆i,Hi:=⊢ True↔∀(n:ℕ),1≤n→∃VxG,G.CliqueFree4∧∀(H:Finn→SimpleGraphV),(∀(i:Finn),(Hi).CliqueFree3)→G≠⨆i,Hi-- Folkman [Fo70] and Nešetřil–Rödl [NeRo75]: explicit construction exists.All goals completed! 🐙
Monotonicity: If G is a countable union of triangle-free graphs and H ≤ G (i.e., H is
a subgraph of G), then H is also a countable union of triangle-free graphs.
Proof: If G = ⨆ i, G_i with each G_i triangle-free, then H = ⨆ i, H ⊓ G_i.
Each H ⊓ G_i is triangle-free because it is a subgraph of G_i.
Triangle-free graphs are trivially countable unions of triangle-free graphs: if G is
already triangle-free, then G = ⨆ i : ℕ, G_i where G_0 = G and G_i = ⊥ for i ≥ 1.
The complete graph ⊤ on ℕ is a countable union of triangle-free graphs: we decompose
it into the family of star graphs {H_m}_{m : ℕ}, where H_m is the graph with edges {m, n}
for all n ≠ m. Each star is triangle-free (any two non-center vertices share no edge within
the star), and their union covers all edges of ⊤.
Proof sketch (star triangle-free): If {a, b, c} were a triangle in H_m, then each of
the three edges {a, b}, {a, c}, {b, c} would pass through m. In particular, from
{a, b} we get a = m or b = m; from {b, c} we get b = m or c = m. Case analysis
shows that two vertices must equal m, contradicting the triangle having three distinct vertices.
@[categorytextbook,AMS5]theoremerdos_595.variants.complete_nat_is_union:IsCountableUnionOfTriangleFree(⊤:SimpleGraphℕ):=by⊢ IsCountableUnionOfTriangleFree⊤-- Star at m: edges are all {a, b} where a = m or b = m (and a ≠ b, by SimpleGraph.fromRel).refine⟨funm=>SimpleGraph.fromRel(fun(ab:ℕ)=>a=m∨b=m),funm=>?_,?_⟩refine_1m:ℕ⊢ ((funm↦fromRelfunab↦a=m∨b=m)m).CliqueFree3refine_2⊢ ⊤=⨆i,(funm↦fromRelfunab↦a=m∨b=m)i·refine_1m:ℕ⊢ ((funm↦fromRelfunab↦a=m∨b=m)m).CliqueFree3-- Each star H_m is triangle-free.rw[CliqueFreerefine_1m:ℕ⊢ ∀(t:Finsetℕ),¬((funm↦fromRelfunab↦a=m∨b=m)m).IsNClique3trefine_1m:ℕ⊢ ∀(t:Finsetℕ),¬((funm↦fromRelfunab↦a=m∨b=m)m).IsNClique3t]refine_1m:ℕ⊢ ∀(t:Finsetℕ),¬((funm↦fromRelfunab↦a=m∨b=m)m).IsNClique3tintroshsrefine_1m:ℕs:Finsetℕhs:((funm↦fromRelfunab↦a=m∨b=m)m).IsNClique3s⊢ Falsesimponly[isNClique_iff]athsrefine_1m:ℕs:Finsetℕhs:(fromRelfunab↦a=m∨b=m).IsClique↑s∧s.card=3⊢ Falseobtain⟨hs_clique,hs_card⟩:=hsrefine_1m:ℕs:Finsetℕhs_clique:(fromRelfunab↦a=m∨b=m).IsClique↑shs_card:s.card=3⊢ Falserw[isClique_iffrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3⊢ Falserefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3⊢ False]aths_cliquerefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3⊢ Falseobtain⟨a,b,c,hab,hac,hbc,hs_eq⟩:=Finset.card_eq_three.mphs_cardrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}⊢ False-- Extract membership in s.haveha:a∈s:=hs_eq▸Finset.mem_insert_selfa_refine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈s⊢ Falsehavehb:b∈s:=hs_eq▸Finset.mem_insert.mpr(Or.inr(Finset.mem_insert_selfb_))refine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈s⊢ Falsehavehc:c∈s:=hs_eq▸Finset.mem_insert.mpr(Or.inr(Finset.mem_insert.mpr(Or.inr(Finset.mem_singleton_selfc))))refine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈s⊢ False-- Each pair is adjacent in H_m.havehab_adj:=hs_cliquehahbhabrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shab_adj:(fromRelfunab↦a=m∨b=m).Adjab⊢ Falsehavehac_adj:=hs_cliquehahchacrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shab_adj:(fromRelfunab↦a=m∨b=m).Adjabhac_adj:(fromRelfunab↦a=m∨b=m).Adjac⊢ Falsehavehbc_adj:=hs_cliquehbhchbcrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shab_adj:(fromRelfunab↦a=m∨b=m).Adjabhac_adj:(fromRelfunab↦a=m∨b=m).Adjachbc_adj:(fromRelfunab↦a=m∨b=m).Adjbc⊢ False-- fromRel_adj: (fromRel r).Adj x y ↔ x ≠ y ∧ (r x y ∨ r y x)-- For r x y = (x = m ∨ y = m): r x y ∨ r y x simplifies to x = m ∨ y = m.simponly[fromRel_adj]athab_adjhac_adjhbc_adjrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shab_adj:a≠b∧((a=m∨b=m)∨b=m∨a=m)hac_adj:a≠c∧((a=m∨c=m)∨c=m∨a=m)hbc_adj:b≠c∧((b=m∨c=m)∨c=m∨b=m)⊢ False-- Extract "a = m or b = m", "a = m or c = m", "b = m or c = m".haveham_or_bm:a=m∨b=m:=hab_adj.2.elimidOr.symmrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shab_adj:a≠b∧((a=m∨b=m)∨b=m∨a=m)hac_adj:a≠c∧((a=m∨c=m)∨c=m∨a=m)hbc_adj:b≠c∧((b=m∨c=m)∨c=m∨b=m)ham_or_bm:a=m∨b=m⊢ Falsehaveham_or_cm:a=m∨c=m:=hac_adj.2.elimidOr.symmrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shab_adj:a≠b∧((a=m∨b=m)∨b=m∨a=m)hac_adj:a≠c∧((a=m∨c=m)∨c=m∨a=m)hbc_adj:b≠c∧((b=m∨c=m)∨c=m∨b=m)ham_or_bm:a=m∨b=mham_or_cm:a=m∨c=m⊢ Falsehavehbm_or_cm:b=m∨c=m:=hbc_adj.2.elimidOr.symmrefine_1m:ℕs:Finsetℕhs_clique:(↑s).Pairwise(fromRelfunab↦a=m∨b=m).Adjhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shab_adj:a≠b∧((a=m∨b=m)∨b=m∨a=m)hac_adj:a≠c∧((a=m∨c=m)∨c=m∨a=m)hbc_adj:b≠c∧((b=m∨c=m)∨c=m∨b=m)ham_or_bm:a=m∨b=mham_or_cm:a=m∨c=mhbm_or_cm:b=m∨c=m⊢ False-- Case analysis: whichever vertex equals m forces another to equal m as well,-- contradicting distinctness.rcasesham_or_bmwithrfl|rflrefine_1.inls:Finsetℕhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shs_clique:(↑s).Pairwise(fromRelfuna_1b↦a_1=a∨b=a).Adjhab_adj:a≠b∧((a=a∨b=a)∨b=a∨a=a)hac_adj:a≠c∧((a=a∨c=a)∨c=a∨a=a)hbc_adj:b≠c∧((b=a∨c=a)∨c=a∨b=a)ham_or_cm:a=a∨c=ahbm_or_cm:b=a∨c=a⊢ Falserefine_1.inrs:Finsetℕhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shs_clique:(↑s).Pairwise(fromRelfunab_1↦a=b∨b_1=b).Adjhab_adj:a≠b∧((a=b∨b=b)∨b=b∨a=b)hac_adj:a≠c∧((a=b∨c=b)∨c=b∨a=b)hbc_adj:b≠c∧((b=b∨c=b)∨c=b∨b=b)ham_or_cm:a=b∨c=bhbm_or_cm:b=b∨c=b⊢ False·refine_1.inls:Finsetℕhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shs_clique:(↑s).Pairwise(fromRelfuna_1b↦a_1=a∨b=a).Adjhab_adj:a≠b∧((a=a∨b=a)∨b=a∨a=a)hac_adj:a≠c∧((a=a∨c=a)∨c=a∨a=a)hbc_adj:b≠c∧((b=a∨c=a)∨c=a∨b=a)ham_or_cm:a=a∨c=ahbm_or_cm:b=a∨c=a⊢ False-- a = mrcaseshbm_or_cmwithrfl|rflrefine_1.inl.inls:Finsetℕhs_card:s.card=3b:ℕc:ℕhbc:b≠chb:b∈shc:c∈shab:b≠bhac:b≠chs_eq:s={b,b,c}ha:b∈shs_clique:(↑s).Pairwise(fromRelfunab_1↦a=b∨b_1=b).Adjhab_adj:b≠b∧((b=b∨b=b)∨b=b∨b=b)hac_adj:b≠c∧((b=b∨c=b)∨c=b∨b=b)hbc_adj:b≠c∧((b=b∨c=b)∨c=b∨b=b)ham_or_cm:b=b∨c=b⊢ Falserefine_1.inl.inrs:Finsetℕhs_card:s.card=3b:ℕc:ℕhbc:b≠chb:b∈shc:c∈shab:c≠bhac:c≠chs_eq:s={c,b,c}ha:c∈shs_clique:(↑s).Pairwise(fromRelfunab↦a=c∨b=c).Adjhab_adj:c≠b∧((c=c∨b=c)∨b=c∨c=c)hac_adj:c≠c∧((c=c∨c=c)∨c=c∨c=c)hbc_adj:b≠c∧((b=c∨c=c)∨c=c∨b=c)ham_or_cm:c=c∨c=c⊢ False·refine_1.inl.inls:Finsetℕhs_card:s.card=3b:ℕc:ℕhbc:b≠chb:b∈shc:c∈shab:b≠bhac:b≠chs_eq:s={b,b,c}ha:b∈shs_clique:(↑s).Pairwise(fromRelfunab_1↦a=b∨b_1=b).Adjhab_adj:b≠b∧((b=b∨b=b)∨b=b∨b=b)hac_adj:b≠c∧((b=b∨c=b)∨c=b∨b=b)hbc_adj:b≠c∧((b=b∨c=b)∨c=b∨b=b)ham_or_cm:b=b∨c=b⊢ FalseexactabsurdrflhabAll goals completed! 🐙-- b = a = m·refine_1.inl.inrs:Finsetℕhs_card:s.card=3b:ℕc:ℕhbc:b≠chb:b∈shc:c∈shab:c≠bhac:c≠chs_eq:s={c,b,c}ha:c∈shs_clique:(↑s).Pairwise(fromRelfunab↦a=c∨b=c).Adjhab_adj:c≠b∧((c=c∨b=c)∨b=c∨c=c)hac_adj:c≠c∧((c=c∨c=c)∨c=c∨c=c)hbc_adj:b≠c∧((b=c∨c=c)∨c=c∨b=c)ham_or_cm:c=c∨c=c⊢ FalseexactabsurdrflhacAll goals completed! 🐙-- c = a = m·refine_1.inrs:Finsetℕhs_card:s.card=3a:ℕb:ℕc:ℕhab:a≠bhac:a≠chbc:b≠chs_eq:s={a,b,c}ha:a∈shb:b∈shc:c∈shs_clique:(↑s).Pairwise(fromRelfunab_1↦a=b∨b_1=b).Adjhab_adj:a≠b∧((a=b∨b=b)∨b=b∨a=b)hac_adj:a≠c∧((a=b∨c=b)∨c=b∨a=b)hbc_adj:b≠c∧((b=b∨c=b)∨c=b∨b=b)ham_or_cm:a=b∨c=bhbm_or_cm:b=b∨c=b⊢ False-- b = mrcasesham_or_cmwithrfl|rflrefine_1.inr.inls:Finsetℕhs_card:s.card=3a:ℕc:ℕhac:a≠cha:a∈shc:c∈shab:a≠ahbc:a≠chs_eq:s={a,a,c}hb:a∈shs_clique:(↑s).Pairwise(fromRelfuna_1b↦a_1=a∨b=a).Adjhab_adj:a≠a∧((a=a∨a=a)∨a=a∨a=a)hac_adj:a≠c∧((a=a∨c=a)∨c=a∨a=a)hbc_adj:a≠c∧((a=a∨c=a)∨c=a∨a=a)hbm_or_cm:a=a∨c=a⊢ Falserefine_1.inr.inrs:Finsetℕhs_card:s.card=3a:ℕc:ℕhac:a≠cha:a∈shc:c∈shab:a≠chbc:c≠chs_eq:s={a,c,c}hb:c∈shs_clique:(↑s).Pairwise(fromRelfunab↦a=c∨b=c).Adjhab_adj:a≠c∧((a=c∨c=c)∨c=c∨a=c)hac_adj:a≠c∧((a=c∨c=c)∨c=c∨a=c)hbc_adj:c≠c∧((c=c∨c=c)∨c=c∨c=c)hbm_or_cm:c=c∨c=c⊢ False·refine_1.inr.inls:Finsetℕhs_card:s.card=3a:ℕc:ℕhac:a≠cha:a∈shc:c∈shab:a≠ahbc:a≠chs_eq:s={a,a,c}hb:a∈shs_clique:(↑s).Pairwise(fromRelfuna_1b↦a_1=a∨b=a).Adjhab_adj:a≠a∧((a=a∨a=a)∨a=a∨a=a)hac_adj:a≠c∧((a=a∨c=a)∨c=a∨a=a)hbc_adj:a≠c∧((a=a∨c=a)∨c=a∨a=a)hbm_or_cm:a=a∨c=a⊢ Falseexacthab.symmrflAll goals completed! 🐙-- a = b = m, so a = m and b = m, contradiction·refine_1.inr.inrs:Finsetℕhs_card:s.card=3a:ℕc:ℕhac:a≠cha:a∈shc:c∈shab:a≠chbc:c≠chs_eq:s={a,c,c}hb:c∈shs_clique:(↑s).Pairwise(fromRelfunab↦a=c∨b=c).Adjhab_adj:a≠c∧((a=c∨c=c)∨c=c∨a=c)hac_adj:a≠c∧((a=c∨c=c)∨c=c∨a=c)hbc_adj:c≠c∧((c=c∨c=c)∨c=c∨c=c)hbm_or_cm:c=c∨c=c⊢ FalseexacthbcrflAll goals completed! 🐙-- c = b = m, so b = c, contradiction·refine_2⊢ ⊤=⨆i,(funm↦fromRelfunab↦a=m∨b=m)i-- The union ⨆ m, H_m equals ⊤.extabrefine_2a:ℕb:ℕ⊢ ⊤.Adjab↔(⨆i,(funm↦fromRelfunab↦a=m∨b=m)i).Adjabsimponly[iSup_adj,fromRel_adj,top_adj]refine_2a:ℕb:ℕ⊢ a≠b↔∃i,a≠b∧((a=i∨b=i)∨b=i∨a=i)-- Goal: a ≠ b ↔ ∃ m, a ≠ b ∧ ((a = m ∨ b = m) ∨ (b = m ∨ a = m))exact⟨funhab=>⟨a,hab,Or.inl(Or.inlrfl)⟩,fun⟨_,hne,_⟩=>hne⟩All goals completed! 🐙
The complete graph ⊤ on Fin 4 is not $K_4$-free: ⊤ on Fin 4 equals the complete
graph $K_4$, so it contains $K_4$ as a subgraph and is not $K_4$-free.
This sanity check confirms the $K_4$-free hypothesis of Problem 595 is non-trivial.
Reformulation via edge colourings: A graph G is a countable union of triangle-free graphs
if and only if there is a colouring of the edges of G by ℕ such that no monochromatic
triangle exists.
More precisely: IsCountableUnionOfTriangleFree G is equivalent to the existence of a map
c : G.edgeSet → ℕ such that for each n : ℕ, the subgraph of edges coloured n is triangle-free.
@[categorytest,AMS5]theoremerdos_595.variants.reformulation_edge_colouring{V:Type*}(G:SimpleGraphV):IsCountableUnionOfTriangleFreeG↔∃c:G.edgeSet→ℕ,∀n:ℕ,(SimpleGraph.fromEdgeSet{e|∃h:e∈G.edgeSet,c⟨e,h⟩=n}).CliqueFree3:=byV:Type u_1G:SimpleGraphV⊢ IsCountableUnionOfTriangleFreeG↔∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3-- Note: `c : G.edgeSet → ℕ` is exactly `EdgeLabeling G ℕ`, and the `fromEdgeSet` expression-- is exactly `EdgeLabeling.labelGraph c n`. We use `EdgeLabeling.iSup_labelGraph` for (←).constructormpV:Type u_1G:SimpleGraphV⊢ IsCountableUnionOfTriangleFreeG→∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3mprV:Type u_1G:SimpleGraphV⊢ (∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3)→IsCountableUnionOfTriangleFreeG·mpV:Type u_1G:SimpleGraphV⊢ IsCountableUnionOfTriangleFreeG→∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3-- (→): Given H : ℕ → SimpleGraph V with G = ⨆ H i and each H i triangle-free,-- construct c : G.edgeSet → ℕ by choosing some i containing each edge classically.rintro⟨H,hH_free,hH_eq⟩mpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hi⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3-- For each edge e = s(a,b) of G, use iSup_adj to find some H i containing it.-- We use Sym2.ind to destructure e into s(a,b) form and then apply mem_edgeSet + iSup_adj.havehcov:∀e:G.edgeSet,∃i,(e:Sym2V)∈(Hi).edgeSet:=fun⟨e,he⟩=>Sym2.ind(funabhe=>byV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝:e∈G.edgeSeta:Vb:Vhe:s(a,b)∈G.edgeSet⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSet⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3rw[hH_eq,V:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝¹:e∈G.edgeSeta:Vb:Vhe✝:s(a,b)∈G.edgeSethe:s(a,b)∈(⨆i,Hi).edgeSet⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝¹:e∈G.edgeSeta:Vb:Vhe✝:s(a,b)∈G.edgeSethe:∃i,(Hi).Adjab⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSet⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3mem_edgeSet,V:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝¹:e∈G.edgeSeta:Vb:Vhe✝:s(a,b)∈G.edgeSethe:(⨆i,Hi).Adjab⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝¹:e∈G.edgeSeta:Vb:Vhe✝:s(a,b)∈G.edgeSethe:∃i,(Hi).Adjab⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSet⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3iSup_adjV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝¹:e∈G.edgeSeta:Vb:Vhe✝:s(a,b)∈G.edgeSethe:∃i,(Hi).Adjab⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝¹:e∈G.edgeSeta:Vb:Vhe✝:s(a,b)∈G.edgeSethe:∃i,(Hi).Adjab⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSet⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3]atheV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hix✝:↑G.edgeSete:Sym2Vhe✝¹:e∈G.edgeSeta:Vb:Vhe✝:s(a,b)∈G.edgeSethe:∃i,(Hi).Adjab⊢ ∃i,↑⟨s(a,b),he⟩∈(Hi).edgeSetmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSet⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3exacthe.impfunihi=>hiAll goals completed! 🐙mpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSet⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3)ehempV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSet⊢ ∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3-- Define c by classical choice of the covering index.refine⟨fune=>(hcove).choose,funn=>?_⟩mpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕ⊢ (fromEdgeSet{e|∃(h:e∈G.edgeSet),(fune↦⋯.choose)⟨e,h⟩=n}).CliqueFree3-- Show the subgraph of edges coloured n is a subgraph of H n, hence triangle-free.apply(hH_freen).antimpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕ⊢ fromEdgeSet{e|∃(h:e∈G.edgeSet),(fune↦⋯.choose)⟨e,h⟩=n}≤HnintroxyhxympV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕx:Vy:Vhxy:(fromEdgeSet{e|∃(h:e∈G.edgeSet),(fune↦⋯.choose)⟨e,h⟩=n}).Adjxy⊢ (Hn).Adjxyrw[fromEdgeSet_adjmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕx:Vy:Vhxy:s(x,y)∈{e|∃(h:e∈G.edgeSet),(fune↦⋯.choose)⟨e,h⟩=n}∧x≠y⊢ (Hn).AdjxympV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕx:Vy:Vhxy:s(x,y)∈{e|∃(h:e∈G.edgeSet),(fune↦⋯.choose)⟨e,h⟩=n}∧x≠y⊢ (Hn).Adjxy]athxympV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕx:Vy:Vhxy:s(x,y)∈{e|∃(h:e∈G.edgeSet),(fune↦⋯.choose)⟨e,h⟩=n}∧x≠y⊢ (Hn).Adjxyobtain⟨⟨h_mem,h_eq⟩,_⟩:=hxympV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕx:Vy:Vright✝:x≠yh_mem:s(x,y)∈G.edgeSeth_eq:(fune↦⋯.choose)⟨s(x,y),h_mem⟩=n⊢ (Hn).Adjxy-- h_eq : (hcov ⟨s(x,y), h_mem⟩).choose = n-- choose_spec gives s(x,y) ∈ (H (choose)).edgeSet; after rewriting with h_eq, in H n.havehspec:=(hcov⟨s(x,y),h_mem⟩).choose_specmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕx:Vy:Vright✝:x≠yh_mem:s(x,y)∈G.edgeSeth_eq:(fune↦⋯.choose)⟨s(x,y),h_mem⟩=nhspec:↑⟨s(x,y),h_mem⟩∈(H⋯.choose).edgeSet⊢ (Hn).Adjxysimponly[h_eq]athspecmpV:Type u_1G:SimpleGraphVH:ℕ→SimpleGraphVhH_free:∀(i:ℕ),(Hi).CliqueFree3hH_eq:G=⨆i,Hihcov:∀(e:↑G.edgeSet),∃i,↑e∈(Hi).edgeSetn:ℕx:Vy:Vright✝:x≠yh_mem:s(x,y)∈G.edgeSeth_eq:(fune↦⋯.choose)⟨s(x,y),h_mem⟩=nhspec:s(x,y)∈(Hn).edgeSet⊢ (Hn).AdjxyexacthspecAll goals completed! 🐙·mprV:Type u_1G:SimpleGraphV⊢ (∃c,∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3)→IsCountableUnionOfTriangleFreeG-- (←): Given c : G.edgeSet → ℕ, define H n = fromEdgeSet {e | ∃ h, c ⟨e,h⟩ = n}.-- This is EdgeLabeling.labelGraph c n, so ⨆ n, H n = G by iSup_labelGraph.rintro⟨c,hc⟩mprV:Type u_1G:SimpleGraphVc:↑G.edgeSet→ℕhc:∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3⊢ IsCountableUnionOfTriangleFreeGrefine⟨funn=>SimpleGraph.fromEdgeSet{e|∃h:e∈G.edgeSet,c⟨e,h⟩=n},hc,?_⟩mprV:Type u_1G:SimpleGraphVc:↑G.edgeSet→ℕhc:∀(n:ℕ),(fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n}).CliqueFree3⊢ G=⨆i,(funn↦fromEdgeSet{e|∃(h:e∈G.edgeSet),c⟨e,h⟩=n})i-- G = ⨆ n, (labelGraph c n) follows from EdgeLabeling.iSup_labelGraph.exact(EdgeLabeling.iSup_labelGraph(G:=G)c).symmAll goals completed! 🐙endErdos595