| | @@ -0,0 +1,57 @@ |
| 1 | +import Mathlib.Data.Fintype.BigOperators |
| 2 | + |
| 3 | +/-! |
| 4 | +# A lower bound for the sunflower threshold in Erdős problem 20 |
| 5 | + |
| 6 | +The graphs of all functions from `Fin n` to `Fin k` form the classical family of |
| 7 | +`k ^ n` transversals of `n` disjoint blocks of size `k`. |
| 8 | +-/ |
| 9 | + |
| 10 | +namespace ErdosSwarm.Erdos20 |
| 11 | + |
| 12 | +/-- For positive `k`, there are `k ^ n` distinct sets of size `n` with no sunflower of |
| 13 | +`k + 1` petals. -/ |
| 14 | +theorem exists_uniform_family_card_pow_no_sunflower (k n : ℕ) (hk : 1 ≤ k) : |
| 15 | + ∃ F : Finset (Finset (Fin n × Fin k)), (∀ A ∈ F, A.card = n) ∧ F.card = k ^ n ∧ |
| 16 | + ¬ ∃ G ⊆ F, G.card = k + 1 ∧ ∃ K : Finset (Fin n × Fin k), |
| 17 | + ∀ A ∈ G, ∀ B ∈ G, A ≠ B → A ∩ B = K := by |
| 18 | + classical |
| 19 | + let graph (f : Fin n → Fin k) : Finset (Fin n × Fin k) := |
| 20 | + Finset.univ.image fun i => (i, f i) |
| 21 | + have mem_graph (f : Fin n → Fin k) (i : Fin n) (v : Fin k) : |
| 22 | + (i, v) ∈ graph f ↔ f i = v := by simp [graph] |
| 23 | + have graph_inj : Function.Injective graph := by |
| 24 | + intro f g h |
| 25 | + funext i |
| 26 | + apply (mem_graph f i (g i)).mp |
| 27 | + rw [h, mem_graph] |
| 28 | + refine ⟨Finset.univ.image graph, ?_, ?_, ?_⟩ |
| 29 | + · intro A hA |
| 30 | + obtain ⟨f, _, rfl⟩ := Finset.mem_image.mp hA |
| 31 | + dsimp only [graph] |
| 32 | + rw [Finset.card_image_of_injective _ (fun _ _ h => congrArg Prod.fst h)] |
| 33 | + simp |
| 34 | + · rw [Finset.card_image_of_injective _ graph_inj] |
| 35 | + simp |
| 36 | + rintro ⟨G, hGF, hG, K, hK⟩ |
| 37 | + obtain ⟨T, rfl⟩ := Finset.subset_univ_image_iff.mp hGF |
| 38 | + rw [Finset.card_image_of_injective _ graph_inj] at hG |
| 39 | + have hpair {f g : Fin n → Fin k} (hf : f ∈ T) (hg : g ∈ T) (hfg : f ≠ g) : |
| 40 | + graph f ∩ graph g = K := |
| 41 | + hK _ (Finset.mem_image_of_mem _ hf) _ (Finset.mem_image_of_mem _ hg) |
| 42 | + (fun h => hfg (graph_inj h)) |
| 43 | + obtain ⟨f, hf, g, hg, hfg⟩ := Finset.one_lt_card.mp (show 1 < T.card by omega) |
| 44 | + apply hfg |
| 45 | + funext i |
| 46 | + -- At coordinate i two petals agree. Their shared point lies in the kernel, |
| 47 | + -- so it belongs to both of the chosen graphs as well. |
| 48 | + have hlarge : (Finset.univ : Finset (Fin k)).card < T.card := by simp [hG] |
| 49 | + obtain ⟨a, ha, b, hb, hab, hi⟩ := Finset.exists_ne_map_eq_of_card_lt_of_maps_to |
| 50 | + (f := fun u : Fin n → Fin k => u i) hlarge (fun _ _ => Finset.mem_univ _) |
| 51 | + have hmem : (i, a i) ∈ graph f ∩ graph g := by |
| 52 | + rw [hpair hf hg hfg, ← hpair ha hb hab] |
| 53 | + exact Finset.mem_inter.mpr ⟨(mem_graph ..).mpr rfl, (mem_graph ..).mpr hi.symm⟩ |
| 54 | + simp only [Finset.mem_inter, mem_graph] at hmem |
| 55 | + exact hmem.1.trans hmem.2.symm |
| 56 | + |
| 57 | +end ErdosSwarm.Erdos20 |