File size: 2,563 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | 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
|