Download data/lean/OAI/Computability/MaxCut/PCP/CayleySpectral.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 38.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/MaxCut/PCP/CayleySpectral.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/MaxCut/PCP/CayleySpectral.lean
-
curl -L -o CayleySpectral.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/MaxCut/PCP/CayleySpectral.lean
38.4 kB
| import Mathlib | |
| import OAI.Computability.MaxCut.PCP.CayleySampling | |
| namespace OAI | |
| /-! | |
| # Walsh diagonalization of actual Boolean-cube Cayley graphs | |
| Every port is an indexed generator. The rotation keeps the port and adds its | |
| generator by pointwise xor, so loops and repeated generators keep their full | |
| multiplicity. The Fourier multiplier and energy estimate are proved for this | |
| actual averaging operator; no Fourier/operator compatibility is assumed. | |
| -/ | |
| noncomputable section | |
| namespace MaxCutGames.Foundations.PCP.CayleySpectral | |
| open scoped BigOperators | |
| open Finset | |
| open MaxCutGames.Foundations.Hastad | |
| open PoweringWalks | |
| variable {I D : Type*} | |
| def zeroFrequency : Cube I := fun _ => false | |
| theorem cubeXor_cancel_right (x y : Cube I) : | |
| cubeXor (cubeXor x y) y = x := by | |
| funext i | |
| cases hx : x i <;> cases hy : y i <;> simp [cubeXor, hx, hy] | |
| theorem cubeXor_assoc (x y z : Cube I) : | |
| cubeXor (cubeXor x y) z = cubeXor x (cubeXor y z) := by | |
| funext i | |
| cases hx : x i <;> cases hy : y i <;> cases hz : z i <;> | |
| simp [cubeXor, hx, hy, hz] | |
| @[simp] theorem cubeXor_zeroFrequency (x : Cube I) : | |
| cubeXor x zeroFrequency = x := by | |
| funext i | |
| cases hx : x i <;> simp [cubeXor, zeroFrequency, hx] | |
| /-- Uniform cube measure is invariant under this explicit xor translation. -/ | |
| def xorTranslation (y : Cube I) : Cube I β Cube I where | |
| toFun x := cubeXor x y | |
| invFun x := cubeXor x y | |
| left_inv x := cubeXor_cancel_right x y | |
| right_inv x := cubeXor_cancel_right x y | |
| def rotate (g : D β Cube I) (p : Cube I Γ D) : Cube I Γ D := | |
| (cubeXor p.1 (g p.2), p.2) | |
| theorem rotate_involutive (g : D β Cube I) : Function.Involutive (rotate g) := by | |
| rintro β¨x, dβ© | |
| change (cubeXor (cubeXor x (g d)) (g d), d) = (x, d) | |
| rw [cubeXor_cancel_right] | |
| /-- The undirected regular port graph generated by the indexed cube vectors. -/ | |
| def cayleyGraph (g : D β Cube I) : PortGraph (Cube I) D where | |
| rot := | |
| { toFun := rotate g | |
| invFun := rotate g | |
| left_inv := rotate_involutive g | |
| right_inv := rotate_involutive g } | |
| rot_involutive := rotate_involutive g | |
| @[simp] theorem cayleyGraph_rot (g : D β Cube I) (x : Cube I) (d : D) : | |
| (cayleyGraph g).rot (x, d) = (cubeXor x (g d), d) := rfl | |
| /-- Expose the first actual port in a finite port word. -/ | |
| def splitPortWord (n : Nat) : (Fin (n + 1) β D) β D Γ (Fin n β D) where | |
| toFun p := (p 0, fun j => p j.succ) | |
| invFun z := Fin.cases z.1 z.2 | |
| left_inv p := by | |
| funext j | |
| exact Fin.cases rfl (fun _ => rfl) j | |
| right_inv z := rfl | |
| /-- The generator of a powered port is the xor of its original port word. -/ | |
| def powerGenerators (g : D β Cube I) : (n : Nat) β (Fin n β D) β Cube I | |
| | 0, _ => zeroFrequency | |
| | n + 1, p => cubeXor (g (p 0)) (powerGenerators g n (fun j => p j.succ)) | |
| /-- These are actual walk displacements, including repeated vertices and ports. -/ | |
| theorem wordEnd_eq_powerGenerators (g : D β Cube I) (n : Nat) | |
| (x : Cube I) (p : Fin n β D) : | |
| wordEnd (cayleyGraph g) n x p = cubeXor x (powerGenerators g n p) := by | |
| induction n generalizing x with | |
| | zero => simp [wordEnd, powerGenerators] | |
| | succ n ih => | |
| change wordEnd (cayleyGraph g) n (cubeXor x (g (p 0))) (fun j => p j.succ) = | |
| cubeXor x (cubeXor (g (p 0)) (powerGenerators g n (fun j => p j.succ))) | |
| rw [ih, cubeXor_assoc] | |
| variable [Fintype I] [DecidableEq I] [Fintype D] | |
| /-- Average along the actual outgoing ports of the Cayley graph. -/ | |
| def cayleyAverage (g : D β Cube I) (f : Cube I β β) (x : Cube I) : β := | |
| πΌ d, f ((cayleyGraph g).rot (x, d)).1 | |
| /-- The eigenvalue is the empirical bias of the generator characters. -/ | |
| def eigenvalue (g : D β Cube I) (s : Cube I) : β := | |
| πΌ d, walsh s (g d) | |
| omit [Fintype I] [DecidableEq I] in | |
| @[simp] theorem averagingOperator_cayleyGraph (g : D β Cube I) (f : Cube I β β) : | |
| SpectralReturn.averagingOperator (cayleyGraph g) f = cayleyAverage g f := rfl | |
| @[simp] theorem coefficient_zeroFrequency (f : Cube I β β) : | |
| coefficient f zeroFrequency = πΌ x, f x := by | |
| simp [coefficient, zeroFrequency, walsh, bitSign] | |
| /-- Change Β«variablesΒ» through xor translation in the actual Fourier average. -/ | |
| theorem coefficient_xorTranslation (f : Cube I β β) (s v : Cube I) : | |
| coefficient (fun x => f (cubeXor x v)) s = walsh s v * coefficient f s := by | |
| calc | |
| coefficient (fun x => f (cubeXor x v)) s = | |
| πΌ x, f x * walsh s (cubeXor x v) := by | |
| unfold coefficient | |
| apply Fintype.expect_equiv (xorTranslation v) | |
| intro x | |
| change f (cubeXor x v) * walsh s x = | |
| f (cubeXor x v) * walsh s (cubeXor (cubeXor x v) v) | |
| rw [cubeXor_cancel_right] | |
| _ = πΌ x, (f x * walsh s x) * walsh s v := by | |
| apply Finset.expect_congr rfl | |
| intro x _ | |
| rw [walsh_xor] | |
| ring | |
| _ = coefficient f s * walsh s v := by | |
| rw [β Finset.expect_mul] | |
| rfl | |
| _ = walsh s v * coefficient f s := mul_comm _ _ | |
| /-- Each Walsh character is an eigenvector of the actual Cayley averaging. -/ | |
| theorem cayleyAverage_walsh (g : D β Cube I) (s x : Cube I) : | |
| cayleyAverage g (walsh s) x = eigenvalue g s * walsh s x := by | |
| unfold cayleyAverage | |
| simp only [cayleyGraph_rot, walsh_xor] | |
| rw [β Finset.mul_expect] | |
| rw [mul_comm] | |
| rfl | |
| /-- Full Walsh diagonalization, obtained by swapping the two finite averages. -/ | |
| theorem coefficient_cayleyAverage (g : D β Cube I) (f : Cube I β β) (s : Cube I) : | |
| coefficient (cayleyAverage g f) s = eigenvalue g s * coefficient f s := by | |
| calc | |
| coefficient (cayleyAverage g f) s = | |
| πΌ x, πΌ d, f (cubeXor x (g d)) * walsh s x := by | |
| unfold coefficient cayleyAverage | |
| simp only [cayleyGraph_rot, Finset.expect_mul] | |
| _ = πΌ d, πΌ x, f (cubeXor x (g d)) * walsh s x := by | |
| rw [Finset.expect_comm] | |
| _ = πΌ d, walsh s (g d) * coefficient f s := by | |
| apply Finset.expect_congr rfl | |
| intro d _ | |
| exact coefficient_xorTranslation f s (g d) | |
| _ = eigenvalue g s * coefficient f s := by | |
| rw [β Finset.expect_mul] | |
| rfl | |
| /-- Uniform finite port-word splitting multiplies the actual eigenvalues. -/ | |
| theorem eigenvalue_powerGenerators (g : D β Cube I) (n : Nat) (s : Cube I) : | |
| eigenvalue (powerGenerators g n) s = eigenvalue g s ^ n := by | |
| induction n with | |
| | zero => | |
| let : Nonempty (Fin 0 β D) := β¨fun i => Fin.elim0 iβ© | |
| simp [eigenvalue, powerGenerators, zeroFrequency, walsh, bitSign] | |
| | succ n ih => | |
| calc | |
| eigenvalue (powerGenerators g (n + 1)) s = | |
| πΌ z : D Γ (Fin n β D), | |
| walsh s (cubeXor (g z.1) (powerGenerators g n z.2)) := by | |
| unfold eigenvalue | |
| apply Fintype.expect_equiv (splitPortWord n) | |
| intro p | |
| rfl | |
| _ = πΌ d, πΌ p : Fin n β D, | |
| walsh s (cubeXor (g d) (powerGenerators g n p)) := by | |
| exact SpectralReturn.mean_prod _ | |
| _ = eigenvalue g s * eigenvalue (powerGenerators g n) s := by | |
| simp_rw [walsh_xor, β Finset.mul_expect] | |
| rw [β Finset.expect_mul] | |
| rfl | |
| _ = eigenvalue g s ^ (n + 1) := by | |
| rw [ih, pow_succ, mul_comm] | |
| /-- The port degree of the powered graph is the exact number of port words. -/ | |
| theorem power_port_card (n : Nat) : | |
| Fintype.card (Fin n β D) = Fintype.card D ^ n := by | |
| simp only [Fintype.card_fun, Fintype.card_fin] | |
| theorem seven_power_port_card : | |
| Fintype.card (Fin 7 β Fin (2 ^ 16)) = (2 ^ 16) ^ 7 := by | |
| simp only [Fintype.card_fun, Fintype.card_fin] | |
| /-- A bias bound on all nonconstant generator characters contracts the actual | |
| mean-zero function energy. The constant coefficient is eliminated by its exact | |
| identification with the mean, and every other coefficient is bounded termwise. | |
| -/ | |
| theorem cayley_energy_contraction (g : D β Cube I) (lambda : β) (_hlambda : 0 β€ lambda) | |
| (hbias : β s : Cube I, s β zeroFrequency β |eigenvalue g s| β€ lambda) | |
| (f : Cube I β β) (hmean : (πΌ x, f x) = 0) : | |
| (πΌ x, cayleyAverage g f x ^ 2) β€ lambda ^ 2 * (πΌ x, f x ^ 2) := by | |
| classical | |
| have hzero : coefficient f zeroFrequency = 0 := by | |
| rw [coefficient_zeroFrequency] | |
| exact hmean | |
| calc | |
| (πΌ x, cayleyAverage g f x ^ 2) = | |
| β s, coefficient (cayleyAverage g f) s ^ 2 := (walsh_parseval _).symm | |
| _ = β s, (eigenvalue g s * coefficient f s) ^ 2 := by | |
| simp only [coefficient_cayleyAverage] | |
| _ β€ β s, lambda ^ 2 * coefficient f s ^ 2 := by | |
| apply Finset.sum_le_sum | |
| intro s _ | |
| by_cases hs : s = zeroFrequency | |
| Β· subst s | |
| simp [hzero] | |
| Β· have hb := hbias s hs | |
| have hlo : -lambda β€ eigenvalue g s := (abs_le.mp hb).1 | |
| have hhi : eigenvalue g s β€ lambda := (abs_le.mp hb).2 | |
| have hprod : 0 β€ (lambda - eigenvalue g s) * (lambda + eigenvalue g s) := | |
| mul_nonneg (sub_nonneg.mpr hhi) (by linarith) | |
| have hsq : eigenvalue g s ^ 2 β€ lambda ^ 2 := by nlinarith | |
| calc | |
| (eigenvalue g s * coefficient f s) ^ 2 = | |
| eigenvalue g s ^ 2 * coefficient f s ^ 2 := by rw [mul_pow] | |
| _ β€ lambda ^ 2 * coefficient f s ^ 2 := | |
| mul_le_mul_of_nonneg_right hsq (sq_nonneg _) | |
| _ = lambda ^ 2 * (πΌ x, f x ^ 2) := by | |
| rw [β Finset.mul_sum, walsh_parseval] | |
| /-- The Fourier proof supplies the graph certificate used in return bounds. -/ | |
| theorem cayley_spectralCertificate (g : D β Cube I) (lambda : β) | |
| (hlambda : 0 β€ lambda) (hlambdaone : lambda < 1) | |
| (hbias : β s : Cube I, s β zeroFrequency β |eigenvalue g s| β€ lambda) : | |
| SpectralReturn.SpectralCertificate (cayleyGraph g) lambda where | |
| nonnegative := hlambda | |
| lt_one := hlambdaone | |
| contraction := by | |
| intro f hf | |
| change (πΌ x, cayleyAverage g f x ^ 2) β€ lambda ^ 2 * (πΌ x, f x ^ 2) | |
| exact cayley_energy_contraction g lambda hlambda hbias f hf | |
| theorem power_eigenvalue_bound (g : D β Cube I) (lambda : β) (hlambda : 0 β€ lambda) | |
| (hbias : β s : Cube I, s β zeroFrequency β |eigenvalue g s| β€ lambda) | |
| (n : Nat) (s : Cube I) (hs : s β zeroFrequency) : | |
| |eigenvalue (powerGenerators g n) s| β€ lambda ^ n := by | |
| rw [eigenvalue_powerGenerators, abs_pow] | |
| induction n with | |
| | zero => simp | |
| | succ n ih => | |
| rw [pow_succ, pow_succ] | |
| exact mul_le_mul ih (hbias s hs) (abs_nonneg _) (pow_nonneg hlambda _) | |
| /-- Seven actual generator steps turn one-half character bias into `2β»β·`. -/ | |
| theorem sevenStep_halfCertificate (g : D β Cube I) | |
| (hbias : β s : Cube I, s β zeroFrequency β |eigenvalue g s| β€ (1 / 2 : β)) : | |
| SpectralReturn.SpectralCertificate (cayleyGraph (powerGenerators g 7)) | |
| ((1 / 2 : β) ^ 7) := by | |
| apply cayley_spectralCertificate | |
| Β· norm_num | |
| Β· norm_num | |
| Β· intro s hs | |
| exact power_eigenvalue_bound g (1 / 2) (by norm_num) hbias 7 s hs | |
| end MaxCutGames.Foundations.PCP.CayleySpectral | |
| end | |
| /-! | |
| # Finite existence of the Cayley expander base | |
| The sample space is the actual finite type of indexed Boolean-cube generators. | |
| For each nonzero character, the checked sign sampling equivalence supplies its | |
| uniform word law. A finite union bound then selects a generator family whose | |
| nonconstant character biases are small. There is no random-graph hypothesis. | |
| The fixed numbers below are manipulated symbolically; no enumeration of the | |
| generator sample space is executed. The subsequent square-and-zigzag family | |
| is a separate construction. | |
| -/ | |
| noncomputable section | |
| namespace MaxCutGames.Foundations.PCP.Expanders | |
| open scoped BigOperators | |
| open MaxCutGames.Foundations.Hastad | |
| open CayleySpectral | |
| abbrev Generators (n m : Nat) := Fin (4 * m) β Cube (Fin n) | |
| /-- The zero character is excluded from the bad-event count. -/ | |
| def badFrequency {n m : Nat} (g : Generators n m) (s : Cube (Fin n)) : β := | |
| if s = zeroFrequency then 0 else | |
| if CayleyTailCount.badWord m (fun d => AssignmentTester.parity s (g d)) then 1 else 0 | |
| def badMass {n m : Nat} (g : Generators n m) : β := | |
| β s : Cube (Fin n), badFrequency g s | |
| theorem badFrequency_nonnegative {n m : Nat} | |
| (g : Generators n m) (s : Cube (Fin n)) : 0 β€ badFrequency g s := by | |
| unfold badFrequency | |
| split_ifs <;> norm_num | |
| theorem mean_badFrequency_le {n m : Nat} (s : Cube (Fin n)) : | |
| (πΌ g : Generators n m, badFrequency g s) β€ 2 * (2 / 3 : β) ^ m := by | |
| classical | |
| by_cases hs : s = zeroFrequency | |
| Β· simp only [badFrequency, ite_eq_left hs, Finset.expect_const_zero] | |
| positivity | |
| Β· have hs' : s β (fun _ => false) := hs | |
| simp only [badFrequency, ite_eq_right hs] | |
| rw [CayleySampling.expect_parity_samples s hs' | |
| (fun w : Fin (4 * m) β Bool => if CayleyTailCount.badWord m w then (1 : β) else 0)] | |
| exact CayleyTailCount.twoTail_probability m (by simp) | |
| theorem mean_badMass_le (n m : Nat) (hm : 3 * (n + 2) β€ m) : | |
| (πΌ g : Generators n m, badMass g) β€ 1 / 2 := by | |
| calc | |
| _ = β s : Cube (Fin n), πΌ g : Generators n m, badFrequency g s := by | |
| unfold badMass | |
| rw [Finset.expect_sum_comm] | |
| _ β€ β _s : Cube (Fin n), 2 * (2 / 3 : β) ^ m := | |
| Finset.sum_le_sum (fun s _ => mean_badFrequency_le s) | |
| _ = (2 : β) ^ n * (2 * (2 / 3 : β) ^ m) := by | |
| simp [Cube] | |
| _ β€ 1 / 2 := CayleyTailCount.union_bound_le_half n m hm | |
| /-- Actual finite generators with a simultaneous bound for every nonconstant | |
| Walsh character. The proof selects a point with bad-event count less than one. | |
| -/ | |
| theorem exists_generators (n m : Nat) (hm : 3 * (n + 2) β€ m) : | |
| β g : Generators n m, β s : Cube (Fin n), | |
| s β zeroFrequency β |eigenvalue g s| β€ (1 / 2 : β) := by | |
| classical | |
| have hmpos : 0 < m := by omega | |
| let : Nonempty (Fin (4 * m)) := β¨β¨0, by omegaβ©β© | |
| have havg : (πΌ g : Generators n m, badMass g) < (1 : β) := | |
| lt_of_le_of_lt (mean_badMass_le n m hm) (by norm_num) | |
| obtain β¨g, _, hgβ© := Finset.exists_lt_of_expect_lt Finset.univ_nonempty havg | |
| refine β¨g, fun s hs => ?_β© | |
| have hgood : Β¬ CayleyTailCount.badWord m | |
| (fun d => AssignmentTester.parity s (g d)) := by | |
| intro hbad | |
| have hsingle : badFrequency g s β€ badMass g := | |
| Finset.single_le_sum (fun t _ => badFrequency_nonnegative g t) (Finset.mem_univ s) | |
| simp only [badFrequency, ite_eq_right hs, ite_eq_left hbad] at hsingle | |
| exact (not_le_of_gt hg) hsingle | |
| unfold eigenvalue | |
| simp_rw [β AssignmentTester.bitSign_parity] | |
| exact CayleyTailCount.not_badWord_bias m (by simp) hmpos _ hgood | |
| def baseDimension : Nat := 448 | |
| def initialDegree : Nat := 2 ^ 16 | |
| def initialQuarterDegree : Nat := 2 ^ 14 | |
| def basePower : Nat := 7 | |
| theorem base_arithmetic : | |
| 4 * initialQuarterDegree = initialDegree β§ | |
| 3 * (baseDimension + 2) β€ initialQuarterDegree β§ | |
| (2 : Nat) ^ baseDimension = (initialDegree ^ basePower) ^ 4 β§ | |
| (1 / 2 : β) ^ basePower β€ 1 / 100 := by | |
| refine β¨?_, ?_, ?_, ?_β© | |
| Β· norm_num [initialDegree, initialQuarterDegree] | |
| Β· norm_num [baseDimension, initialQuarterDegree] | |
| Β· dsimp only [baseDimension, initialDegree, basePower] | |
| rw [β pow_mul, β pow_mul] | |
| Β· norm_num [basePower] | |
| theorem exists_initial_generators : | |
| β g : Generators baseDimension initialQuarterDegree, | |
| β s : Cube (Fin baseDimension), s β zeroFrequency β | |
| |eigenvalue g s| β€ (1 / 2 : β) := | |
| exists_generators _ _ base_arithmetic.2.1 | |
| abbrev BaseVertex := Cube (Fin baseDimension) | |
| abbrev BasePort := Fin basePower β Fin (4 * initialQuarterDegree) | |
| def baseDegree : Nat := initialDegree ^ basePower | |
| theorem card_basePort : Fintype.card BasePort = baseDegree := by | |
| simp only [BasePort, Fintype.card_fun, Fintype.card_fin] | |
| rw [base_arithmetic.1] | |
| rfl | |
| theorem card_baseVertex : Fintype.card BaseVertex = baseDegree ^ 4 := by | |
| simpa only [BaseVertex, Cube, Fintype.card_fun, Fintype.card_bool, | |
| Fintype.card_fin, baseDegree] using base_arithmetic.2.2.1 | |
| /-- A genuine finite regular graph with the exact degree/size relation needed | |
| for zigzag. Its spectral certificate follows from the actual generator witness. | |
| -/ | |
| theorem exists_baseGraph : | |
| β H : PoweringWalks.PortGraph BaseVertex BasePort, | |
| SpectralReturn.SpectralCertificate H (1 / 100 : β) := by | |
| obtain β¨g, hgβ© := exists_initial_generators | |
| refine β¨cayleyGraph (powerGenerators g basePower), ?_β© | |
| apply cayley_spectralCertificate | |
| Β· norm_num | |
| Β· norm_num | |
| Β· intro s hs | |
| exact (power_eigenvalue_bound g (1 / 2) (by norm_num) hg basePower s hs).trans | |
| base_arithmetic.2.2.2 | |
| end MaxCutGames.Foundations.PCP.Expanders | |
| end | |
| /-! Exact changes of finite vertex and port coordinates. The graph rotation and | |
| its normalized averaging operator are transported by the same equivalences. -/ | |
| namespace MaxCutGames.Foundations.PCP.GraphTransport | |
| open PoweringWalks SpectralReturn | |
| variable {V W D E : Type*} | |
| def reindex (G : PortGraph V D) (vertices : V β W) (ports : D β E) : | |
| PortGraph W E where | |
| rot := (Equiv.prodCongr vertices ports).symm.trans | |
| (G.rot.trans (Equiv.prodCongr vertices ports)) | |
| rot_involutive := by | |
| intro x | |
| change (Equiv.prodCongr vertices ports) | |
| (G.rot ((Equiv.prodCongr vertices ports).symm | |
| ((Equiv.prodCongr vertices ports) | |
| (G.rot ((Equiv.prodCongr vertices ports).symm x))))) = x | |
| rw [Equiv.symm_apply_apply, G.rot_involutive, Equiv.apply_symm_apply] | |
| @[simp] theorem reindex_rot (G : PortGraph V D) (vertices : V β W) | |
| (ports : D β E) (v : V) (d : D) : | |
| (reindex G vertices ports).rot (vertices v, ports d) = | |
| (vertices (G.rot (v, d)).1, ports (G.rot (v, d)).2) := by | |
| simp [reindex, Equiv.trans_apply, Prod.map] | |
| variable [Fintype V] [Fintype W] [Fintype D] [Fintype E] | |
| omit [Fintype V] [Fintype W] in | |
| theorem operator_reindex (G : PortGraph V D) (vertices : V β W) | |
| (ports : D β E) (f : W β β) (w : W) : | |
| averagingOperator (reindex G vertices ports) f w = | |
| averagingOperator G (fun v => f (vertices v)) (vertices.symm w) := by | |
| unfold averagingOperator | |
| apply Fintype.expect_equiv ports.symm | |
| intro e | |
| rfl | |
| theorem energy_reindex (vertices : V β W) (f : W β β) : | |
| energy (fun v => f (vertices v)) = energy f := | |
| mean_equiv vertices (fun w => f w ^ 2) | |
| /-- A coordinate change preserves the actual spectral certificate, including | |
| the uniform measure on the port alphabet. -/ | |
| theorem reindex_spectralCertificate (G : PortGraph V D) (vertices : V β W) | |
| (ports : D β E) (lambda : β) (certificate : SpectralCertificate G lambda) : | |
| SpectralCertificate (reindex G vertices ports) lambda where | |
| nonnegative := certificate.nonnegative | |
| lt_one := certificate.lt_one | |
| contraction := by | |
| intro f hf | |
| have hf' : mean (fun v => f (vertices v)) = 0 := | |
| (mean_equiv vertices f).trans hf | |
| have h := certificate.contraction (fun v => f (vertices v)) hf' | |
| have hout : energy (averagingOperator (reindex G vertices ports) f) = | |
| energy (averagingOperator G (fun v => f (vertices v))) := by | |
| rw [β energy_reindex vertices] | |
| congr 1 | |
| funext v | |
| rw [operator_reindex, vertices.symm_apply_apply] | |
| rw [hout, β energy_reindex vertices f] | |
| exact h | |
| end MaxCutGames.Foundations.PCP.GraphTransport | |
| /-! | |
| # Actual graph squares and zigzag products | |
| Rotations operate on actual vertex-port pairs. All returned ports are retained, | |
| including ports belonging to loops and parallel edges. Each construction is a | |
| palindrome of involutions and hence defines a reversible regular port graph. | |
| -/ | |
| namespace MaxCutGames.Foundations.PCP.ZigzagGraphs | |
| open PoweringWalks | |
| variable {V D E : Type*} | |
| /-- Regard a checked involution as a permutation with the same inverse. -/ | |
| def involutionEquiv {A : Type*} (f : A β A) (hf : Function.Involutive f) : A β A where | |
| toFun := f | |
| invFun := f | |
| left_inv := hf | |
| right_inv := hf | |
| /-- A palindrome of two involutions is itself an involution. -/ | |
| theorem palindrome_involutive {A : Type*} (B P : A β A) | |
| (hB : Function.Involutive B) (hP : Function.Involutive P) : | |
| Function.Involutive (B.trans (P.trans B)) := by | |
| intro x | |
| change B (P (B (B (P (B x))))) = x | |
| rw [hB, hP, hB] | |
| /-- Cross an original edge using the first port; retain its return port. -/ | |
| def squareFirst (G : PortGraph V D) (s : V Γ (D Γ D)) : V Γ (D Γ D) := | |
| let step := G.rot (s.1, s.2.1) | |
| (step.1, (step.2, s.2.2)) | |
| theorem squareFirst_involutive (G : PortGraph V D) : Function.Involutive (squareFirst G) := by | |
| rintro β¨v, dβ, dββ© | |
| change ((G.rot (G.rot (v, dβ))).1, ((G.rot (G.rot (v, dβ))).2, dβ)) = | |
| (v, (dβ, dβ)) | |
| rw [G.rot_involutive] | |
| def squareSwap (s : V Γ (D Γ D)) : V Γ (D Γ D) := (s.1, (s.2.2, s.2.1)) | |
| theorem squareSwap_involutive : Function.Involutive (squareSwap (V := V) (D := D)) := by | |
| rintro β¨v, dβ, dββ© | |
| rfl | |
| /-- The actual graph square. The two return ports appear in reverse order. -/ | |
| def square (G : PortGraph V D) : PortGraph V (D Γ D) := by | |
| let B := involutionEquiv (squareFirst G) (squareFirst_involutive G) | |
| let P := involutionEquiv (squareSwap (V := V) (D := D)) squareSwap_involutive | |
| exact | |
| { rot := B.trans (P.trans B) | |
| rot_involutive := palindrome_involutive B P | |
| (squareFirst_involutive G) squareSwap_involutive } | |
| @[simp] theorem square_rot_apply (G : PortGraph V D) (v : V) (dβ dβ : D) : | |
| (square G).rot (v, (dβ, dβ)) = | |
| let first := G.rot (v, dβ) | |
| let second := G.rot (first.1, dβ) | |
| (second.1, (second.2, first.2)) := rfl | |
| @[simp] theorem square_next (G : PortGraph V D) (v : V) (dβ dβ : D) : | |
| next (square G) v (dβ, dβ) = next G (next G v dβ) dβ := rfl | |
| /-- One inner step in a cloud, retaining its return port and the unused port. -/ | |
| def cloudFirst (H : PortGraph D E) (s : (V Γ D) Γ (E Γ E)) : | |
| (V Γ D) Γ (E Γ E) := | |
| let step := H.rot (s.1.2, s.2.1) | |
| ((s.1.1, step.1), (step.2, s.2.2)) | |
| theorem cloudFirst_involutive (H : PortGraph D E) : | |
| Function.Involutive (cloudFirst (V := V) H) := by | |
| rintro β¨β¨v, dβ©, β¨eβ, eββ©β© | |
| change ((v, (H.rot (H.rot (d, eβ))).1), ((H.rot (H.rot (d, eβ))).2, eβ)) = | |
| ((v, d), (eβ, eβ)) | |
| rw [H.rot_involutive] | |
| /-- Cross the outer graph edge and swap the two inner ports. -/ | |
| def crossCloud (G : PortGraph V D) (s : (V Γ D) Γ (E Γ E)) : | |
| (V Γ D) Γ (E Γ E) := (G.rot s.1, (s.2.2, s.2.1)) | |
| theorem crossCloud_involutive (G : PortGraph V D) : | |
| Function.Involutive (crossCloud (E := E) G) := by | |
| rintro β¨x, eβ, eββ© | |
| change (G.rot (G.rot x), (eβ, eβ)) = (x, (eβ, eβ)) | |
| rw [G.rot_involutive] | |
| /-- The actual zigzag product: inner step, outer edge, inner step. -/ | |
| def zigzag (G : PortGraph V D) (H : PortGraph D E) : PortGraph (V Γ D) (E Γ E) := by | |
| let B := involutionEquiv (cloudFirst (V := V) H) (cloudFirst_involutive H) | |
| let P := involutionEquiv (crossCloud (E := E) G) (crossCloud_involutive G) | |
| exact | |
| { rot := B.trans (P.trans B) | |
| rot_involutive := palindrome_involutive B P | |
| (cloudFirst_involutive H) (crossCloud_involutive G) } | |
| @[simp] theorem zigzag_rot_apply (G : PortGraph V D) (H : PortGraph D E) | |
| (v : V) (d : D) (eβ eβ : E) : | |
| (zigzag G H).rot ((v, d), (eβ, eβ)) = | |
| let first := H.rot (d, eβ) | |
| let middle := G.rot (v, first.1) | |
| let last := H.rot (middle.2, eβ) | |
| ((middle.1, last.1), (last.2, first.2)) := rfl | |
| theorem natCard_square_ports : Nat.card (D Γ D) = Nat.card D ^ 2 := by | |
| simp [Nat.card_prod, pow_two] | |
| theorem natCard_square_edges : | |
| Nat.card (Edge V (D Γ D)) = Nat.card V * Nat.card D ^ 2 := by | |
| simp [Edge, Nat.card_prod, pow_two] | |
| theorem natCard_zigzag_vertices : | |
| Nat.card (V Γ D) = Nat.card V * Nat.card D := Nat.card_prod V D | |
| theorem natCard_zigzag_ports : Nat.card (E Γ E) = Nat.card E ^ 2 := by | |
| simp [Nat.card_prod, pow_two] | |
| theorem natCard_zigzag_edges : | |
| Nat.card (Edge (V Γ D) (E Γ E)) = | |
| Nat.card V * Nat.card D * Nat.card E ^ 2 := by | |
| simp [Edge, Nat.card_prod, pow_two] | |
| /-! ## Exact averaging operators -/ | |
| noncomputable section | |
| /-- Average only the inner cloud coordinate, keeping the outer vertex fixed. -/ | |
| def cloudOperator [Fintype E] (H : PortGraph D E) (f : V Γ D β β) (x : V Γ D) : β := | |
| SpectralReturn.mean (fun e => f (x.1, (H.rot (x.2, e)).1)) | |
| /-- The permutation on cloud vertices induced by the actual outer rotation. -/ | |
| def graphPermutation (G : PortGraph V D) (f : V Γ D β β) (x : V Γ D) : β := | |
| f (G.rot x) | |
| /-- Uniform averaging on the graph square is two original averaging steps. -/ | |
| theorem averagingOperator_square [Fintype D] (G : PortGraph V D) (f : V β β) : | |
| SpectralReturn.averagingOperator (square G) f = | |
| SpectralReturn.averagingOperator G (SpectralReturn.averagingOperator G f) := by | |
| funext v | |
| let w : D Γ D β β := fun ds => f (G.rot ((G.rot (v, ds.1)).1, ds.2)).1 | |
| change SpectralReturn.mean w = | |
| SpectralReturn.mean (fun dβ => SpectralReturn.mean (fun dβ => w (dβ, dβ))) | |
| exact SpectralReturn.mean_prod w | |
| /-- The zigzag operator is precisely inner average, outer permutation, inner | |
| average. This factorization follows from the actual rotation formula. -/ | |
| theorem averagingOperator_zigzag [Fintype E] (G : PortGraph V D) | |
| (H : PortGraph D E) (f : V Γ D β β) : | |
| SpectralReturn.averagingOperator (zigzag G H) f = | |
| cloudOperator H (graphPermutation G (cloudOperator H f)) := by | |
| funext x | |
| rcases x with β¨v, dβ© | |
| let w : E Γ E β β := fun es => | |
| let first := H.rot (d, es.1) | |
| let middle := G.rot (v, first.1) | |
| let last := H.rot (middle.2, es.2) | |
| f (middle.1, last.1) | |
| change SpectralReturn.mean w = | |
| SpectralReturn.mean (fun eβ => SpectralReturn.mean (fun eβ => w (eβ, eβ))) | |
| exact SpectralReturn.mean_prod w | |
| end | |
| end MaxCutGames.Foundations.PCP.ZigzagGraphs | |
| /-! | |
| # Energy contraction for the actual zigzag graph | |
| The proof splits a function into its cloud average and its cloud-centered | |
| part. All operators are the actual graph averages from `ZigzagGraphs`. | |
| -/ | |
| namespace MaxCutGames.Foundations.PCP.ZigzagSpectral | |
| open PoweringWalks SpectralReturn ZigzagGraphs | |
| noncomputable section | |
| variable {V D E : Type*} | |
| def cloudMean [Fintype D] (f : V Γ D β β) (v : V) : β := | |
| mean (fun d => f (v, d)) | |
| def liftCloud (f : V β β) (x : V Γ D) : β := f x.1 | |
| def projection [Fintype D] (f : V Γ D β β) : V Γ D β β := | |
| liftCloud (cloudMean f) | |
| def centered [Fintype D] (f : V Γ D β β) : V Γ D β β := f - projection f | |
| theorem mean_liftCloud [Fintype V] [Fintype D] [Nonempty D] (f : V β β) : | |
| mean (liftCloud (D := D) f) = mean f := by | |
| change mean (fun x : V Γ D => f x.1) = mean f | |
| rw [mean_prod] | |
| simp only [mean_const] | |
| theorem energy_liftCloud [Fintype V] [Fintype D] [Nonempty D] (f : V β β) : | |
| energy (liftCloud (D := D) f) = energy f := | |
| mean_liftCloud (D := D) (fun v => f v ^ 2) | |
| theorem mean_cloudMean [Fintype V] [Fintype D] (f : V Γ D β β) : | |
| mean (cloudMean f) = mean f := (mean_prod f).symm | |
| theorem energy_prod [Fintype V] [Fintype D] (f : V Γ D β β) : | |
| energy f = mean (fun v => energy (fun d => f (v, d))) := | |
| mean_prod (fun x => f x ^ 2) | |
| theorem cloudMean_centered_zero [Fintype D] [Nonempty D] | |
| (f : V Γ D β β) (v : V) : cloudMean (centered f) v = 0 := by | |
| change mean (fun d => f (v, d) - cloudMean f v) = 0 | |
| rw [mean_sub, mean_const] | |
| exact sub_self _ | |
| theorem energy_centered_eq_sub [Fintype V] [Fintype D] [Nonempty D] | |
| (f : V Γ D β β) : energy (centered f) = energy f - energy (projection f) := by | |
| have hpoint (v : V) : energy (fun d => centered f (v, d)) = | |
| energy (fun d => f (v, d)) - (cloudMean f v) ^ 2 := by | |
| change energy (fun d => f (v, d) - cloudMean f v) = _ | |
| rw [energy_sub_const] | |
| change energy (fun d => f (v, d)) - 2 * cloudMean f v * cloudMean f v + | |
| (cloudMean f v) ^ 2 = _ | |
| ring | |
| have hproj : energy (projection f) = energy (cloudMean f) := energy_liftCloud _ | |
| calc | |
| energy (centered f) = mean (fun v => energy (fun d => centered f (v, d))) := | |
| energy_prod _ | |
| _ = mean (fun v => energy (fun d => f (v, d)) - (cloudMean f v) ^ 2) := by | |
| congr 1 | |
| funext v | |
| exact hpoint v | |
| _ = mean (fun v => energy (fun d => f (v, d))) - | |
| mean (fun v => (cloudMean f v) ^ 2) := mean_sub _ _ | |
| _ = energy f - energy (projection f) := by | |
| rw [β energy_prod f, hproj] | |
| rfl | |
| theorem projection_energy_decomposition [Fintype V] [Fintype D] [Nonempty D] | |
| (f : V Γ D β β) : energy f = energy (projection f) + energy (centered f) := by | |
| rw [energy_centered_eq_sub] | |
| ring | |
| theorem energy_projection_le [Fintype V] [Fintype D] [Nonempty D] | |
| (f : V Γ D β β) : energy (projection f) β€ energy f := by | |
| have h := projection_energy_decomposition f | |
| have hn := energy_nonnegative (centered f) | |
| linarith | |
| theorem energy_centered_le [Fintype V] [Fintype D] [Nonempty D] | |
| (f : V Γ D β β) : energy (centered f) β€ energy f := by | |
| rw [energy_centered_eq_sub] | |
| exact sub_le_self _ (energy_nonnegative _) | |
| /-- Squared normalized mean is bounded by normalized squared energy. -/ | |
| theorem mean_sq_le_energy {A : Type*} [Fintype A] [Nonempty A] (f : A β β) : | |
| mean f ^ 2 β€ energy f := by | |
| have h := correlation_sq_le f (fun _ => 1) | |
| simpa [correlation, energy] using h | |
| /-- Every actual reversible regular graph average is an energy contraction. -/ | |
| theorem averaging_energy_le [Fintype V] [Fintype D] [Nonempty V] [Nonempty D] | |
| (G : PortGraph V D) (f : V β β) : energy (averagingOperator G f) β€ energy f := by | |
| calc | |
| energy (averagingOperator G f) β€ mean (averagingOperator G (fun v => f v ^ 2)) := by | |
| apply mean_mono | |
| intro v | |
| exact mean_sq_le_energy (fun d => f (G.rot (v, d)).1) | |
| _ = energy f := mean_operator G _ | |
| theorem cloudOperator_add [Fintype E] (H : PortGraph D E) (f g : V Γ D β β) : | |
| cloudOperator H (f + g) = cloudOperator H f + cloudOperator H g := by | |
| funext x | |
| exact mean_add _ _ | |
| theorem cloudOperator_sub [Fintype E] (H : PortGraph D E) (f g : V Γ D β β) : | |
| cloudOperator H (f - g) = cloudOperator H f - cloudOperator H g := by | |
| funext x | |
| exact mean_sub _ _ | |
| theorem cloudOperator_projection [Fintype D] [Fintype E] [Nonempty E] | |
| (H : PortGraph D E) (f : V Γ D β β) : cloudOperator H (projection f) = projection f := by | |
| funext x | |
| change mean (fun _ : E => cloudMean f x.1) = cloudMean f x.1 | |
| exact mean_const _ | |
| theorem cloudOperator_centered [Fintype D] [Fintype E] [Nonempty E] | |
| (H : PortGraph D E) (f : V Γ D β β) : | |
| cloudOperator H (centered f) = cloudOperator H f - projection f := by | |
| unfold centered | |
| rw [cloudOperator_sub, cloudOperator_projection] | |
| theorem graphPermutation_energy [Fintype V] [Fintype D] (G : PortGraph V D) | |
| (f : V Γ D β β) : energy (graphPermutation G f) = energy f := | |
| mean_equiv G.rot (fun x => f x ^ 2) | |
| theorem cloud_energy_le [Fintype V] [Fintype D] [Fintype E] | |
| [Nonempty D] [Nonempty E] (H : PortGraph D E) (f : V Γ D β β) : | |
| energy (cloudOperator H f) β€ energy f := by | |
| calc | |
| energy (cloudOperator H f) = | |
| mean (fun v => energy (averagingOperator H (fun d => f (v, d)))) := energy_prod _ | |
| _ β€ mean (fun v => energy (fun d => f (v, d))) := | |
| mean_mono (fun v => averaging_energy_le H _) | |
| _ = energy f := (energy_prod f).symm | |
| theorem cloud_centered_contraction [Fintype V] [Fintype D] [Fintype E] | |
| (H : PortGraph D E) (lambda : β) (hH : SpectralCertificate H lambda) | |
| (f : V Γ D β β) (hzero : β v, cloudMean f v = 0) : | |
| energy (cloudOperator H f) β€ lambda ^ 2 * energy f := by | |
| calc | |
| energy (cloudOperator H f) = | |
| mean (fun v => energy (averagingOperator H (fun d => f (v, d)))) := energy_prod _ | |
| _ β€ mean (fun v => lambda ^ 2 * energy (fun d => f (v, d))) := | |
| mean_mono (fun v => hH.contraction _ (hzero v)) | |
| _ = lambda ^ 2 * mean (fun v => energy (fun d => f (v, d))) := mean_mul_left _ _ | |
| _ = lambda ^ 2 * energy f := by rw [β energy_prod f] | |
| theorem cloud_residual_bound [Fintype V] [Fintype D] [Fintype E] | |
| [Nonempty D] [Nonempty E] (H : PortGraph D E) (lambda : β) | |
| (hH : SpectralCertificate H lambda) (f : V Γ D β β) : | |
| energy (cloudOperator H f - projection f) β€ lambda ^ 2 * energy f := by | |
| rw [β cloudOperator_centered H f] | |
| exact (cloud_centered_contraction H lambda hH (centered f) | |
| (cloudMean_centered_zero f)).trans | |
| (mul_le_mul_of_nonneg_left (energy_centered_le f) (sq_nonneg lambda)) | |
| /-- Cloud projection of the outer permutation is the genuine outer graph | |
| average when its input is constant on each cloud. -/ | |
| theorem projection_graphPermutation_projection [Fintype D] (G : PortGraph V D) | |
| (f : V Γ D β β) : | |
| projection (graphPermutation G (projection f)) = | |
| liftCloud (averagingOperator G (cloudMean f)) := rfl | |
| theorem projected_outer_bound [Fintype V] [Fintype D] [Nonempty D] | |
| (G : PortGraph V D) (lambda : β) (hG : SpectralCertificate G lambda) | |
| (f : V Γ D β β) (hf : mean f = 0) : | |
| energy (projection (graphPermutation G (projection f))) β€ | |
| lambda ^ 2 * energy (projection f) := by | |
| have hzero : mean (cloudMean f) = 0 := (mean_cloudMean f).trans hf | |
| have hleft : energy (projection (graphPermutation G (projection f))) = | |
| energy (averagingOperator G (cloudMean f)) := by | |
| rw [projection_graphPermutation_projection] | |
| exact energy_liftCloud _ | |
| have hright : energy (projection f) = energy (cloudMean f) := energy_liftCloud _ | |
| rw [hleft, hright] | |
| exact hG.contraction _ hzero | |
| theorem energy_add_three_le {A : Type*} [Fintype A] (a b c : A β β) : | |
| energy (a + b + c) β€ 3 * (energy a + energy b + energy c) := by | |
| calc | |
| energy (a + b + c) β€ mean (fun x => 3 * (a x ^ 2 + b x ^ 2 + c x ^ 2)) := by | |
| apply mean_mono | |
| intro x | |
| change (a x + b x + c x) ^ 2 β€ 3 * (a x ^ 2 + b x ^ 2 + c x ^ 2) | |
| nlinarith [sq_nonneg (a x - b x), sq_nonneg (a x - c x), sq_nonneg (b x - c x)] | |
| _ = 3 * (energy a + energy b + energy c) := by | |
| rw [mean_mul_left, mean_add, mean_add] | |
| rfl | |
| /-- A deliberately loose bound sufficient for the expander iteration. -/ | |
| theorem zigzag_energy_bound [Fintype V] [Fintype D] [Fintype E] | |
| [Nonempty D] [Nonempty E] | |
| (G : PortGraph V D) (H : PortGraph D E) (lambdaG lambdaH : β) | |
| (hG : SpectralCertificate G lambdaG) (hH : SpectralCertificate H lambdaH) | |
| (f : V Γ D β β) (hf : mean f = 0) : | |
| energy (averagingOperator (zigzag G H) f) β€ | |
| 3 * (lambdaG ^ 2 + lambdaH ^ 2) * energy f := by | |
| let u := projection f | |
| let v := centered f | |
| let a := projection (graphPermutation G u) | |
| let b := cloudOperator H (graphPermutation G u) - a | |
| let c := cloudOperator H (graphPermutation G (cloudOperator H v)) | |
| have hfactor : averagingOperator (zigzag G H) f = a + b + c := by | |
| rw [averagingOperator_zigzag] | |
| have hf' : f = u + v := by | |
| funext x | |
| change f x = projection f x + (f x - projection f x) | |
| ring | |
| have hbu : cloudOperator H u = u := cloudOperator_projection H f | |
| have hbf : cloudOperator H f = u + cloudOperator H v := by | |
| rw [hf', cloudOperator_add, hbu] | |
| rw [hbf] | |
| have hp : graphPermutation G (u + cloudOperator H v) = | |
| graphPermutation G u + graphPermutation G (cloudOperator H v) := rfl | |
| rw [hp, cloudOperator_add] | |
| change cloudOperator H (graphPermutation G u) + c = | |
| a + (cloudOperator H (graphPermutation G u) - a) + c | |
| funext x | |
| change cloudOperator H (graphPermutation G u) x + c x = | |
| a x + (cloudOperator H (graphPermutation G u) x - a x) + c x | |
| ring | |
| have ha : energy a β€ lambdaG ^ 2 * energy u := projected_outer_bound G lambdaG hG f hf | |
| have hb : energy b β€ lambdaH ^ 2 * energy u := by | |
| have h := cloud_residual_bound H lambdaH hH (graphPermutation G u) | |
| simpa only [graphPermutation_energy] using h | |
| have hc : energy c β€ lambdaH ^ 2 * energy v := by | |
| calc | |
| energy c β€ energy (graphPermutation G (cloudOperator H v)) := cloud_energy_le H _ | |
| _ = energy (cloudOperator H v) := graphPermutation_energy G _ | |
| _ β€ lambdaH ^ 2 * energy v := | |
| cloud_centered_contraction H lambdaH hH v (cloudMean_centered_zero f) | |
| rw [hfactor] | |
| calc | |
| energy (a + b + c) β€ 3 * (energy a + energy b + energy c) := energy_add_three_le _ _ _ | |
| _ β€ 3 * (lambdaG ^ 2 * energy u + lambdaH ^ 2 * energy u + lambdaH ^ 2 * energy v) := | |
| mul_le_mul_of_nonneg_left (add_le_add (add_le_add ha hb) hc) (by norm_num) | |
| _ β€ 3 * (lambdaG ^ 2 + lambdaH ^ 2) * energy f := by | |
| have hdecomp : energy f = energy u + energy v := projection_energy_decomposition f | |
| rw [hdecomp] | |
| have hn := mul_nonneg (sq_nonneg lambdaG) (energy_nonnegative v) | |
| nlinarith | |
| theorem square_certificate [Fintype V] [Fintype D] [Nonempty V] [Nonempty D] | |
| (G : PortGraph V D) (lambda : β) (hG : SpectralCertificate G lambda) : | |
| SpectralCertificate (square G) (lambda ^ 2) where | |
| nonnegative := sq_nonneg lambda | |
| lt_one := by | |
| have hprod := mul_pos (sub_pos.mpr hG.lt_one) | |
| (show 0 < 1 + lambda by linarith [hG.nonnegative]) | |
| nlinarith | |
| contraction f hf := by | |
| rw [averagingOperator_square] | |
| calc | |
| energy (averagingOperator G (averagingOperator G f)) β€ | |
| lambda ^ 2 * energy (averagingOperator G f) := | |
| hG.contraction _ ((mean_operator G f).trans hf) | |
| _ β€ lambda ^ 2 * (lambda ^ 2 * energy f) := | |
| mul_le_mul_of_nonneg_left (hG.contraction f hf) (sq_nonneg lambda) | |
| _ = (lambda ^ 2) ^ 2 * energy f := by ring | |
| /-- Squaring an outer graph with certificate `1/2`, then zigzagging with an | |
| inner graph with certificate `1/100`, again has certificate `1/2`. -/ | |
| theorem square_zigzag_halfCertificate [Fintype V] [Fintype D] [Fintype E] | |
| [Nonempty V] [Nonempty D] [Nonempty E] | |
| (G : PortGraph V D) (H : PortGraph (D Γ D) E) | |
| (hG : SpectralCertificate G (1 / 2)) (hH : SpectralCertificate H (1 / 100)) : | |
| SpectralCertificate (zigzag (square G) H) (1 / 2) where | |
| nonnegative := by norm_num | |
| lt_one := by norm_num | |
| contraction f hf := by | |
| have h := zigzag_energy_bound (square G) H ((1 / 2 : β) ^ 2) (1 / 100) | |
| (square_certificate G (1 / 2) hG) hH f hf | |
| have hcoef : 3 * (((1 / 2 : β) ^ 2) ^ 2 + (1 / 100) ^ 2) β€ (1 / 2 : β) ^ 2 := by | |
| norm_num | |
| exact h.trans (mul_le_mul_of_nonneg_right hcoef (energy_nonnegative f)) | |
| end | |
| end MaxCutGames.Foundations.PCP.ZigzagSpectral | |
| end OAI | |