File size: 6,395 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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | import OAI.LinearAlgebra.MatrixMultiplication.FieldGroups.OrbitData
import OAI.LinearAlgebra.MatrixMultiplication.JointExtraction.MaskedRates
namespace OAI
/-! Group assignments, orbit counts and extraction capacities. -/
noncomputable section
namespace MatrixMultiplication.AllFieldGroupDegreeEnvelope
open AllFieldHistory AllFieldGroupOrbitData Filter
open scoped Topology
attribute [local instance] Classical.propDecidable
variable {K tick : β}
def variableDegree (allocation : Allocation) (m : β) (width : β)
(sigma : Placement) (e : Targets (K := K) (tick := tick) allocation m sigma) : β :=
((data (K := K) (tick := tick) allocation m width sigma).orbits e).sup fun o =>
((data (K := K) (tick := tick) allocation m width sigma).passing e o).sup fun v =>
((data (K := K) (tick := tick) allocation m width sigma).competitors e o v).card
def uniformDegree (allocation : Allocation) (m : β) (width : β)
(sigma : Placement) : β :=
Finset.univ.sup fun e : Targets (K := K) (tick := tick) allocation m sigma =>
max ((data (K := K) (tick := tick) allocation m width sigma).eligibilityCompetitors e).card
(variableDegree (K := K) (tick := tick) allocation m width sigma e)
theorem eligibility_card_le (allocation : Allocation) (m : β) (width : β)
(sigma : Placement) (e : Targets (K := K) (tick := tick) allocation m sigma) :
((data (K := K) (tick := tick) allocation m width sigma).eligibilityCompetitors e).card β€
uniformDegree (K := K) (tick := tick) allocation m width sigma :=
(le_max_left _ _).trans (Finset.le_sup (f := fun e =>
max ((data (K := K) (tick := tick) allocation m width sigma).eligibilityCompetitors e).card
(variableDegree (K := K) (tick := tick) allocation m width sigma e)) (Finset.mem_univ e))
theorem competitors_card_le (allocation : Allocation) (m : β) (width : β)
(sigma : Placement) (e : Targets (K := K) (tick := tick) allocation m sigma)
(o : Orbit (K := K) (tick := tick) allocation m sigma) (ho : o β (data (K := K) (tick := tick) allocation m width sigma).orbits e)
(v : Variable (K := K) (tick := tick) allocation m sigma) (hv : v β (data (K := K) (tick := tick) allocation m width sigma).passing e o) :
((data (K := K) (tick := tick) allocation m width sigma).competitors e o v).card β€
uniformDegree (K := K) (tick := tick) allocation m width sigma := by
have hvle := Finset.le_sup (f := fun v =>
((data (K := K) (tick := tick) allocation m width sigma).competitors e o v).card) hv
have hole := Finset.le_sup (f := fun o =>
((data (K := K) (tick := tick) allocation m width sigma).passing e o).sup fun v =>
((data (K := K) (tick := tick) allocation m width sigma).competitors e o v).card) ho
have hel := Finset.le_sup (f := fun e =>
max ((data (K := K) (tick := tick) allocation m width sigma).eligibilityCompetitors e).card
(variableDegree (K := K) (tick := tick) allocation m width sigma e)) (Finset.mem_univ e)
exact hvle.trans (hole.trans ((le_max_right _ _).trans hel))
private theorem cast_max_le {a b : β} {R : β}
(ha : (a : β) β€ R) (hb : (b : β) β€ R) : ((max a b : β) : β) β€ R := by
rcases le_total a b with hab | hba
Β· simpa only [max_eq_right hab] using hb
Β· simpa only [max_eq_left hba] using ha
private theorem cast_sup_le {I : Type*} (s : Finset I) (f : I β β)
{R : β} (hR : 0 β€ R) (hs : β i β s, (f i : β) β€ R) :
((s.sup f : β) : β) β€ R := by
classical
revert hs
induction s using Finset.induction_on with
| empty =>
intro _
simpa using hR
| @insert a s _ ih =>
intro hs
rw [Finset.sup_insert]
exact cast_max_le (hs a (Finset.mem_insert_self a s))
(ih (fun i hi => hs i (Finset.mem_insert_of_mem hi)))
theorem uniformDegree_real_le (allocation : Allocation) (m : β) (width : β)
(sigma : Placement) {R : β} (hR : 0 β€ R)
(heligibility : β e : Targets (K := K) (tick := tick) allocation m sigma,
(((data (K := K) (tick := tick) allocation m width sigma).eligibilityCompetitors e).card : β) β€ R)
(hcompetitors : β e : Targets (K := K) (tick := tick) allocation m sigma,
β o β (data (K := K) (tick := tick) allocation m width sigma).orbits e,
β v β (data (K := K) (tick := tick) allocation m width sigma).passing e o,
(((data (K := K) (tick := tick) allocation m width sigma).competitors e o v).card : β) β€ R) :
(uniformDegree (K := K) (tick := tick) allocation m width sigma : β) β€ R := by
apply cast_sup_le _ _ hR
intro e _
apply cast_max_le (heligibility e)
apply cast_sup_le _ _ hR
intro o ho
apply cast_sup_le _ _ hR
exact hcompetitors e o ho
theorem eventually_log_uniformDegree_le (allocation : Allocation) (width : β)
(sigma : Placement) {D : β} (hD : 0 β€ D)
(hcounts : βαΆ m : β in atTop,
(β e : Targets (K := K) (tick := tick) allocation m sigma,
(((data (K := K) (tick := tick) allocation m width sigma).eligibilityCompetitors e).card : β) β€
Real.exp ((m : β) * D)) β§
(β e : Targets (K := K) (tick := tick) allocation m sigma,
β o β (data (K := K) (tick := tick) allocation m width sigma).orbits e,
β v β (data (K := K) (tick := tick) allocation m width sigma).passing e o,
(((data (K := K) (tick := tick) allocation m width sigma).competitors e o v).card : β) β€
Real.exp ((m : β) * D))) :
βαΆ m : β in atTop,
Real.log (uniformDegree (K := K) (tick := tick) allocation m width sigma : β) /
(m : β) β€ D := by
filter_upwards [hcounts, eventually_gt_atTop (0 : β)] with m hm hmp
by_cases hz : uniformDegree (K := K) (tick := tick) allocation m width sigma = 0
Β· simpa only [hz, Nat.cast_zero, Real.log_zero, zero_div] using hD
have hd : (0 : β) < uniformDegree (K := K) (tick := tick) allocation m width sigma := by
exact_mod_cast Nat.pos_of_ne_zero hz
have hb := uniformDegree_real_le (K := K) (tick := tick) allocation m width sigma
(Real.exp_pos _).le hm.1 hm.2
have hl := Real.log_le_log hd hb
rw [Real.log_exp] at hl
have hmpos : (0 : β) < m := by exact_mod_cast hmp
exact (div_le_iffβ hmpos).mpr (by simpa only [mul_comm] using hl)
end MatrixMultiplication.AllFieldGroupDegreeEnvelope
end
end OAI
|