Download data/lean/OAI/Algorithms/SubexponentialSAT/CosetCardinality.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 21.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/CosetCardinality.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algorithms/SubexponentialSAT/CosetCardinality.lean
-
curl -L -o CosetCardinality.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/CosetCardinality.lean
21.1 kB
| import OAI.Algorithms.SubexponentialSAT.LeanCompat | |
| namespace OAI.Algorithms | |
| /-! | |
| 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 | |