Download data/lean/OAI/Combinatorics/GraphThreshold/GraphCopies.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.65 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/GraphCopies.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/GraphThreshold/GraphCopies.lean
-
curl -L -o GraphCopies.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/GraphCopies.lean
4.65 kB
| import OAI.Combinatorics.GraphThreshold.GraphSupport | |
| import OAI.Combinatorics.GraphThreshold.GraphProbability | |
| import OAI.Combinatorics.GraphThreshold.CopyOrbits | |
| import OAI.Combinatorics.GraphThreshold.GraphExpectedCopies | |
| namespace OAI | |
| noncomputable section | |
| open scoped Pointwise | |
| namespace LeanBlast.SecondKahnKalai | |
| variable {n : β} | |
| theorem mem_copyOrbit_iff_edgeSupportGraph_iso {S T : Finset (Edge n)} : | |
| T β copyOrbit (Equiv.Perm (Fin n)) S β | |
| Nonempty (edgeSupportGraph S βg edgeSupportGraph T) := by | |
| rw [mem_copyOrbit_iff] | |
| constructor | |
| Β· rintro β¨Ο, rflβ© | |
| exact β¨edgeSupportGraph_smulIso Ο Sβ© | |
| Β· rintro β¨eβ© | |
| exact exists_smul_eq_of_edgeSupportGraph_iso e | |
| /-- Distinct edge orbits correspond bijectively to actual unlabelled subgraphs. | |
| The target has no isolated vertices, so its image subgraph is uniquely determined | |
| by its edges. This also covers the empty graph, with its empty vertex set. -/ | |
| def orbitSubgraphEquiv (S : Finset (Edge n)) : | |
| OrbitCopy (Equiv.Perm (Fin n)) S β | |
| {K : (β€ : SimpleGraph (Fin n)).Subgraph // | |
| Nonempty (edgeSupportGraph S βg K.coe)} where | |
| toFun T := β¨edgeSubgraph T.val, mem_copyOrbit_iff_edgeSupportGraph_iso.mp T.propertyβ© | |
| invFun K := β¨graphEdges K.val.spanningCoe, by | |
| apply mem_copyOrbit_iff_edgeSupportGraph_iso.mpr | |
| obtain β¨eβ© := K.property | |
| have hK := subgraph_eq_edgeSubgraph_of_iso K.val e | |
| change Nonempty (edgeSupportGraph S βg (edgeSubgraph _).coe) | |
| rw [β hK] | |
| exact β¨eβ©β© | |
| left_inv T := by | |
| apply Subtype.ext | |
| exact graphEdges_graphOfEdges T.val | |
| right_inv K := by | |
| apply Subtype.ext | |
| exact (subgraph_eq_edgeSubgraph_of_iso K.val K.property.some).symm | |
| theorem orbitCount_eq_copyCount (S : Finset (Edge n)) : | |
| orbitCount (Equiv.Perm (Fin n)) S = | |
| (β€ : SimpleGraph (Fin n)).copyCount (edgeSupportGraph S) := by | |
| classical | |
| calc | |
| orbitCount (Equiv.Perm (Fin n)) S = | |
| Fintype.card (OrbitCopy (Equiv.Perm (Fin n)) S) := (card_OrbitCopy _ _).symm | |
| _ = Fintype.card {K : (β€ : SimpleGraph (Fin n)).Subgraph // | |
| Nonempty (edgeSupportGraph S βg K.coe)} := Fintype.card_congr (orbitSubgraphEquiv S) | |
| _ = _ := by | |
| rw [SimpleGraph.copyCount, Fintype.card_subtype] | |
| apply congrArg Finset.card | |
| ext K | |
| simp only [Finset.mem_filter, Finset.mem_univ, true_and] | |
| theorem expectedCopies_edgeSupportGraph (p : β) (S : Finset (Edge n)) : | |
| expectedCopies n p (edgeSupportGraph S) = | |
| (orbitCount (Equiv.Perm (Fin n)) S : β) * p ^ S.card := by | |
| rw [expectedCopies_formula, edgeCount_edgeSupportGraph, orbitCount_eq_copyCount] | |
| /-- The internal orbit constraint follows from an actual subgraph constraint | |
| of the public expectation threshold, with no multiplicity factor. -/ | |
| theorem orbit_expectation_constraint {V : Type*} (f : V βͺ Fin n) | |
| (H : SimpleGraph V) (q : β) | |
| (hq : β F : H.Subgraph, (1 / 2 : β) β€ expectedCopies n q F.coe) | |
| (S : Finset (Edge n)) (hS : S β graphEdges (H.map f)) : | |
| (1 / 2 : β) β€ (orbitCount (Equiv.Perm (Fin n)) S : β) * q ^ S.card := by | |
| obtain β¨F, β¨eβ©β© := exists_subgraph_iso_edgeSupportGraph f H S hS | |
| rw [β expectedCopies_edgeSupportGraph, expectedCopies_iso n q e] | |
| exact hq F | |
| theorem copyCount_pos_iff_orbit_subset {V : Type*} (f : V βͺ Fin n) | |
| (H : SimpleGraph V) (W : Finset (Edge n)) : | |
| 0 < (graphOfEdges W).copyCount H β | |
| β E β copyOrbit (Equiv.Perm (Fin n)) (graphEdges (H.map f)), E β W := by | |
| rw [copyCount_pos_iff_exists_smul_subset f H W] | |
| constructor | |
| Β· rintro β¨Ο, hΟβ© | |
| exact β¨_, (mem_copyOrbit_iff _).mpr β¨Ο, rflβ©, hΟβ© | |
| Β· rintro β¨E, hE, hEWβ© | |
| obtain β¨Ο, rflβ© := (mem_copyOrbit_iff _).mp hE | |
| exact β¨Ο, hEWβ© | |
| theorem exists_graphRepresentationWithConstraints {V : Type*} [Fintype V] | |
| (n : β) (H : SimpleGraph V) (hcard : Fintype.card V β€ n) (q : β) | |
| (hq : β F : H.Subgraph, (1 / 2 : β) β€ expectedCopies n q F.coe) : | |
| β E : Finset (Edge n), E.card = edgeCount H β§ | |
| (β W : Finset (Edge n), | |
| (0 < (graphOfEdges W).copyCount H β | |
| β T β copyOrbit (Equiv.Perm (Fin n)) E, T β W)) β§ | |
| (β S : Finset (Edge n), S β E β | |
| (1 / 2 : β) β€ (orbitCount (Equiv.Perm (Fin n)) S : β) * q ^ S.card) := by | |
| obtain β¨fβ© := Function.Embedding.nonempty_of_card_le | |
| (show Fintype.card V β€ Fintype.card (Fin n) by simpa using hcard) | |
| exact β¨graphEdges (H.map f), card_mappedGraphEdges f H, | |
| copyCount_pos_iff_orbit_subset f H, orbit_expectation_constraint f H q hqβ© | |
| end LeanBlast.SecondKahnKalai | |
| end | |
| end OAI | |