Download data/lean/OAI/Combinatorics/MatrixRemoval/HostNonshattering.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatrixRemoval/HostNonshattering.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/MatrixRemoval/HostNonshattering.lean
-
curl -L -o HostNonshattering.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatrixRemoval/HostNonshattering.lean
7 kB
Lean 4 Β· 15
declarations statementsfull
| import OAI.Combinatorics.MatrixRemoval.Host | |
| import OAI.Combinatorics.MatrixRemoval.DirectNonshattering | |
| namespace OAI | |
| /-! | |
| # Nonshattering for the concrete canonical host | |
| This is a direct application of the qualitative five-column obstruction to | |
| `Problem348.Construction.host`. It needs no axis order and no injectivity | |
| assumption on the five selected non-anchor columns. | |
| -/ | |
| universe uR | |
| namespace Problem348.Construction | |
| open Finset | |
| noncomputable section | |
| /-- The two kinds of non-anchor positions, without their outer sum tag. -/ | |
| abbrev NonanchorPosition (h : β) := VariablePosition h β Fin (2 ^ h) | |
| /-- Column-class labels for the non-anchor induced submatrix. The dummy label | |
| is irrelevant because dummy columns are treated separately. -/ | |
| def nonanchorClass {h : β} : NonanchorPosition h β β | |
| | Sum.inl v => v.1.val | |
| | Sum.inr _ => 0 | |
| def nonanchorKey {h : β} : NonanchorPosition h β β | |
| | Sum.inl v => node v | |
| | Sum.inr _ => 0 | |
| def nonanchorDummy {h : β} : NonanchorPosition h β Prop | |
| | Sum.inl _ => False | |
| | Sum.inr _ => True | |
| instance {h : β} (x : NonanchorPosition h) : Decidable (nonanchorDummy x) := by | |
| cases x <;> simp only [nonanchorDummy] <;> infer_instance | |
| /-- The three class labels that can contain ones in a variable row. -/ | |
| def variableSupportLabels {h : β} (r : VariablePosition h) : Finset β := | |
| {r.1.val, 2 * (depth r - 1), 2 * (depth r - 1) + 1} | |
| theorem variableSupportLabels_card_le {h : β} (r : VariablePosition h) : | |
| (variableSupportLabels r).card β€ 3 := by | |
| exact Finset.card_le_three | |
| /-- The constant-class suffix property, stated for the actual host kernel. -/ | |
| theorem variableEntry_mono_class {h : β} (r c d : VariablePosition h) | |
| (hclass : c.1.val = d.1.val) (hnode : node c β€ node d) | |
| (hc : variableEntry r c = true) : variableEntry r d = true := by | |
| have hd : depth c = depth d := by simp only [depth, hclass] | |
| have hp : plus c = plus d := by simp only [plus, hclass] | |
| unfold variableEntry at hc β’ | |
| simp only [hd, hp] at hc | |
| split_ifs at hc β’ <;> simp_all <;> omega | |
| /-- A true variable entry has one of the three possible column-class labels. -/ | |
| theorem variableEntry_mem_support {h : β} (r c : VariablePosition h) | |
| (hc : variableEntry r c = true) : c.1.val β variableSupportLabels r := by | |
| have hr := r.1.isLt | |
| have hcv := c.1.isLt | |
| simp only [variableSupportLabels, Finset.mem_insert, Finset.mem_singleton] | |
| unfold variableEntry at hc | |
| simp only [depth, plus, decide_eq_true_eq] at hc β’ | |
| split_ifs at hc <;> simp_all <;> omega | |
| /-- The induced matrix on all non-anchor positions misses a five-bit word. -/ | |
| theorem nonanchor_host_not_surjective (h : β) | |
| (selected : Fin 5 β NonanchorPosition h) : | |
| Β¬ Function.Surjective | |
| (fun r : NonanchorPosition h => | |
| fun i => host (Sum.inr r) (Sum.inr (selected i))) := by | |
| apply DirectNonshattering.not_surjective_selected_columns | |
| (fun r c : NonanchorPosition h => host (Sum.inr r) (Sum.inr c)) | |
| nonanchorDummy nonanchorDummy nonanchorClass nonanchorKey | |
| Β· intro r hr c | |
| cases r with | |
| | inl r => exact False.elim hr | |
| | inr r => cases c <;> rfl | |
| Β· intro c hc r | |
| cases c with | |
| | inl c => exact False.elim hc | |
| | inr c => cases r <;> rfl | |
| Β· intro r hr c d hc hd hclass hnode he | |
| cases r with | |
| | inr r => exact False.elim (hr trivial) | |
| | inl r => | |
| cases c with | |
| | inr c => exact False.elim (hc trivial) | |
| | inl c => | |
| cases d with | |
| | inr d => exact False.elim (hd trivial) | |
| | inl d => exact variableEntry_mono_class r c d hclass hnode he | |
| Β· intro r hr | |
| cases r with | |
| | inr r => exact False.elim (hr trivial) | |
| | inl r => | |
| apply (Finset.card_le_card ?_).trans (variableSupportLabels_card_le r) | |
| intro a ha | |
| obtain β¨c, hc, rflβ© := Finset.mem_image.mp ha | |
| obtain β¨_, hnd, heβ© := Finset.mem_filter.mp hc | |
| cases c with | |
| | inr c => exact False.elim (hnd trivial) | |
| | inl c => exact variableEntry_mem_support r c he | |
| /-- The actual host, stated using its outer position type. This avoids any | |
| choice of a separate non-anchor enumeration in anchor-rigidity applications. -/ | |
| theorem host_nonanchor_missing_word {h : β} (columns : Fin 5 β Position h) | |
| (hcolumns : β i, β c : NonanchorPosition h, columns i = Sum.inr c) : | |
| β w : Fin 5 β Bool, β r : Position h, | |
| (β a : NonanchorPosition h, r = Sum.inr a) β | |
| (fun i => host r (columns i)) β w := by | |
| classical | |
| choose selected hselected using hcolumns | |
| obtain β¨w, hwβ© : β w : Fin 5 β Bool, β r : NonanchorPosition h, | |
| (fun i => host (Sum.inr r) (Sum.inr (selected i))) β w := by | |
| simpa only [Function.Surjective, not_forall, not_exists] using | |
| nonanchor_host_not_surjective h selected | |
| refine β¨w, ?_β© | |
| rintro r β¨a, rflβ© | |
| simpa only [hselected] using hw a | |
| /-- Restricting to any collection of non-anchor rows still misses a word. | |
| This is the form used for the final 32 rows of an alleged anchor copy. -/ | |
| theorem host_nonanchor_submatrix_not_surjective {h : β} {R : Type uR} | |
| (rows : R β Position h) (columns : Fin 5 β Position h) | |
| (hrows : β r, β a : NonanchorPosition h, rows r = Sum.inr a) | |
| (hcolumns : β i, β c : NonanchorPosition h, columns i = Sum.inr c) : | |
| Β¬ Function.Surjective (fun r i => host (rows r) (columns i)) := by | |
| obtain β¨w, hwβ© := host_nonanchor_missing_word columns hcolumns | |
| intro hsurj | |
| obtain β¨r, hrβ© := hsurj w | |
| exact hw (rows r) (hrows r) hr | |
| /-- The outer sum tag gives a convenient intrinsic non-anchor predicate. -/ | |
| theorem exists_nonanchor_iff_not_isLeft {h : β} (x : Position h) : | |
| (β a : NonanchorPosition h, x = Sum.inr a) β Β¬ x.isLeft := by | |
| cases x <;> simp | |
| /-- Pointwise missing-word property for concrete anchor rigidity. -/ | |
| theorem host_nonanchor_missing_entry {h : β} (columns : Fin 5 β Position h) | |
| (hcolumns : β i, Β¬ (columns i).isLeft) : | |
| β w : Fin 5 β Bool, β r : Position h, Β¬ r.isLeft β | |
| β i, host r (columns i) β w i := by | |
| obtain β¨w, hwβ© := host_nonanchor_missing_word columns | |
| (fun i => (exists_nonanchor_iff_not_isLeft (columns i)).mpr (hcolumns i)) | |
| refine β¨w, ?_β© | |
| intro r hr | |
| have hne := hw r ((exists_nonanchor_iff_not_isLeft r).mpr hr) | |
| exact not_forall.mp (fun he => hne (funext he)) | |
| /-- The subtype formulation also avoids making any non-anchor choices. -/ | |
| theorem host_nonanchor_subtype_not_surjective {h : β} | |
| (columns : Fin 5 β Position h) (hcolumns : β i, Β¬ (columns i).isLeft) : | |
| Β¬ Function.Surjective | |
| (fun r : {x : Position h // Β¬ x.isLeft} => fun i => host r.val (columns i)) := by | |
| apply host_nonanchor_submatrix_not_surjective | |
| (fun r : {x : Position h // Β¬ x.isLeft} => r.val) columns | |
| Β· intro r | |
| exact (exists_nonanchor_iff_not_isLeft r.val).mpr r.property | |
| Β· intro i | |
| exact (exists_nonanchor_iff_not_isLeft (columns i)).mpr (hcolumns i) | |
| end | |
| end Problem348.Construction | |
| end OAI | |
Outline
- abbrev
NonanchorPosition23 - def
nonanchorClass27 - def
nonanchorKey31 - def
nonanchorDummy35 - instance
39 - def
variableSupportLabels43 - theorem
variableSupportLabels_card_le46 - theorem
variableEntry_mono_class51 - theorem
variableEntry_mem_support61 - theorem
nonanchor_host_not_surjective71 - theorem
host_nonanchor_missing_word111 - theorem
host_nonanchor_submatrix_not_surjective128 - theorem
exists_nonanchor_iff_not_isLeft139 - theorem
host_nonanchor_missing_entry144 - theorem
host_nonanchor_subtype_not_surjective156