introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.57 kB
import OAI.LinearAlgebra.MatrixMultiplication.Recovery.InverseLinearRecovery
import OAI.LinearAlgebra.MatrixMultiplication.Recovery.OrbitLoss
import OAI.LinearAlgebra.MatrixMultiplication.Recovery.RecoverySupport
import OAI.LinearAlgebra.MatrixMultiplication.Recovery.EquivOrbitTransport
namespace OAI
/-! Joint tensor extraction, compatibility and entropy estimates. -/
open MatrixMultiplication.Foundation
namespace MatrixMultiplication.JointOrbitRecovery
variable {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]
def SeparatedLoss {V : Type*} [DecidableEq V] [MulAction G V]
(pass assigned : V β†’ Prop) [DecidablePred pass] [DecidablePred assigned]
(C : ℝ) (N : β„•) (v : V) : Prop :=
(((OrbitCounting.orbitSet (G := G) v).filter fun w => Β¬pass w).card : ℝ) /
(OrbitCounting.orbitSet (G := G) v).card ≀ C / N ∧
(((OrbitCounting.orbitSet (G := G) v).filter fun w => pass w ∧ Β¬assigned w).card : ℝ) /
(OrbitCounting.orbitSet (G := G) v).card ≀ 1 / N
theorem separatedLoss_transport {U V : Type*} [DecidableEq U] [DecidableEq V]
[MulAction G V] (e : U ≃ V)
(pass assigned : U β†’ Prop) [DecidablePred pass] [DecidablePred assigned]
(C : ℝ) (N : β„•) (u : U) :
letI : MulAction G U := EquivOrbitTransport.action e
SeparatedLoss (G := G) pass assigned C N u ↔
SeparatedLoss (G := G) (pass ∘ e.symm) (assigned ∘ e.symm) C N (e u) := by
let : MulAction G U := EquivOrbitTransport.action e
unfold SeparatedLoss
rw [EquivOrbitTransport.rejected_fraction e (fun w => Β¬pass w) u,
EquivOrbitTransport.rejected_fraction e (fun w => pass w ∧ ¬assigned w) u]
simp only [Function.comp_def]
theorem combined_loss {V : Type*} [DecidableEq V] [MulAction G V]
(pass assigned : V β†’ Prop) [DecidablePred pass] [DecidablePred assigned]
(C : ℝ) (N : β„•) (v : V) (h : SeparatedLoss (G := G) pass assigned C N v) :
(((OrbitCounting.orbitSet (G := G) v).filter fun w => Β¬(assigned w ∧ pass w)).card : ℝ) /
(OrbitCounting.orbitSet (G := G) v).card ≀ (C + 1) / N := by
simpa only [and_comm] using
OrbitLoss.combined_inverse_linear (OrbitCounting.orbitSet (G := G) v)
pass assigned C N h.1 h.2
theorem repair_of_separated_losses
(Q H : Tensor K X Y Z)
(passX assignedX : X β†’ Prop) (passY assignedY : Y β†’ Prop)
(passZ assignedZ : Z β†’ Prop)
[DecidablePred passX] [DecidablePred assignedX]
[DecidablePred passY] [DecidablePred assignedY]
[DecidablePred passZ] [DecidablePred assignedZ]
(hhole : H = ExactRecovery.delete Q
(fun x => assignedX x ∧ passX x) (fun y => assignedY y ∧ passY y)
(fun z => assignedZ z ∧ passZ z))
(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 + 1) < (N : ℝ))
(hsupport : ((RecoverySupport.support Q).card : ℝ) ≀ Real.exp (b * N))
(hx : βˆ€ x, (βˆƒ y z, Q x y z β‰  0) β†’
SeparatedLoss (G := G) passX assignedX C N x)
(hy : βˆ€ y, (βˆƒ x z, Q x y z β‰  0) β†’
SeparatedLoss (G := G) passY assignedY C N y)
(hz : βˆ€ z, (βˆƒ x y, Q x y z β‰  0) β†’
SeparatedLoss (G := G) passZ assignedZ C N z) :
InverseLinearRecovery.RecoveredBy Q H (RecoveryGrowth.shiftCount b (C + 1) N) := by
classical
rw [hhole]
apply InverseLinearRecovery.repair_inverse_linear Q
(fun x => assignedX x ∧ passX x) (fun y => assignedY y ∧ passY y)
(fun z => assignedZ z ∧ passZ z) hpreserve hb (by linarith) hN
Β· have heq : (@Finset.filter (X Γ— Y Γ— Z)
(fun p => Q p.1 p.2.1 p.2.2 β‰  0) (Classical.decPred _) Finset.univ) =
RecoverySupport.support Q := by
ext p
simp only [RecoverySupport.support, Finset.mem_filter]
rw [heq]
exact hsupport
Β· intro x hused
exact combined_loss passX assignedX C N x (hx x hused)
Β· intro y hused
exact combined_loss passY assignedY C N y (hy y hused)
Β· intro z hused
exact combined_loss passZ assignedZ C N z (hz z hused)
theorem subexponential_copies {b C : ℝ} (hb : 0 < b) (hC : 0 ≀ C) :
Filter.Tendsto (fun N : β„• =>
Real.log (Fintype.card
(InverseLinearRecovery.MaskRectangles (RecoveryGrowth.shiftCount b (C + 1) N))) / N)
Filter.atTop (nhds 0) :=
InverseLinearRecovery.subexponential_copies hb (by linarith)
end MatrixMultiplication.JointOrbitRecovery
end OAI