Download data/lean/OAI/Combinatorics/MatrixRemoval/CopyBound.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.56 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatrixRemoval/CopyBound.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/MatrixRemoval/CopyBound.lean
-
curl -L -o CopyBound.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatrixRemoval/CopyBound.lean
2.56 kB
| import Mathlib | |
| namespace OAI | |
| /-! | |
| # Counting ordered matrix copies through a constrained cell | |
| The counting injection is independent of the host construction. | |
| -/ | |
| namespace Problem348.CopyBound | |
| /-- If one specified row-column pair in every member of a finite family belongs | |
| to `L`, the family is encoded by that cell and all remaining coordinates. -/ | |
| theorem card_le_card_mul_pow {k n : β} | |
| (S : Finset | |
| ({f : Fin (k + 1) β Fin n // StrictMono f} Γ | |
| {f : Fin (k + 1) β Fin n // StrictMono f})) | |
| (i j : Fin (k + 1)) (L : Finset (Fin n Γ Fin n)) | |
| (hL : β rc β S, (rc.1.val i, rc.2.val j) β L) : | |
| S.card β€ L.card * n ^ (2 * k) := by | |
| classical | |
| let encode : S β L Γ ((Fin k β Fin n) Γ (Fin k β Fin n)) := | |
| fun rc => | |
| (β¨(rc.val.1.val i, rc.val.2.val j), hL rc.val rc.propertyβ©, | |
| (fun a => rc.val.1.val (i.succAbove a), | |
| fun b => rc.val.2.val (j.succAbove b))) | |
| have hinj : Function.Injective encode := by | |
| intro x y hxy | |
| apply Subtype.ext | |
| apply Prod.ext | |
| Β· apply Subtype.ext | |
| funext a | |
| rcases Fin.eq_self_or_eq_succAbove i a with ha | β¨b, hbβ© | |
| Β· subst a | |
| exact congrArg (fun z => z.1.val.1) hxy | |
| Β· subst a | |
| exact congrArg (fun z => z.2.1 b) hxy | |
| Β· apply Subtype.ext | |
| funext a | |
| rcases Fin.eq_self_or_eq_succAbove j a with ha | β¨b, hbβ© | |
| Β· subst a | |
| exact congrArg (fun z => z.1.val.2) hxy | |
| Β· subst a | |
| exact congrArg (fun z => z.2.2 b) hxy | |
| have hc := Fintype.card_le_of_injective encode hinj | |
| simpa only [Fintype.card_coe, Fintype.card_prod, Fintype.card_fun, | |
| Fintype.card_fin, two_mul, pow_add, mul_assoc] using hc | |
| /-- Normalize the integer count bound from the leaf-diagonal argument. -/ | |
| theorem normalized_count_le {count d m : β} (hd : 0 < d) (hm : 0 < m) | |
| (hcount : count β€ m * (d * m) ^ 130) : | |
| (count : β) / (((d * m : β) : β) ^ 132) β€ | |
| (1 / ((d : β) ^ 2)) * (1 / (m : β)) := by | |
| have hd0 : (d : β) β 0 := by exact_mod_cast Nat.ne_of_gt hd | |
| have hm0 : (m : β) β 0 := by exact_mod_cast Nat.ne_of_gt hm | |
| have hcount' : (count : β) β€ (m : β) * ((d : β) * (m : β)) ^ 130 := by | |
| exact_mod_cast hcount | |
| push_cast | |
| calc | |
| (count : β) / ((d : β) * (m : β)) ^ 132 β€ | |
| ((m : β) * ((d : β) * (m : β)) ^ 130) / | |
| ((d : β) * (m : β)) ^ 132 := | |
| div_le_div_of_nonneg_right hcount' (by positivity) | |
| _ = (1 / ((d : β) ^ 2)) * (1 / (m : β)) := by | |
| field_simp | |
| end Problem348.CopyBound | |
| end OAI | |