Download data/lean/OAI/Analysis/CharacterCriterion/BalancedSystem.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 13.7 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/CharacterCriterion/BalancedSystem.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/CharacterCriterion/BalancedSystem.lean
-
curl -L -o BalancedSystem.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/CharacterCriterion/BalancedSystem.lean
13.7 kB
| import OAI.Analysis.CharacterCriterion.Definitions | |
| import OAI.Analysis.CharacterCriterion.MatrixPaths | |
| namespace OAI | |
| noncomputable section | |
| open scoped TensorProduct | |
| open scoped InnerProductSpace | |
| open scoped BigOperators | |
| open Set Module | |
| open Topology | |
| open NormedSpace | |
| open scoped ComplexOrder | |
| open scoped ComplexOrder | |
| open scoped InnerProductSpace | |
| open scoped InnerProductSpace | |
| open NormedSpace | |
| open scoped TensorProduct InnerProductSpace | |
| open UniformSpace | |
| variable [KirchbergRordam.GenericRW.Size] | |
| local notation "rankNum" => KirchbergRordam.GenericRW.Size.n | |
| variable [KirchbergRordam.GenericRW.PauliData] | |
| omit [KirchbergRordam.GenericRW.Size] [KirchbergRordam.GenericRW.PauliData] | |
| open Filter Topology BoundedContinuousFunction | |
| open Filter Topology | |
| open Topology | |
| open scoped TensorProduct CStarAlgebra | |
| open scoped CStarAlgebra ComplexOrder | |
| namespace KirchbergRordam.BalancedDropMultiplicity | |
| def upper (p : β) : β := p*p | |
| def lower (p : β) : β := p*p-p+1 | |
| def middle (p : β) : β := upper p * lower p - upper p - lower p | |
| def next (p : β) : β := p*p*p | |
| lemma lower_eq {p : β} (hp : 2 β€ p) : lower p + p = p*p + 1 := by | |
| have : p β€ p*p := by nlinarith | |
| unfold lower; omega | |
| lemma upper_pos {p : β} (hp : 2 β€ p) : 0 < upper p := by unfold upper; positivity | |
| lemma lower_pos {p : β} (hp : 2 β€ p) : 0 < lower p := by | |
| have lowerIdentity := lower_eq hp | |
| nlinarith | |
| lemma lower_two {p : β} (hp : 2 β€ p) : 2 β€ lower p := by | |
| have h := lower_eq hp | |
| nlinarith | |
| lemma sum_le_product {p : β} (hp : 2 β€ p) : upper p + lower p β€ upper p * lower p := by | |
| have ha : 2 β€ upper p := by unfold upper; nlinarith | |
| have hb := lower_two hp | |
| nlinarith | |
| lemma total {p : β} (hp : 2 β€ p) : lower p + upper p + middle p = upper p * lower p := by | |
| have := sum_le_product hp | |
| unfold middle; omega | |
| lemma next_two {p : β} (hp : 2 β€ p) : 2 β€ next p := by unfold next; nlinarith | |
| lemma mul_upper (p : β) : p * upper p = next p := by unfold upper next; ring | |
| lemma mul_lower {p : β} (hp : 2 β€ p) : (p+1) * lower p = next p+1 := by | |
| have := lower_eq hp | |
| unfold next; nlinarith | |
| lemma at_zero {p : β} (hp : 2 β€ p) : upper p + middle p = (p-1)*(next p+1) := by | |
| have ht := total hp | |
| have hl := mul_lower hp | |
| have he : upper p * lower p = lower p + (p-1)*(next p+1) := by | |
| rw [β hl] | |
| have hp' : p-1+1=p := by omega | |
| unfold upper; nlinarith | |
| omega | |
| lemma at_one {p : β} (hp : 2 β€ p) : lower p + middle p = next p*(p-1) := by | |
| have ht := total hp | |
| have hl := lower_eq hp | |
| have he : upper p * lower p = upper p + next p*(p-1) := by | |
| have hp' : p-1+1=p := by omega | |
| have hl' : lower p = p*(p-1)+1 := by nlinarith | |
| rw [hl'] | |
| unfold upper next | |
| ring | |
| omega | |
| lemma zero_space {p : β} (hp : 2 β€ p) : p + p*(p+1)*(p-1) = next p := by | |
| have hp' : p-1+1=p := by omega | |
| unfold next; nlinarith | |
| lemma one_space {p : β} (hp : 2 β€ p) : (p+1) + p*(p+1)*(p-1) = next p+1 := by | |
| have := zero_space hp | |
| omega | |
| def stage : β β β | |
| | 0 => 2 | |
| | n+1 => next (stage n) | |
| @[simp] lemma stage_zero : stage 0 = 2 := rfl | |
| @[simp] lemma stage_succ (n : β) : stage (n+1) = next (stage n) := | |
| rfl | |
| lemma stage_two (n : β) : 2 β€ stage n := by | |
| induction n with | |
| | zero => simp | |
| | succ n ih => rw [stage_succ]; exact next_two ih | |
| lemma stage_coprime (n : β) : (stage n).Coprime (stage n+1) := by simp | |
| end KirchbergRordam.BalancedDropMultiplicity | |
| namespace KirchbergRordam.MatrixBlockReindex | |
| open MatrixDiagonalPath | |
| open MatrixTensor (leftMatrix rightMatrix) | |
| open scoped ComplexOrder CStarAlgebra Matrix | |
| variable {P Q R S : Type*} [Fintype P] [Fintype Q] [Fintype R] [Fintype S] | |
| [instDecidableEqP : DecidableEq P] [instDecidableEqQ : DecidableEq Q] [DecidableEq R] [DecidableEq S] | |
| omit instDecidableEqP instDecidableEqQ in | |
| lemma reindex_trans.{contextLevel1, contextLevel2} | |
| {P : Type contextLevel1} | |
| {Q : Type contextLevel2} | |
| [Fintype P] | |
| [Fintype Q] | |
| [DecidableEq P] | |
| [DecidableEq Q] | |
| {T : Type*} [Fintype T] [DecidableEq T] | |
| (e : P β Q) (f : Q β T) (a : Mat P) : | |
| CStarMatrix.reindexβ β β (e.trans f) a = | |
| CStarMatrix.reindexβ β β f (CStarMatrix.reindexβ β β e a) := rfl | |
| lemma reindex_block (e : P β Q) (a : P β Mat R) : | |
| CStarMatrix.reindexβ β β (Equiv.prodCongr (Equiv.refl R) e) (block a) = | |
| block (fun i => a (e.symm i)) := by | |
| ext i j | |
| rcases i with β¨r,pβ©; rcases j with β¨s,qβ© | |
| change (if e.symm p=e.symm q then a (e.symm p) r s else 0) = | |
| (if p=q then a (e.symm p) r s else 0) | |
| simp only [e.symm.injective.eq_iff] | |
| lemma reindex_left (e : P β Q) (f : R β S) (a : Mat P) : | |
| CStarMatrix.reindexβ β β (Equiv.prodCongr e f) (leftMatrix (ΞΊ:=R) a) = | |
| leftMatrix (ΞΊ:=S) (CStarMatrix.reindexβ β β e a) := by | |
| ext i j | |
| rcases i with β¨p,rβ©; rcases j with β¨q,sβ© | |
| change leftMatrix a (e.symm p,f.symm r) (e.symm q,f.symm s) = _ | |
| simp only [left_apply, f.symm.injective.eq_iff] | |
| rfl | |
| lemma reindex_right (e : P β Q) (f : R β S) (a : Mat R) : | |
| CStarMatrix.reindexβ β β (Equiv.prodCongr e f) (rightMatrix (ΞΉ:=P) a) = | |
| rightMatrix (ΞΉ:=Q) (CStarMatrix.reindexβ β β f a) := by | |
| ext i j | |
| rcases i with β¨p,rβ©; rcases j with β¨q,sβ© | |
| change rightMatrix a (e.symm p,f.symm r) (e.symm q,f.symm s) = _ | |
| simp only [right_apply, e.symm.injective.eq_iff] | |
| rfl | |
| end KirchbergRordam.MatrixBlockReindex | |
| namespace KirchbergRordam.BalancedDropSystem | |
| open MatrixDiagonalPath | |
| open MatrixTensor (leftMatrix rightMatrix) | |
| open MatrixBlockReindex | |
| open BalancedDropMultiplicity | |
| open scoped ComplexOrder CStarAlgebra Matrix | |
| abbrev P (p : β) := Fin p | |
| abbrev Q (p : β) := Fin (p+1) | |
| abbrev Low (p : β) := Fin (lower p) | |
| abbrev High (p : β) := Fin (upper p) | |
| abbrev Mid (p : β) := Fin (middle p) | |
| abbrev Slot (p : β) := Low p β (High p β Mid p) | |
| abbrev Index (p : β) := (P p Γ Q p) Γ Slot p | |
| abbrev ZeroSpace (p : β) := P p β ((P p Γ Q p) Γ Fin (p-1)) | |
| abbrev OneSpace (p : β) := Q p β ((P p Γ Q p) Γ Fin (p-1)) | |
| def zeroLow (p : β) (hp : 2 β€ p) : Q p Γ Low p β Q (next p) := | |
| cardEquiv (by simpa only [Fintype.card_prod, Fintype.card_fin] using mul_lower hp) | |
| def zeroMid (p : β) (hp : 2 β€ p) : High p β Mid p β Fin (p-1) Γ Q (next p) := | |
| cardEquiv (by simpa only [Fintype.card_sum, Fintype.card_prod, Fintype.card_fin] using at_zero hp) | |
| def zeroOuter (p : β) (hp : 2 β€ p) : ZeroSpace p β P (next p) := | |
| cardEquiv (by simpa only [Fintype.card_sum, Fintype.card_prod, Fintype.card_fin] using zero_space hp) | |
| def oneLow (p : β) : P p Γ High p β P (next p) := | |
| cardEquiv (by simpa only [Fintype.card_prod, Fintype.card_fin] using mul_upper p) | |
| def oneMid (p : β) (hp : 2 β€ p) : Low p β Mid p β P (next p) Γ Fin (p-1) := | |
| cardEquiv (by simpa only [Fintype.card_sum, Fintype.card_prod, Fintype.card_fin] using at_one hp) | |
| def oneOuter (p : β) (hp : 2 β€ p) : OneSpace p β Q (next p) := | |
| cardEquiv (by simpa only [Fintype.card_sum, Fintype.card_prod, Fintype.card_fin] using one_space hp) | |
| def slotSwap (p : β) : Slot p β High p β (Low p β Mid p) where | |
| toFun := Sum.elim (Sum.inr β Sum.inl) (Sum.elim Sum.inl (Sum.inr β Sum.inr)) | |
| invFun := Sum.elim (Sum.inr β Sum.inl) (Sum.elim Sum.inl (Sum.inr β Sum.inr)) | |
| left_inv x := by rcases x with x|x|x <;> rfl | |
| right_inv x := by rcases x with x|x|x <;> rfl | |
| def zeroReindex (p : β) (hp : 2 β€ p) : Index p β P (next p) Γ Q (next p) := | |
| (repackLeft (zeroLow p hp) (zeroMid p hp)).trans | |
| (Equiv.prodCongr (zeroOuter p hp) (Equiv.refl _)) | |
| def oneReindex (p : β) (hp : 2 β€ p) : Index p β P (next p) Γ Q (next p) := | |
| (Equiv.prodCongr (Equiv.refl _) (slotSwap p)).trans | |
| ((repackRight (oneLow p) (oneMid p hp)).trans | |
| (Equiv.prodCongr (Equiv.refl _) (oneOuter p hp))) | |
| lemma half_mem : (1 / 2 : β) β Set.Icc (0 : β) 1 := by | |
| constructor <;> norm_num | |
| def eigenpath (p : β) : Slot p β C(unitInterval, unitInterval) := | |
| Sum.elim (fun _ => lowerPath) (Sum.elim (fun _ => upperPath) (fun _ => ContinuousMap.const _ half)) | |
| @[simp] lemma lower_zero : lowerPath 0 = 0 := by | |
| apply Subtype.ext | |
| change (0 : β) / 2 = 0 | |
| norm_num | |
| @[simp] lemma lower_one : lowerPath 1 = half := by | |
| apply Subtype.ext | |
| change (1 : β) / 2 = (1 : β) / 2 | |
| rfl | |
| @[simp] lemma upper_zero : upperPath 0 = half := by | |
| apply Subtype.ext | |
| change ((0 : β) + 1) / 2 = (1 : β) / 2 | |
| rw [zero_add] | |
| @[simp] lemma upper_one : upperPath 1 = 1 := by | |
| apply Subtype.ext | |
| change ((1 : β) + 1) / 2 = 1 | |
| norm_num | |
| lemma eigen_cover (p : β) (hp : 2 β€ p) (s : unitInterval) : | |
| β i t, eigenpath p i t = s := by | |
| by_cases hs : (s:β) β€ 1/2 | |
| Β· refine β¨.inl β¨0,lower_pos hpβ©, β¨2*s,by constructor <;> linarith [s.property.1]β©, ?_β© | |
| apply Subtype.ext | |
| change 2*(s:β)/2=(s:β) | |
| ring | |
| Β· refine β¨.inr (.inl β¨0,upper_pos hpβ©), β¨2*s-1,by constructor <;> linarith [s.property.2]β©, ?_β© | |
| apply Subtype.ext | |
| change ((2*(s:β)-1)+1)/2=(s:β) | |
| ring | |
| def fiberMap (p : β) (hp : 2 β€ p) (t : unitInterval) : | |
| C(unitInterval, PrimeDimensionDrop.Fiber p (p+1)) βββ[β] | |
| PrimeDimensionDrop.Fiber (next p) (next p+1) := | |
| (interpolate (zeroReindex p hp) (oneReindex p hp) t).toStarAlgHom.comp | |
| (evaluationBlock (eigenpath p) t) | |
| def rawStep (p : β) (hp : 2 β€ p) : | |
| C(unitInterval, PrimeDimensionDrop.Fiber p (p+1)) βββ[β] | |
| C(unitInterval, PrimeDimensionDrop.Fiber (next p) (next p+1)) where | |
| toFun f := β¨fun t => fiberMap p hp t f, | |
| interpolate_continuous _ _ _ (evaluationBlock_continuous _ _)β© | |
| map_zero' := by apply ContinuousMap.ext; intro t; exact (fiberMap p hp t).map_zero | |
| map_one' := by apply ContinuousMap.ext; intro t; exact (fiberMap p hp t).map_one | |
| map_add' f g := by apply ContinuousMap.ext; intro t; exact (fiberMap p hp t).map_add f g | |
| map_mul' f g := by apply ContinuousMap.ext; intro t; exact (fiberMap p hp t).map_mul f g | |
| commutes' z := by apply ContinuousMap.ext; intro t; exact (fiberMap p hp t).commutes z | |
| map_star' f := by apply ContinuousMap.ext; intro t; exact map_star (fiberMap p hp t) f | |
| @[simp] lemma rawStep_apply (p : β) (hp : 2 β€ p) (f) (t : unitInterval) : | |
| rawStep p hp f t = interpolate (zeroReindex p hp) (oneReindex p hp) t | |
| (evaluationBlock (eigenpath p) t f) := rfl | |
| lemma zero_eval (p : β) (f : C(unitInterval, PrimeDimensionDrop.Fiber p (p+1))) | |
| (a : Mat (P p)) (ha : leftMatrix a = f 0) : | |
| evaluationBlock (eigenpath p) 0 f = | |
| block (Sum.elim (fun _ : Low p => leftMatrix (ΞΊ:=Q p) a) | |
| (fun _ : High p β Mid p => f half)) := by | |
| apply congrArg block | |
| funext k | |
| rcases k with k|k|k <;> simp [eigenpath,ha] | |
| lemma one_eval (p : β) (f : C(unitInterval, PrimeDimensionDrop.Fiber p (p+1))) | |
| (b : Mat (Q p)) (hb : rightMatrix b = f 1) : | |
| CStarMatrix.reindexβ β β (Equiv.prodCongr (Equiv.refl (P p Γ Q p)) (slotSwap p)) | |
| (evaluationBlock (eigenpath p) 1 f) = | |
| block (Sum.elim (fun _ : High p => rightMatrix (ΞΉ:=P p) b) | |
| (fun _ : Low p β Mid p => f half)) := by | |
| change CStarMatrix.reindexβ β β _ (block _) = _ | |
| rw [reindex_block] | |
| apply congrArg block | |
| funext k | |
| rcases k with k|k|k <;> simp [slotSwap,eigenpath,hb] | |
| lemma rawStep_zero (p : β) (hp : 2 β€ p) | |
| (f : C(unitInterval, PrimeDimensionDrop.Fiber p (p+1))) | |
| (a : Mat (P p)) (ha : leftMatrix a = f 0) : | |
| rawStep p hp f 0 = leftMatrix (ΞΊ := Q (next p)) | |
| (CStarMatrix.reindexβ β β (zeroOuter p hp) | |
| (sumBlock (a,block (fun _ : Fin (p-1) => f half)))) := by | |
| rw [rawStep_apply,interpolate_zero,zero_eval p f a ha] | |
| unfold zeroReindex | |
| rw [reindex_trans,repackLeft_matrix,reindex_left] | |
| lemma rawStep_one (p : β) (hp : 2 β€ p) | |
| (f : C(unitInterval, PrimeDimensionDrop.Fiber p (p+1))) | |
| (b : Mat (Q p)) (hb : rightMatrix b = f 1) : | |
| rawStep p hp f 1 = rightMatrix (ΞΉ := P (next p)) | |
| (CStarMatrix.reindexβ β β (oneOuter p hp) | |
| (sumBlock (b,block (fun _ : Fin (p-1) => f half)))) := by | |
| rw [rawStep_apply,interpolate_one] | |
| unfold oneReindex | |
| rw [reindex_trans,one_eval p f b hb,reindex_trans,repackRight_matrix,reindex_right] | |
| def step (p : β) (hp : 2 β€ p) : PrimeDimensionDrop.Algebra p (p+1) βββ[β] | |
| PrimeDimensionDrop.Algebra (next p) (next p+1) where | |
| toFun f := β¨rawStep p hp f.val, by | |
| obtain β¨β¨a,haβ©,β¨b,hbβ©β© := f.property | |
| exact β¨β¨_, (rawStep_zero p hp f.val a ha).symmβ©, | |
| β¨_, (rawStep_one p hp f.val b hb).symmβ©β©β© | |
| map_zero' := by apply Subtype.ext; exact (rawStep p hp).map_zero | |
| map_one' := by apply Subtype.ext; exact (rawStep p hp).map_one | |
| map_add' f g := by apply Subtype.ext; exact (rawStep p hp).map_add f.val g.val | |
| map_mul' f g := by apply Subtype.ext; exact (rawStep p hp).map_mul f.val g.val | |
| commutes' z := by apply Subtype.ext; exact (rawStep p hp).commutes z | |
| map_star' f := by apply Subtype.ext; exact map_star (rawStep p hp) f.val | |
| lemma rawStep_injective (p : β) (hp : 2 β€ p) : Function.Injective (rawStep p hp) := by | |
| intro f g h | |
| apply diagonal_injective (eigenpath p) (eigen_cover p hp) | |
| apply ContinuousMap.ext | |
| intro t | |
| exact (interpolate (zeroReindex p hp) (oneReindex p hp) t).injective | |
| (DFunLike.congr_fun h t) | |
| lemma step_injective (p : β) (hp : 2 β€ p) : Function.Injective (step p hp) := by | |
| intro f g h | |
| apply Subtype.ext | |
| exact rawStep_injective p hp (congrArg Subtype.val h) | |
| lemma step_norm (p : β) (hp : 2 β€ p) (f : PrimeDimensionDrop.Algebra p (p+1)) : | |
| βstep p hp fβ = βfβ := NonUnitalStarAlgHom.norm_map _ (step_injective p hp) f | |
| end KirchbergRordam.BalancedDropSystem | |
| end | |
| end OAI | |