Buckets:
| import OAI.Algorithms.SubexponentialSAT.LeanCompat | |
| import OAI.Algorithms.SubexponentialSAT.Types | |
| namespace OAI.Algorithms | |
| /-! | |
| # Dimension of the universal fixed subspace | |
| Collecting finitely many linear constraints into the product of their ranges | |
| proves that their common kernel loses at most the sum of their ranks. We apply | |
| this to restrictions of coordinate vectors followed by the map id - M. | |
| All vector spaces in this file are over the same field; the result therefore | |
| applies over the base field, without an extension-degree loss. The numerical | |
| bounds are stated as inequalities of natural numbers with denominators cleared. | |
| -/ | |
| namespace SubexponentialSAT.SubspaceDimension | |
| open Module | |
| open scoped BigOperators | |
| section CommonKernel | |
| variable {π V ΞΉ : Type*} [Field π] [AddCommGroup V] [Module π V] | |
| variable [Fintype ΞΉ] [FiniteDimensional π V] | |
| variable {W : ΞΉ β Type*} [β i, AddCommGroup (W i)] [β i, Module π (W i)] | |
| /-- The vectors satisfying every constraint. -/ | |
| def commonKernel (A : (i : ΞΉ) β V ββ[π] W i) : Submodule π V := | |
| β¨ i, LinearMap.ker (A i) | |
| omit [Fintype ΞΉ] [FiniteDimensional π V] in | |
| @[simp] theorem mem_commonKernel (A : (i : ΞΉ) β V ββ[π] W i) (v : V) : | |
| v β commonKernel A β β i, A i v = 0 := by | |
| simp [commonKernel] | |
| /-- Codimension subadditivity, with the codimension written without subtraction. | |
| No disjointness or independence between the constraints is required. -/ | |
| theorem finrank_le_commonKernel_add_sum_range | |
| (A : (i : ΞΉ) β V ββ[π] W i) : | |
| finrank π V β€ finrank π (commonKernel A) + | |
| β i, finrank π (LinearMap.range (A i)) := by | |
| let F : V ββ[π] ((i : ΞΉ) β LinearMap.range (A i)) := | |
| LinearMap.pi fun i => (A i).rangeRestrict | |
| have hker : LinearMap.ker F = commonKernel A := by | |
| simp only [F, LinearMap.ker_pi, LinearMap.ker_rangeRestrict, commonKernel] | |
| have hrange := Submodule.finrank_le (LinearMap.range F) | |
| rw [Module.finrank_pi_fintype] at hrange | |
| have hdim := F.finrank_range_add_finrank_ker | |
| rw [hker] at hdim | |
| omega | |
| /-- The usual natural-number codimension formulation. -/ | |
| theorem codim_commonKernel_le_sum_range | |
| (A : (i : ΞΉ) β V ββ[π] W i) : | |
| finrank π V - finrank π (commonKernel A) β€ | |
| β i, finrank π (LinearMap.range (A i)) := by | |
| have := finrank_le_commonKernel_add_sum_range A | |
| omega | |
| end CommonKernel | |
| section Coordinates | |
| variable {π Ξ± ΞΉ : Type*} [Field π] [Fintype ΞΉ] | |
| variable (S : Set Ξ±) (J : ΞΉ β Set Ξ±) (hJ : β i, J i β S) | |
| variable [Fintype S] [β i, Fintype (J i)] | |
| /-- Restriction from a supported coordinate space to a smaller coordinate set. -/ | |
| def coordinateRestriction (i : ΞΉ) : (S β π) ββ[π] (J i β π) where | |
| toFun v u := v β¨u.val, hJ i u.propertyβ© | |
| map_add' _ _ := rfl | |
| map_smul' _ _ := rfl | |
| /-- Every slot's restricted vector is required to be fixed by its matrix. -/ | |
| def coordinateFixedSpace | |
| (M : (i : ΞΉ) β (J i β π) ββ[π] (J i β π)) : | |
| Submodule π (S β π) := | |
| commonKernel fun i => | |
| (LinearMap.id - M i).comp (coordinateRestriction S J hJ i) | |
| omit [Fintype ΞΉ] [Fintype βS] [(i : ΞΉ) β Fintype β(J i)] in | |
| @[simp] theorem mem_coordinateFixedSpace | |
| (M : (i : ΞΉ) β (J i β π) ββ[π] (J i β π)) (v : S β π) : | |
| v β coordinateFixedSpace S J hJ M β | |
| β i, coordinateRestriction S J hJ i v = | |
| M i (coordinateRestriction S J hJ i v) := by | |
| simp [coordinateFixedSpace, sub_eq_zero] | |
| omit [Fintype ΞΉ] [Fintype βS] in | |
| /-- Applying a coordinate restriction before a constraint cannot increase rank. -/ | |
| theorem finrank_range_restricted_le | |
| (M : (i : ΞΉ) β (J i β π) ββ[π] (J i β π)) (i : ΞΉ) : | |
| finrank π (LinearMap.range | |
| ((LinearMap.id - M i).comp (coordinateRestriction S J hJ i))) β€ | |
| finrank π (LinearMap.range (LinearMap.id - M i)) := | |
| Submodule.finrank_mono (LinearMap.range_comp_le_range _ _) | |
| /-- The universal-block dimension bound before inserting the numerical rank | |
| estimate. The ambient dimension is exactly the size of the supported side. -/ | |
| theorem card_side_le_finrank_fixed_add_sum_defect | |
| (M : (i : ΞΉ) β (J i β π) ββ[π] (J i β π)) : | |
| Fintype.card S β€ finrank π (coordinateFixedSpace S J hJ M) + | |
| β i, finrank π (LinearMap.range (LinearMap.id - M i)) := by | |
| have h := finrank_le_commonKernel_add_sum_range fun i => | |
| (LinearMap.id - M i).comp (coordinateRestriction S J hJ i) | |
| rw [Module.finrank_pi] at h | |
| exact h.trans (Nat.add_le_add_left | |
| (Finset.sum_le_sum fun i _ => finrank_range_restricted_le S J hJ M i) _) | |
| end Coordinates | |
| section SupportedCoordinates | |
| variable {π Ξ± ΞΉ : Type*} [Field π] [Fintype ΞΉ] [Fintype Ξ±] | |
| variable (S : Set Ξ±) (J : ΞΉ β Set Ξ±) (hJ : β i, J i β S) | |
| variable [Fintype S] [β i, Fintype (J i)] | |
| /-- Realize the supported coordinate space inside the full coordinate space. -/ | |
| noncomputable def extendByZero : (S β π) ββ[π] (Ξ± β π) := by | |
| classical | |
| exact | |
| { toFun := fun v u => if hu : u β S then v β¨u, huβ© else 0 | |
| map_add' := by | |
| intro v w | |
| funext u | |
| by_cases hu : u β S <;> simp [hu] | |
| map_smul' := by | |
| intro c v | |
| funext u | |
| by_cases hu : u β S <;> simp [hu] } | |
| omit [Fintype Ξ±] [Fintype βS] in | |
| theorem extendByZero_injective : | |
| Function.Injective (extendByZero (π := π) S) := by | |
| classical | |
| intro v w h | |
| funext u | |
| have hu := congrFun h u.val | |
| simpa [extendByZero, u.property] using hu | |
| /-- The actual fixed subspace of full coordinate vectors, supported on S. -/ | |
| noncomputable def supportedFixedSpace | |
| (M : (i : ΞΉ) β (J i β π) ββ[π] (J i β π)) : | |
| Submodule π (Ξ± β π) := | |
| (coordinateFixedSpace S J hJ M).map (extendByZero S) | |
| omit [Fintype ΞΉ] [Fintype Ξ±] [Fintype βS] [(i : ΞΉ) β Fintype β(J i)] in | |
| theorem finrank_supportedFixedSpace | |
| (M : (i : ΞΉ) β (J i β π) ββ[π] (J i β π)) : | |
| finrank π (supportedFixedSpace S J hJ M) = | |
| finrank π (coordinateFixedSpace S J hJ M) := | |
| (Submodule.equivMapOfInjective (extendByZero S) | |
| (extendByZero_injective S) (coordinateFixedSpace S J hJ M)).finrank_eq.symm | |
| omit [Fintype Ξ±] [(i : ΞΉ) β Fintype β(J i)] in | |
| omit [Fintype ΞΉ] [Fintype βS] in | |
| theorem mem_supportedFixedSpace_iff | |
| (M : (i : ΞΉ) β (J i β π) ββ[π] (J i β π)) (r : Ξ± β π) : | |
| r β supportedFixedSpace S J hJ M β | |
| (β u, u β S β r u = 0) β§ | |
| β i, (fun u : J i => r u.val) = M i (fun u : J i => r u.val) := by | |
| classical | |
| rw [supportedFixedSpace, Submodule.mem_map] | |
| constructor | |
| Β· rintro β¨v, hv, rflβ© | |
| constructor | |
| Β· intro u hu | |
| simp [extendByZero, hu] | |
| Β· intro i | |
| have hi := (mem_coordinateFixedSpace S J hJ M v).mp hv i | |
| have hext : | |
| (fun u : J i => extendByZero S v u.val) = | |
| coordinateRestriction S J hJ i v := by | |
| funext u | |
| simp [extendByZero, coordinateRestriction, hJ i u.property] | |
| rw [hext] | |
| exact hi | |
| Β· rintro β¨hsupport, hfixedβ© | |
| refine β¨fun u : S => r u.val, ?_, ?_β© | |
| Β· apply (mem_coordinateFixedSpace S J hJ M _).mpr | |
| simpa [coordinateRestriction] using hfixed | |
| Β· funext u | |
| by_cases hu : u β S | |
| Β· simp [extendByZero, hu] | |
| Β· simp [extendByZero, hu, hsupport u hu] | |
| end SupportedCoordinates | |
| section NumericalBounds | |
| /-- Summing the per-slot loss bound cancels the number of slots. This also | |
| handles zero slots, where the sum is empty. -/ | |
| theorem sixteen_mul_sum_le {Ξ s : β} (r : Fin Ξ β β) | |
| (hbudget : β i, 16 * Ξ * r i β€ s) : | |
| 16 * β i, r i β€ s := by | |
| by_cases hzero : Ξ = 0 | |
| Β· subst Ξ | |
| simp | |
| Β· have hpos : 0 < Ξ := Nat.pos_of_ne_zero hzero | |
| have hsum := Finset.sum_le_sum (s := Finset.univ) (fun i _ => hbudget i) | |
| simp only [β Finset.mul_sum, Finset.sum_const, Finset.card_univ, | |
| Fintype.card_fin, smul_eq_mul] at hsum | |
| apply Nat.le_of_mul_le_mul_left (c := Ξ) _ hpos | |
| nlinarith [hsum] | |
| /-- The stronger 15/16 bound, using only exact natural-number inequalities. -/ | |
| theorem fifteen_sixteenths_of_rank_budget {Ξ s d : β} (r : Fin Ξ β β) | |
| (hdim : s β€ d + β i, r i) | |
| (hbudget : β i, 16 * Ξ * r i β€ s) : | |
| 15 * s β€ 16 * d := by | |
| have := sixteen_mul_sum_le r hbudget | |
| omega | |
| /-- Weakening 15/16 to the 7/8 proportion stated in (5.7). -/ | |
| theorem seven_eighths_of_fifteen_sixteenths {s d : β} | |
| (h : 15 * s β€ 16 * d) : 7 * s β€ 8 * d := by | |
| omega | |
| end NumericalBounds | |
| section UniversalBlock | |
| variable {π : Type*} [Field π] {Q Ξ : β} | |
| /-- The universal-block subspace K^B(t,g), as full coordinate vectors. -/ | |
| noncomputable def universalFixedSpace (t : Fin Q) (g : Bool) | |
| (M : (i : Fin Ξ) β | |
| (Types.Joint t g i β π) ββ[π] (Types.Joint t g i β π)) : | |
| Submodule π (Types.UniversalType Q Ξ β π) := | |
| supportedFixedSpace (Types.side t g) (Types.joint t g) | |
| (Types.joint_subset_side t g) M | |
| theorem universalFixedSpace_mem_iff (t : Fin Q) (g : Bool) | |
| (M : (i : Fin Ξ) β | |
| (Types.Joint t g i β π) ββ[π] (Types.Joint t g i β π)) | |
| (r : Types.UniversalType Q Ξ β π) : | |
| r β universalFixedSpace t g M β | |
| (β u, u β Types.side t g β r u = 0) β§ | |
| β i, (fun u : Types.Joint t g i => r u.val) = | |
| M i (fun u : Types.Joint t g i => r u.val) := | |
| mem_supportedFixedSpace_iff _ _ _ _ _ | |
| /-- The rank bound |J|/(8Ξ), with |J| = |S|/2, gives the stronger 15/16 | |
| proportion. It is valid over the base field used to define M. -/ | |
| theorem universalFixedSpace_fifteen_sixteenths (t : Fin Q) (g : Bool) | |
| (M : (i : Fin Ξ) β | |
| (Types.Joint t g i β π) ββ[π] (Types.Joint t g i β π)) | |
| (hrank : β i, 8 * Ξ * | |
| finrank π (LinearMap.range (LinearMap.id - M i)) β€ | |
| Fintype.card (Types.Joint t g i)) : | |
| 15 * Fintype.card (Types.Side (Ξ := Ξ) t g) β€ | |
| 16 * finrank π (universalFixedSpace t g M) := by | |
| rw [universalFixedSpace, finrank_supportedFixedSpace] | |
| apply fifteen_sixteenths_of_rank_budget | |
| (fun i => finrank π (LinearMap.range (LinearMap.id - M i))) | |
| Β· exact card_side_le_finrank_fixed_add_sum_defect _ _ _ _ | |
| Β· intro i | |
| have h := hrank i | |
| have hcard := Types.card_side_eq_two_mul_joint t g i | |
| nlinarith | |
| /-- Equation (5.7), with denominators cleared. -/ | |
| theorem universalFixedSpace_seven_eighths (t : Fin Q) (g : Bool) | |
| (M : (i : Fin Ξ) β | |
| (Types.Joint t g i β π) ββ[π] (Types.Joint t g i β π)) | |
| (hrank : β i, 8 * Ξ * | |
| finrank π (LinearMap.range (LinearMap.id - M i)) β€ | |
| Fintype.card (Types.Joint t g i)) : | |
| 7 * Fintype.card (Types.Side (Ξ := Ξ) t g) β€ | |
| 8 * finrank π (universalFixedSpace t g M) := | |
| seven_eighths_of_fifteen_sixteenths | |
| (universalFixedSpace_fifteen_sixteenths t g M hrank) | |
| /-- Relative to the entire universal block of size N, the stronger bound is | |
| 15 N β€ 32 dim K. The exact cardinality identities avoid natural division. -/ | |
| theorem universalFixedSpace_fifteen_thirtyseconds (t : Fin Q) (g : Bool) | |
| (M : (i : Fin Ξ) β | |
| (Types.Joint t g i β π) ββ[π] (Types.Joint t g i β π)) | |
| (hrank : β i, 8 * Ξ * | |
| finrank π (LinearMap.range (LinearMap.id - M i)) β€ | |
| Fintype.card (Types.Joint t g i)) : | |
| 15 * Types.blockSize Q Ξ β€ | |
| 32 * finrank π (universalFixedSpace t g M) := by | |
| have h := universalFixedSpace_fifteen_sixteenths t g M hrank | |
| have hcard := Types.card_full_eq_two_mul_side (Ξ := Ξ) t g | |
| rw [Types.card_universalType] at hcard | |
| dsimp [Types.blockSize] | |
| omega | |
| /-- The weaker full-block bound used by the packing argument. -/ | |
| theorem universalFixedSpace_seven_sixteenths (t : Fin Q) (g : Bool) | |
| (M : (i : Fin Ξ) β | |
| (Types.Joint t g i β π) ββ[π] (Types.Joint t g i β π)) | |
| (hrank : β i, 8 * Ξ * | |
| finrank π (LinearMap.range (LinearMap.id - M i)) β€ | |
| Fintype.card (Types.Joint t g i)) : | |
| 7 * Types.blockSize Q Ξ β€ | |
| 16 * finrank π (universalFixedSpace t g M) := by | |
| have h := universalFixedSpace_fifteen_thirtyseconds t g M hrank | |
| omega | |
| end UniversalBlock | |
| end SubexponentialSAT.SubspaceDimension | |
| end OAI.Algorithms | |
Xet Storage Details
- Size:
- 12.4 kB
- Xet hash:
- c786d0e27c3e274332bd71b0b5881e9c2e5cc79ed57df47b466bf563c5fd651b
Β·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.