File size: 21,115 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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | import OAI.Algorithms.SubexponentialSAT.LeanCompat
namespace OAI.Algorithms
/-!
# Cardinalities for the separated coset enumeration
The outer data are a vector on the complementary coordinates and one quotient
class on each of two coordinate blocks. The inner data are actual vectors in
those quotient classes. These theorems establish their exact cardinalities and
the algebraic identity in equation (4.9). They do not assert a bit-complexity
bound for enumerating a basis, a quotient, or the symbolic ring.
-/
namespace SubexponentialSAT.CosetCardinality
open Module
section Modules
variable {π½ V W : Type*} [Field π½]
[AddCommGroup V] [Module π½ V] [AddCommGroup W] [Module π½ W]
/-- Linear equivalences preserve the cardinality of the underlying set. -/
theorem card_of_linearEquiv (e : V ββ[π½] W) : Nat.card V = Nat.card W :=
Nat.card_congr e.toEquiv
/-- A finite-dimensional space has a linear coordinate system with exactly
`finrank` coordinates. The basis choice here carries no algorithmic cost claim. -/
noncomputable def finiteCoordinateEquiv [Module.Finite π½ V] :
V ββ[π½] (Fin (finrank π½ V) β π½) :=
(Module.finBasis π½ V).equivFun
/-- The cardinality formula for a finite-dimensional vector space. -/
theorem card_module [Module.Finite π½ V] :
Nat.card V = Nat.card π½ ^ finrank π½ V := by
let b := Module.finBasis π½ V
rw [Nat.card_congr b.equivFun.toEquiv, Nat.card_fun]
simp only [Nat.card_eq_fintype_card, Fintype.card_fin]
/-- The size of an inner subspace is the field size to its dimension. -/
theorem card_submodule [Module.Finite π½ V] (K : Submodule π½ V) :
Nat.card K = Nat.card π½ ^ finrank π½ K :=
card_module
/-- The number of cosets in a coordinate block. -/
theorem card_quotient [Module.Finite π½ V] (K : Submodule π½ V) :
Nat.card (V β§Έ K) = Nat.card π½ ^ (finrank π½ V - finrank π½ K) := by
rw [card_module (π½ := π½), Submodule.finrank_quotient]
/-- A coset is represented as the fiber of the actual quotient map. -/
def CosetFiber (K : Submodule π½ V) (q : V β§Έ K) :=
{x : V // (Submodule.Quotient.mk x : V β§Έ K) = q}
/-- Taking a quotient class together with a point of that class partitions the
ambient vector space exactly, without duplicates or omitted vectors. -/
def quotientFiberEquiv (K : Submodule π½ V) :
(Ξ£ q : V β§Έ K, CosetFiber K q) β V :=
Equiv.sigmaFiberEquiv (fun x : V => (Submodule.Quotient.mk x : V β§Έ K))
/-- Translating the subspace by any representative enumerates its coset
bijectively, even when the field elements are later represented by integers. -/
def cosetEquiv (K : Submodule π½ V) (q : V β§Έ K) (r : V)
(hr : (Submodule.Quotient.mk r : V β§Έ K) = q) : K β CosetFiber K q where
toFun k := β¨r + k, by
rw [Submodule.Quotient.mk_add, (Submodule.Quotient.mk_eq_zero K).2 k.property,
add_zero, hr]β©
invFun x := β¨x.val - r, (Submodule.Quotient.eq K).1 (x.property.trans hr.symm)β©
left_inv k := by
apply Subtype.ext
simp
right_inv x := by
apply Subtype.ext
simp []
/-- Every quotient class has the same cardinality as its subspace. -/
theorem card_coset_eq (K : Submodule π½ V) (q : V β§Έ K) :
Nat.card (CosetFiber K q) = Nat.card K := by
obtain β¨r, hrβ© := Submodule.Quotient.mk_surjective (p := K) q
exact Nat.card_congr (cosetEquiv K q r hr).symm
/-- Every inner sum over a coset has exactly this many terms. -/
theorem card_coset [Module.Finite π½ V] (K : Submodule π½ V) (q : V β§Έ K) :
Nat.card (CosetFiber K q) = Nat.card π½ ^ finrank π½ K := by
rw [card_coset_eq, card_submodule]
/-- Fintype-facing version for finite sums indexed directly by subspace vectors. -/
theorem fintype_card_submodule [Fintype π½] [Fintype V] (K : Submodule π½ V)
[Fintype K] : Fintype.card K = Fintype.card π½ ^ finrank π½ K := by
simpa only [Nat.card_eq_fintype_card] using card_submodule K
end Modules
section OuterData
variable {π½ Vstar V0 V1 : Type*} [Field π½]
[AddCommGroup Vstar] [Module π½ Vstar]
[AddCommGroup V0] [Module π½ V0] [AddCommGroup V1] [Module π½ V1]
/-- The actual type of outer choices used in Section 4.5. -/
abbrev OuterData (K0 : Submodule π½ V0) (K1 : Submodule π½ V1) :=
Vstar Γ (V0 β§Έ K0) Γ (V1 β§Έ K1)
/-- Every split assignment is uniquely an outer datum and a pair of vectors
in its two cosets. This is the full-domain partition behind the enumeration. -/
def outerFiberEquiv (K0 : Submodule π½ V0) (K1 : Submodule π½ V1) :
(Vstar Γ V0 Γ V1) β
Ξ£ o : OuterData (Vstar := Vstar) K0 K1,
CosetFiber K0 o.2.1 Γ CosetFiber K1 o.2.2 where
toFun x := β¨(x.1, Submodule.Quotient.mk x.2.1, Submodule.Quotient.mk x.2.2),
β¨x.2.1, rflβ©, β¨x.2.2, rflβ©β©
invFun y := (y.1.1, y.2.1.val, y.2.2.val)
left_inv _ := rfl
right_inv y := by
rcases y with β¨β¨xs, q0, q1β©, β¨x0, h0β©, β¨x1, h1β©β©
dsimp at h0 h1
subst q0
subst q1
rfl
/-- Product cardinality gives the number of outer choices. -/
theorem card_outer [Module.Finite π½ Vstar] [Module.Finite π½ V0]
[Module.Finite π½ V1] (K0 : Submodule π½ V0) (K1 : Submodule π½ V1) :
Nat.card (OuterData (Vstar := Vstar) K0 K1) = Nat.card π½ ^
(finrank π½ Vstar + finrank π½ V0 + finrank π½ V1 -
finrank π½ K0 - finrank π½ K1) := by
have h0 := K0.finrank_quotient_add_finrank
have h1 := K1.finrank_quotient_add_finrank
simp only [OuterData, Nat.card_prod, card_quotient]
rw [card_module (π½ := π½) (V := Vstar)]
rw [β pow_add, β pow_add]
congr 1
omega
/-- The arithmetic identity behind equation (4.9). The dimension assumption
is essential when subtraction is natural-number subtraction. -/
theorem iteration_identity (p D d0 d1 : β) (h : d0 + d1 β€ D) :
p ^ (D - d0 - d1) * (p ^ d0 + p ^ d1) =
p ^ (D - d1) + p ^ (D - d0) := by
rw [Nat.mul_add, β pow_add, β pow_add]
congr 1 <;> congr 1 <;> omega
/-- An integer-exponent version of the final inequality in (4.9).
The hypotheses express `d0,d1 β₯ D/4` without rounding ambiguity. -/
theorem iteration_bound (p D d0 d1 : β) (hp : 0 < p)
(h : d0 + d1 β€ D) (h0 : D β€ 4 * d0) (h1 : D β€ 4 * d1) :
p ^ (D - d0 - d1) * (p ^ d0 + p ^ d1) β€ 2 * p ^ (3 * D / 4) := by
rw [iteration_identity p D d0 d1 h, two_mul]
exact Nat.add_le_add
(Nat.pow_le_pow_right hp (by omega : D - d1 β€ 3 * D / 4))
(Nat.pow_le_pow_right hp (by omega : D - d0 β€ 3 * D / 4))
/-- Counting each term in each of the two inner sums for every outer datum.
This is an iteration count, not a Turing-machine runtime theorem. -/
theorem card_outer_times_inner [Module.Finite π½ Vstar] [Module.Finite π½ V0]
[Module.Finite π½ V1] (K0 : Submodule π½ V0) (K1 : Submodule π½ V1) :
Nat.card (OuterData (Vstar := Vstar) K0 K1) * (Nat.card K0 + Nat.card K1) =
Nat.card π½ ^ (finrank π½ Vstar + finrank π½ V0 + finrank π½ V1 - finrank π½ K1) +
Nat.card π½ ^ (finrank π½ Vstar + finrank π½ V0 + finrank π½ V1 - finrank π½ K0) := by
rw [card_outer, card_submodule, card_submodule]
apply iteration_identity
have h0 := K0.finrank_quotient_add_finrank
have h1 := K1.finrank_quotient_add_finrank
omega
end OuterData
section Coordinates
variable {π½ ΞΉ : Type*} [Field π½] [Fintype ΞΉ] [DecidableEq ΞΉ]
/-- The disjoint coordinate supports and their complement split every ambient
assignment uniquely. This map is the actual restriction of coordinates. -/
def coordinateSplitEquiv (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1) :
(ΞΉ β π½) ββ[π½] ((β₯((S0 βͺ S1)αΆ) β π½) Γ (S0 β π½) Γ (S1 β π½)) where
toFun x := (fun i => x i.val, fun i => x i.val, fun i => x i.val)
invFun y i := if h0 : i β S0 then y.2.1 β¨i, h0β©
else if h1 : i β S1 then y.2.2 β¨i, h1β©
else y.1 β¨i, by simp only [Finset.mem_compl, Finset.mem_union, not_or]; exact β¨h0, h1β©β©
left_inv x := by
funext i
dsimp
split
Β· rfl
Β· split <;> rfl
right_inv y := by
apply Prod.ext
Β· funext i
have hi : i.val β S0 β§ i.val β S1 := by
simpa only [Finset.mem_compl, Finset.mem_union, not_or] using i.property
dsimp
simp only [dite_eq_right hi.1, dite_eq_right hi.2]
Β· apply Prod.ext
Β· funext i
dsimp
simp only [dite_eq_left i.property]
Β· funext i
have hi0 : i.val β S0 := fun hi => Finset.disjoint_left.mp h hi i.property
dsimp
simp only [dite_eq_right hi0, dite_eq_left i.property]
map_add' _ _ := rfl
map_smul' _ _ := rfl
/-- Three disjoint coordinate blocks account for the full ambient dimension. -/
theorem coordinate_card_partition (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1) :
Fintype.card β₯((S0 βͺ S1)αΆ) + Fintype.card β₯S0 + Fintype.card β₯S1 =
Fintype.card ΞΉ := by
simpa only [Fintype.card_coe, Finset.card_union_of_disjoint h, Nat.add_assoc]
using Finset.card_compl_add_card (S0 βͺ S1)
/-- Restricting each subspace to its own coordinate support is represented by
the local domains `S0 β π½` and `S1 β π½`. -/
abbrev CoordinateOuterData (S0 S1 : Finset ΞΉ)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½)) :=
OuterData (Vstar := β₯((S0 βͺ S1)αΆ) β π½) K0 K1
/-- A complete ambient assignment is an outer datum and a point in each of
its two cosets, through explicit coordinate restriction and quotient fibers. -/
def coordinateOuterFiberEquiv (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½)) :
(ΞΉ β π½) β Ξ£ o : CoordinateOuterData S0 S1 K0 K1,
CosetFiber K0 o.2.1 Γ CosetFiber K1 o.2.2 :=
(coordinateSplitEquiv S0 S1 h).toEquiv.trans (outerFiberEquiv K0 K1)
/-- Reconstruct an ambient assignment from its outer data and two coset points. -/
def coordinateReconstruct (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½))
(o : CoordinateOuterData S0 S1 K0 K1)
(x0 : CosetFiber K0 o.2.1) (x1 : CosetFiber K1 o.2.2) : ΞΉ β π½ :=
(coordinateOuterFiberEquiv S0 S1 h K0 K1).symm β¨o, x0, x1β©
/-- Reconstructing an assignment gives exactly its three supplied coordinate blocks. -/
theorem coordinateReconstruct_components (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½))
(o : CoordinateOuterData S0 S1 K0 K1)
(x0 : CosetFiber K0 o.2.1) (x1 : CosetFiber K1 o.2.2) :
(fun i : β₯((S0 βͺ S1)αΆ) => coordinateReconstruct S0 S1 h K0 K1 o x0 x1 i.val) = o.1 β§
(fun i : S0 => coordinateReconstruct S0 S1 h K0 K1 o x0 x1 i.val) = x0.val β§
(fun i : S1 => coordinateReconstruct S0 S1 h K0 K1 o x0 x1 i.val) = x1.val := by
have hs := (coordinateSplitEquiv (π½ := π½) S0 S1 h).apply_symm_apply
(o.1, x0.val, x1.val)
exact β¨congrArg Prod.fst hs, congrArg (fun z => z.2.1) hs,
congrArg (fun z => z.2.2) hsβ©
/-- The exact outer count for disjoint coordinate supports, with `D` given by
the cardinality of the original coordinate type. -/
theorem card_coordinate_outer (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½)) :
Nat.card (CoordinateOuterData S0 S1 K0 K1) =
Nat.card π½ ^ (Fintype.card ΞΉ - finrank π½ K0 - finrank π½ K1) := by
rw [card_outer]
simp only [Module.finrank_fintype_fun_eq_card]
rw [coordinate_card_partition S0 S1 h]
/-- Over a finite field the outer data themselves form a finite type, with
the expected power of the actual field cardinality. -/
theorem fintype_card_coordinate_outer [Fintype π½] (S0 S1 : Finset ΞΉ)
(h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½)) :
Fintype.card (CoordinateOuterData S0 S1 K0 K1) =
Fintype.card π½ ^ (Fintype.card ΞΉ - finrank π½ K0 - finrank π½ K1) := by
simpa only [Nat.card_eq_fintype_card] using card_coordinate_outer S0 S1 h K0 K1
/-- Disjoint supports bound the sum of the two inner dimensions by the
ambient number of coordinates. -/
theorem coordinate_dimensions_le (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½)) :
finrank π½ K0 + finrank π½ K1 β€ Fintype.card ΞΉ := by
have h0 := K0.finrank_quotient_add_finrank
have h1 := K1.finrank_quotient_add_finrank
have hp := coordinate_card_partition S0 S1 h
simp only [Module.finrank_fintype_fun_eq_card] at h0 h1
omega
/-- Equation (4.9), before the real-valued `3D/4` estimate: the outer count
times the two inner sizes is the sum of these two powers. -/
theorem coordinate_iteration_count (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½)) :
Nat.card (CoordinateOuterData S0 S1 K0 K1) * (Nat.card K0 + Nat.card K1) =
Nat.card π½ ^ (Fintype.card ΞΉ - finrank π½ K1) +
Nat.card π½ ^ (Fintype.card ΞΉ - finrank π½ K0) := by
rw [card_outer_times_inner]
simp only [Module.finrank_fintype_fun_eq_card]
rw [coordinate_card_partition S0 S1 h]
/-- The iteration formula counts a concrete type: an outer choice, followed
by either an index for the first inner sum or an index for the second. -/
theorem card_coordinate_iteration_type [Fintype π½] (S0 S1 : Finset ΞΉ)
(h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½)) :
Nat.card (CoordinateOuterData S0 S1 K0 K1 Γ (K0 β K1)) =
Fintype.card π½ ^ (Fintype.card ΞΉ - finrank π½ K1) +
Fintype.card π½ ^ (Fintype.card ΞΉ - finrank π½ K0) := by
rw [Nat.card_prod, Nat.card_sum]
simpa only [Nat.card_eq_fintype_card] using
coordinate_iteration_count S0 S1 h K0 K1
/-- The complete integer-cardinality bound in (4.9). The exponent is the
floor of `3D/4`, so this is slightly sharper than its real-exponent version. -/
theorem coordinate_iteration_bound [Fintype π½] (S0 S1 : Finset ΞΉ)
(h : Disjoint S0 S1)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½))
(h0 : Fintype.card ΞΉ β€ 4 * finrank π½ K0)
(h1 : Fintype.card ΞΉ β€ 4 * finrank π½ K1) :
Nat.card (CoordinateOuterData S0 S1 K0 K1) * (Nat.card K0 + Nat.card K1) β€
2 * Fintype.card π½ ^ (3 * Fintype.card ΞΉ / 4) := by
rw [card_coordinate_outer S0 S1 h, card_submodule, card_submodule]
simp only [Nat.card_eq_fintype_card]
exact iteration_bound _ _ _ _ Fintype.card_pos
(coordinate_dimensions_le S0 S1 h K0 K1) h0 h1
omit [DecidableEq ΞΉ] in
/-- The sizes of the actual two cosets used for any outer choice. -/
theorem coordinate_inner_sizes (S0 S1 : Finset ΞΉ)
(K0 : Submodule π½ (S0 β π½)) (K1 : Submodule π½ (S1 β π½))
(q0 : (S0 β π½) β§Έ K0) (q1 : (S1 β π½) β§Έ K1) :
Nat.card (CosetFiber K0 q0) = Nat.card π½ ^ finrank π½ K0 β§
Nat.card (CosetFiber K1 q1) = Nat.card π½ ^ finrank π½ K1 :=
β¨card_coset K0 q0, card_coset K1 q1β©
/-- Restriction of an ambient subspace to a selected set of coordinates. -/
def coordinateRestriction (S : Finset ΞΉ) (K : Submodule π½ (ΞΉ β π½)) :
K ββ[π½] (S β π½) where
toFun x i := x.val i.val
map_add' _ _ := rfl
map_smul' _ _ := rfl
omit [Fintype ΞΉ] in
/-- Restriction loses no information for a subspace supported on `S`. -/
theorem coordinateRestriction_injective (S : Finset ΞΉ) (K : Submodule π½ (ΞΉ β π½))
(hK : β x β K, β i, i β S β x i = 0) :
Function.Injective (coordinateRestriction S K) := by
intro x y hxy
apply Subtype.ext
funext i
by_cases hi : i β S
Β· exact congrFun hxy β¨i, hiβ©
Β· rw [hK x.val x.property i hi, hK y.val y.property i hi]
/-- The same supported subspace, viewed as a subspace of its local coordinates. -/
abbrev restrictedSubspace (S : Finset ΞΉ) (K : Submodule π½ (ΞΉ β π½)) :
Submodule π½ (S β π½) :=
LinearMap.range (coordinateRestriction S K)
/-- Ambient and local presentations of a supported subspace are linearly equivalent. -/
noncomputable def restrictionEquiv (S : Finset ΞΉ) (K : Submodule π½ (ΞΉ β π½))
(hK : β x β K, β i, i β S β x i = 0) :
K ββ[π½] restrictedSubspace S K :=
LinearEquiv.ofInjective (coordinateRestriction S K)
(coordinateRestriction_injective S K hK)
omit [Fintype ΞΉ] in
theorem finrank_restrictedSubspace (S : Finset ΞΉ) (K : Submodule π½ (ΞΉ β π½))
(hK : β x β K, β i, i β S β x i = 0) :
finrank π½ (restrictedSubspace S K) = finrank π½ K :=
(restrictionEquiv S K hK).finrank_eq.symm
/-- The outer-count theorem with precisely the ambient-subspace support
hypotheses of the interpolation layout. -/
theorem card_supported_outer (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 K1 : Submodule π½ (ΞΉ β π½))
(h0 : β x β K0, β i, i β S0 β x i = 0)
(h1 : β x β K1, β i, i β S1 β x i = 0) :
Nat.card (CoordinateOuterData S0 S1
(restrictedSubspace S0 K0) (restrictedSubspace S1 K1)) =
Nat.card π½ ^ (Fintype.card ΞΉ - finrank π½ K0 - finrank π½ K1) := by
rw [card_coordinate_outer S0 S1 h,
finrank_restrictedSubspace S0 K0 h0, finrank_restrictedSubspace S1 K1 h1]
omit [Fintype ΞΉ] in
/-- A supported ambient vector whose restriction lies in the restricted
subspace already lies in the original ambient subspace. -/
theorem mem_of_restriction_mem (S : Finset ΞΉ) (K : Submodule π½ (ΞΉ β π½))
(hK : β x β K, β i, i β S β x i = 0) (x : ΞΉ β π½)
(hx : β i, i β S β x i = 0)
(hr : (fun i : S => x i.val) β restrictedSubspace S K) : x β K := by
obtain β¨r, hrβ© := hr
have heq : x = r.val := by
funext i
by_cases hi : i β S
Β· exact (congrFun hr β¨i, hiβ©).symm
Β· rw [hx i hi, hK r.val r.property i hi]
exact heq.symm βΈ r.property
omit [Fintype ΞΉ] in
/-- Equal restrictions modulo the local subspace and equality outside its
support imply that the ambient difference belongs to the original subspace. -/
theorem sub_mem_of_local_quotient_eq (S : Finset ΞΉ) (K : Submodule π½ (ΞΉ β π½))
(hK : β x β K, β i, i β S β x i = 0) (x y : ΞΉ β π½)
(houtside : β i, i β S β x i = y i)
(hq : (Submodule.Quotient.mk (fun i : S => x i.val) :
(S β π½) β§Έ restrictedSubspace S K) =
Submodule.Quotient.mk (fun i : S => y i.val)) : x - y β K := by
apply mem_of_restriction_mem S K hK (x - y)
Β· intro i hi
exact sub_eq_zero.mpr (houtside i hi)
Β· exact (Submodule.Quotient.eq (restrictedSubspace S K)).mp hq
/-- With outer data and the right point fixed, varying the left point within
its local coset changes the ambient assignment by a vector of the global `K0`. -/
theorem coordinateReconstruct_left_sub_mem (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 K1 : Submodule π½ (ΞΉ β π½))
(hK0 : β x β K0, β i, i β S0 β x i = 0)
(o : CoordinateOuterData S0 S1 (restrictedSubspace S0 K0) (restrictedSubspace S1 K1))
(x0 y0 : CosetFiber (restrictedSubspace S0 K0) o.2.1)
(x1 : CosetFiber (restrictedSubspace S1 K1) o.2.2) :
coordinateReconstruct S0 S1 h _ _ o x0 x1 -
coordinateReconstruct S0 S1 h _ _ o y0 x1 β K0 := by
have hx := coordinateReconstruct_components S0 S1 h _ _ o x0 x1
have hy := coordinateReconstruct_components S0 S1 h _ _ o y0 x1
apply sub_mem_of_local_quotient_eq S0 K0 hK0
Β· intro i hi0
by_cases hi1 : i β S1
Β· exact congrFun (hx.2.2.trans hy.2.2.symm) β¨i, hi1β©
Β· exact congrFun (hx.1.trans hy.1.symm)
β¨i, by simp only [Finset.mem_compl, Finset.mem_union, not_or]; exact β¨hi0, hi1β©β©
Β· rw [hx.2.1, hy.2.1]
exact x0.property.trans y0.property.symm
/-- The symmetric global-subspace difference statement for the right point. -/
theorem coordinateReconstruct_right_sub_mem (S0 S1 : Finset ΞΉ) (h : Disjoint S0 S1)
(K0 K1 : Submodule π½ (ΞΉ β π½))
(hK1 : β x β K1, β i, i β S1 β x i = 0)
(o : CoordinateOuterData S0 S1 (restrictedSubspace S0 K0) (restrictedSubspace S1 K1))
(x0 : CosetFiber (restrictedSubspace S0 K0) o.2.1)
(x1 y1 : CosetFiber (restrictedSubspace S1 K1) o.2.2) :
coordinateReconstruct S0 S1 h _ _ o x0 x1 -
coordinateReconstruct S0 S1 h _ _ o x0 y1 β K1 := by
have hx := coordinateReconstruct_components S0 S1 h _ _ o x0 x1
have hy := coordinateReconstruct_components S0 S1 h _ _ o x0 y1
apply sub_mem_of_local_quotient_eq S1 K1 hK1
Β· intro i hi1
by_cases hi0 : i β S0
Β· exact congrFun (hx.2.1.trans hy.2.1.symm) β¨i, hi0β©
Β· exact congrFun (hx.1.trans hy.1.symm)
β¨i, by simp only [Finset.mem_compl, Finset.mem_union, not_or]; exact β¨hi0, hi1β©β©
Β· rw [hx.2.2, hy.2.2]
exact x1.property.trans y1.property.symm
end Coordinates
end SubexponentialSAT.CosetCardinality
end OAI.Algorithms
|