File size: 3,210 Bytes
f18e7de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.LinearAlgebra.MatrixMultiplication.Recovery.OrbitRecovery
import OAI.LinearAlgebra.MatrixMultiplication.Recovery.RecoveryGrowth

namespace OAI

/-! Finite orbit symmetries, masks and exact recovery operations. -/

open MatrixMultiplication.Foundation

namespace MatrixMultiplication.InverseLinearRecovery

abbrev MaskRectangles (L : ℕ) := Finset (Fin L) × Finset (Fin L) × Finset (Fin L)

def RecoveredBy {K X Y Z : Type*} [CommSemiring K]
    [Fintype X] [Fintype Y] [Fintype Z]
    (Q H : Tensor K X Y Z) (L : ℕ) : Prop :=
  ∃ (a : X → (MaskRectangles L × X) → K)
    (b : Y → (MaskRectangles L × Y) → K)
    (c : Z → (MaskRectangles L × Z) → K),
    Tensor.restrict a b c (Tensor.directSum (fun _ : MaskRectangles L => H)) = Q

theorem repair_inverse_linear
    {K G X Y Z : Type*} [CommSemiring K] [Group G] [Fintype G]
    [MulAction G X] [MulAction G Y] [MulAction G Z]
    [Fintype X] [Fintype Y] [Fintype Z]
    [DecidableEq X] [DecidableEq Y] [DecidableEq Z]
    (Q : Tensor K X Y Z)
    (px : X → Prop) (py : Y → Prop) (pz : Z → Prop)
    [DecidablePred px] [DecidablePred py] [DecidablePred pz]
    (hpreserve : ∀ (g : G) x y z, Q (g • x) (g • y) (g • z) = Q x y z)
    {b C : ℝ} {N : ℕ} (hb : 0 ≤ b) (hC : 0 < C) (hN : 3 * C < (N : ℝ))
    (hsupport : ((@Finset.filter (X × Y × Z)
      (fun p => Q p.1 p.2.1 p.2.2 ≠ 0) (Classical.decPred _) Finset.univ).card : ℝ) ≤
      Real.exp (b * N))
    (hx : ∀ x, (∃ y z, Q x y z ≠ 0) → (((OrbitCounting.orbitSet (G := G) x).filter fun v => ¬px v).card : ℝ) /
      (OrbitCounting.orbitSet (G := G) x).card ≤ C / N)
    (hy : ∀ y, (∃ x z, Q x y z ≠ 0) → (((OrbitCounting.orbitSet (G := G) y).filter fun v => ¬py v).card : ℝ) /
      (OrbitCounting.orbitSet (G := G) y).card ≤ C / N)
    (hz : ∀ z, (∃ x y, Q x y z ≠ 0) → (((OrbitCounting.orbitSet (G := G) z).filter fun v => ¬pz v).card : ℝ) /
      (OrbitCounting.orbitSet (G := G) z).card ≤ C / N) :
    RecoveredBy Q (ExactRecovery.delete Q px py pz) (RecoveryGrowth.shiftCount b C N) := by
  classical
  apply OrbitRecovery.repair_from_orbit_loss Q px py pz hpreserve (C / N) hx hy hz
    (RecoveryGrowth.shiftCount b C N) (RecoveryGrowth.shiftCount_pos hb hC hN)
  apply RecoveryGrowth.cardinal_budget hC hN Fintype.card_pos hsupport
  simpa only [mul_div_assoc] using
    OrbitRecovery.floor_loss_fraction (G := G) (C / N)
      (div_nonneg hC.le (Nat.cast_nonneg N))

theorem card_recovery_copies (b C : ℝ) (N : ℕ) :
    Fintype.card (MaskRectangles (RecoveryGrowth.shiftCount b C N)) =
      RecoveryGrowth.replicationCount b C N := by
  simpa only [MaskRectangles, Fintype.card_fin, RecoveryGrowth.replicationCount] using
    (ExactRecovery.card_mask_rectangles (I := Fin (RecoveryGrowth.shiftCount b C N)))

theorem subexponential_copies {b C : ℝ} (hb : 0 < b) (hC : 0 < C) :
    Filter.Tendsto (fun N : ℕ =>
      Real.log (Fintype.card (MaskRectangles (RecoveryGrowth.shiftCount b C N))) / N)
      Filter.atTop (nhds 0) := by
  simp_rw [card_recovery_copies]
  exact RecoveryGrowth.tendsto_log_replicationCount_div_nat hb hC

end MatrixMultiplication.InverseLinearRecovery

end OAI