Download data/lean/OAI/Geometry/HarmonicGrowth/StreamData.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 37.9 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/HarmonicGrowth/StreamData.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/HarmonicGrowth/StreamData.lean
-
curl -L -o StreamData.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/HarmonicGrowth/StreamData.lean
37.9 kB
| import OAI.Geometry.HarmonicGrowth.AngularTrace | |
| import OAI.Geometry.HarmonicGrowth.PulseSystem | |
| import OAI.Geometry.HarmonicGrowth.AngularStream | |
| import OAI.Geometry.HarmonicGrowth.GlobalControl | |
| namespace OAI | |
| noncomputable section | |
| namespace HarmonicCounterexample.AngularStream | |
| open Set Filter Schedule Pulses FiniteControl.SmoothWord | |
| open scoped Topology ContDiff BigOperators | |
| variable {n : β} | |
| lemma scalarPacket_smooth (a : Fin n β β) : ContDiff β β (unitPacketScalar a) := by | |
| unfold unitPacketScalar packetScalar | |
| exact contDiff_const.mul (ContDiff.sum (fun i _ => contDiff_const.mul | |
| ((bump_smooth i).comp (contDiff_const.mul contDiff_id)))) | |
| lemma scalarPacket_before (a : Fin n β β) {t : β} (ht : duration n*t < 1) : unitPacketScalar a t=0 := by | |
| unfold unitPacketScalar packetScalar | |
| have h : β i : Fin n,a i*bump i (duration n*t)=0 := by | |
| apply Finset.sum_eq_zero | |
| intro i _ | |
| rw [bump_zero_before (by have hi : 0 β€ (i:β) := Nat.cast_nonneg _;linarith),mul_zero] | |
| rw [h,mul_zero] | |
| lemma scalarPacket_after (a : Fin n β β) {t : β} (ht : 2*(n:β) < duration n*t) : unitPacketScalar a t=0 := by | |
| unfold unitPacketScalar packetScalar | |
| have h : β i : Fin n,a i*bump i (duration n*t)=0 := by | |
| apply Finset.sum_eq_zero | |
| intro i _ | |
| have hi : (i:β)+1 β€ n := by exact_mod_cast i.isLt | |
| rw [bump_zero_after (by linarith),mul_zero] | |
| rw [h,mul_zero] | |
| lemma scalarPacket_zero_before (a : Fin n β β) {t : β} (ht : t β€ 0) : unitPacketScalar a t=0 := | |
| scalarPacket_before a (lt_of_le_of_lt (mul_nonpos_of_nonneg_of_nonpos (duration_pos n).le ht) (by norm_num)) | |
| lemma scalarPacket_zero_after (a : Fin n β β) {t : β} (ht : 1 β€ t) : unitPacketScalar a t=0 := by | |
| apply scalarPacket_after a | |
| have h : duration n β€ duration n*t := by simpa using mul_le_mul_of_nonneg_left ht (duration_pos n).le | |
| dsimp [duration] at h β’;linarith | |
| /-- The ONE genuine smooth scalar anisotropy attached to an infinite stream. -/ | |
| def scalar (s : β β Fin n β β) (qstar : β) (j0 : β) : β β β := | |
| Pulses.profile (fun j => unitPacketScalar (s j)) qstar j0 | |
| lemma scalar_smooth (s : β β Fin n β β) (qstar : β) (j0 : β) : ContDiff β β (scalar s qstar j0) := | |
| Pulses.profile_smooth (fun j => scalarPacket_smooth (s j)) (fun j _ h => scalarPacket_zero_before (s j) h) qstar j0 | |
| lemma scalar_initial (s : β β Fin n β β) {qstar t : β} {j0 : β} (ht : t β€ time j0) : scalar s qstar j0 t=1 := | |
| Pulses.profile_initial (fun j _ h => scalarPacket_zero_before (s j) h) ht | |
| lemma scalar_pulse (s : β β Fin n β β) {qstar t : β} {j0 j : β} (hj : j0 β€ j) | |
| (hlo : time j β€ t) (hhi : t β€ time j+pulse j) : | |
| scalar s qstar j0 t=1+(pulse j)β»ΒΉ*unitPacketScalar (s j) ((t-time j)/pulse j) := | |
| Pulses.profile_pulse (fun j _ h => scalarPacket_zero_before (s j) h) | |
| (fun j _ h => scalarPacket_zero_after (s j) h) hj hlo hhi | |
| lemma scalar_leg (s : β β Fin n β β) {qstar t : β} {j0 j : β} (hj : j0 β€ j) | |
| (hlo : time j+pulse j β€ t) (hhi : t β€ time (j+1)) : | |
| scalar s qstar j0 t=base qstar j0 t := by | |
| rw [scalar,Pulses.profile_period (fun j _ h => scalarPacket_zero_before (s j) h) | |
| (fun j _ h => scalarPacket_zero_after (s j) h) hj (by linarith [pulse_pos j]) hhi, | |
| base,Pulses.profile_period (by simp) (by simp) hj (by linarith [pulse_pos j]) hhi] | |
| simp only [Pulses.increment,scalarPacket_zero_after (s j) (t:=((t-time j)/pulse j)) ((le_div_iffβ (pulse_pos j)).2 (by linarith)),mul_zero] | |
| lemma scalar_rest (s : β β Fin n β β) {qstar t : β} {j0 j : β} (hj : j0 β€ j) | |
| (hlo : time j+3*pulse j+dwell j β€ t) (hhi : t β€ time (j+1)) : scalar s qstar j0 t=1 := | |
| Pulses.profile_rest (fun j _ h => scalarPacket_zero_before (s j) h) | |
| (fun j _ h => scalarPacket_zero_after (s j) h) hj hlo hhi | |
| /-- Open round collar at the START of every pulse, including the FIRST one. -/ | |
| lemma scalar_start_collar (s : β β Fin n β β) (qstar : β) {j0 j : β} (hj : j0 β€ j) : | |
| βαΆ t in π (time j),scalar s qstar j0 t=1 := by | |
| have hb : βαΆ t in π (time j),duration n*((t-time j)/pulse j)<1 := | |
| ((continuous_const.mul ((continuous_id.sub continuous_const).div_const _)).continuousAt.eventually_lt | |
| continuousAt_const (by simp)) | |
| have he : βαΆ t in π (time j),t<time j+pulse j := eventually_lt_nhds (by linarith [pulse_pos j]) | |
| have hl : βαΆ t in π (time j),t β€ time j β scalar s qstar j0 t=1 := by | |
| by_cases h0 : j=j0 | |
| Β· subst j;exact Filter.Eventually.of_forall (fun t ht => scalar_initial s ht) | |
| Β· obtain β¨k,rflβ© := Nat.exists_eq_succ_of_ne_zero (show j β 0 by omega) | |
| have hk : j0 β€ k := by omega | |
| have hgap : time k+3*pulse k+dwell k < time (k+1) := by rw [time_succ];linarith [pulse_pos k] | |
| filter_upwards [eventually_gt_nhds hgap] with t ht ht' | |
| exact scalar_rest s hk ht.le ht' | |
| filter_upwards [hb,he,hl] with t ht he hl | |
| by_cases h : t β€ time j | |
| Β· exact hl h | |
| Β· rw [scalar_pulse s hj (le_of_not_ge h) he.le,scalarPacket_before (s j) ht,mul_zero,add_zero] | |
| /-- Open round collar at the END of every pulse. The next ramp starts only | |
| AFTER this collar, so changing back to the dwell angular structure is smooth. -/ | |
| lemma scalar_end_collar (s : β β Fin n β β) (qstar : β) {j0 j : β} (hj : j0 β€ j) : | |
| βαΆ t in π (time j+pulse j),scalar s qstar j0 t=1 := by | |
| have hb : βαΆ t in π (time j+pulse j),2*(n:β)<duration n*((t-time j)/pulse j) := | |
| (continuousAt_const.eventually_lt | |
| ((continuous_const.mul ((continuous_id.sub continuous_const).div_const _)).continuousAt) | |
| (by rw [add_sub_cancel_left,div_self (ne_of_gt (pulse_pos j)),mul_one];simp [duration])) | |
| have hlo : βαΆ t in π (time j+pulse j),time j<t := eventually_gt_nhds (by linarith [pulse_pos j]) | |
| have hhi : βαΆ t in π (time j+pulse j),t<time j+pulse j+pulse j/4 := | |
| eventually_lt_nhds (by linarith [pulse_pos j]) | |
| filter_upwards [hb,hlo,hhi] with t hb hlo hhi | |
| rw [scalar,Pulses.profile_period (fun j _ h => scalarPacket_zero_before (s j) h) | |
| (fun j _ h => scalarPacket_zero_after (s j) h) hj hlo.le (by rw [time_succ];linarith [pulse_pos j,dwell_pos j]), | |
| Pulses.increment,scalarPacket_after (s j) hb,mul_zero,zero_add, | |
| window,ramp_zero ((div_le_iffβ (pulse_pos j)).2 (by linarith)), | |
| ramp_zero ((div_le_iffβ (pulse_pos j)).2 (by linarith [pulse_pos j,dwell_pos j]))] | |
| ring | |
| end HarmonicCounterexample.AngularStream | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.AngularStream | |
| open Set Filter Schedule Pulses FiniteControl.SmoothWord | |
| open scoped Topology ContDiff BigOperators | |
| variable {n : β} | |
| def scalarShape (i : Fin n) (t : β) : β := duration n*bump i (duration n*t) | |
| lemma scalarShape_smooth (i : Fin n) : ContDiff β β (scalarShape i) := | |
| contDiff_const.mul ((bump_smooth i).comp (contDiff_const.mul contDiff_id)) | |
| lemma scalarShape_local_zero (i : Fin n) {t : β} (ht : t β Icc (0:β) 1) : | |
| scalarShape i =αΆ [π t] fun _ => 0 := by | |
| by_cases h : t<0 | |
| Β· filter_upwards [eventually_lt_nhds h] with u hu | |
| unfold scalarShape | |
| have hi : 0 β€ (i:β) := Nat.cast_nonneg _ | |
| have hh := mul_neg_of_pos_of_neg (duration_pos n) hu | |
| rw [bump_zero_before (by linarith),mul_zero] | |
| Β· have h' : 1<t := by simp only [mem_Icc,not_and_or,not_le] at ht;rcases ht with ht|ht <;> linarith | |
| filter_upwards [eventually_gt_nhds h'] with u hu | |
| unfold scalarShape | |
| have hi : (i:β)+1 β€ n := by exact_mod_cast i.isLt | |
| have hh : duration n < duration n*u := by nlinarith [duration_pos n] | |
| rw [bump_zero_after (by dsimp [duration] at *;linarith),mul_zero] | |
| lemma scalarShape_two_bound (i : Fin n) : β C : β,0 β€ C β§ | |
| β t,|deriv (deriv (scalarShape i)) t| β€ C := by | |
| have hs := (contDiff_infty_iff_deriv.1 (scalarShape_smooth i)).2 | |
| apply bounded_of_zero_outside (contDiff_infty_iff_deriv.1 hs).2.continuous | |
| intro t ht | |
| have h := (scalarShape_local_zero i ht).deriv | |
| have h' := h.deriv_eq | |
| simpa using h' | |
| lemma scalarPacket_as_sum (a : Fin n β β) : unitPacketScalar a=fun t => β i,a i*scalarShape i t := by | |
| funext t | |
| simp only [unitPacketScalar,packetScalar,scalarShape,Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _;ring | |
| lemma scalarPacket_deriv (a : Fin n β β) : deriv (unitPacketScalar a)= | |
| fun t => β i,a i*deriv (scalarShape i) t := by | |
| funext t | |
| rw [scalarPacket_as_sum] | |
| exact (HasDerivAt.fun_sum (fun i _ => (((scalarShape_smooth i).differentiable (by simp)) t).hasDerivAt.const_mul (a i))).deriv | |
| lemma scalarPacket_deriv_two (a : Fin n β β) : deriv (deriv (unitPacketScalar a))= | |
| fun t => β i,a i*deriv (deriv (scalarShape i)) t := by | |
| funext t | |
| rw [scalarPacket_deriv] | |
| exact (HasDerivAt.fun_sum (fun i _ => (((contDiff_infty_iff_deriv.1 (scalarShape_smooth i)).2.differentiable (by simp)) t).hasDerivAt.const_mul (a i))).deriv | |
| /-- The second time jet is uniformly bounded on the same fixed amplitude box. | |
| This constant is chosen before the entire infinite history. -/ | |
| theorem scalarPacket_two_uniform_bound (n : β) : β C : β,0 β€ C β§ | |
| β (a : Fin n β β) (M : β),0 β€ M β (β i,|a i| β€ M) β | |
| β t,|deriv (deriv (unitPacketScalar a)) t| β€ C*M := by | |
| classical | |
| choose C hC hb using fun i : Fin n => scalarShape_two_bound i | |
| refine β¨β i,C i,Finset.sum_nonneg (fun i _ => hC i),fun a M hM ha t => ?_β© | |
| rw [scalarPacket_deriv_two] | |
| calc | |
| _ β€ β i : Fin n,|a i*deriv (deriv (scalarShape i)) t| := Finset.abs_sum_le_sum_abs _ _ | |
| _ β€ β i : Fin n,C i*M := Finset.sum_le_sum (fun i _ => by | |
| rw [abs_mul,mul_comm (C i) M] | |
| exact mul_le_mul (ha i) (hb i t) (abs_nonneg _) hM) | |
| _ = _ := by rw [Finset.sum_mul] | |
| lemma scalarPacket_deriv_eq (a : Fin n β β) (t : β) : | |
| deriv (unitPacketScalar a) t=unitPacketScalarD a t := by | |
| have h : HasDerivAt (packetScalar a) (packetScalarD a (duration n*t)) (duration n*t) := | |
| HasDerivAt.fun_sum (fun i _ => ((bump_smooth i).differentiable (by simp) _).hasDerivAt.const_mul (a i)) | |
| have hh := (h.comp t ((hasDerivAt_id t).const_mul (duration n))).const_mul (duration n) | |
| change HasDerivAt (unitPacketScalar a) _ t at hh | |
| rw [hh.deriv,unitPacketScalarD] | |
| ring | |
| end HarmonicCounterexample.AngularStream | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.LinearODE | |
| open Set Filter Schedule Pulses AngularStream FiniteControl.SmoothWord | |
| open scoped Topology ContDiff | |
| variable {ΞΊ : Type*} (w : PhysicalWord ΞΊ) | |
| /-- All three profile jet constants are selected before histories. -/ | |
| theorem PhysicalWord.scalar_uniform_bounds : β M C1 C2 : β, | |
| 0 β€ M β§ 0 β€ C1 β§ 0 β€ C2 β§ | |
| β s : β β Fin w.n β β,(β j,s j β w.admissible) β β j t, | |
| |unitPacketScalar (s j) t| β€ M β§ | |
| |deriv (unitPacketScalar (s j)) t| β€ C1 β§ | |
| |deriv (deriv (unitPacketScalar (s j))) t| β€ C2 := by | |
| obtain β¨U,hU,haβ© := w.admissible_uniform_bound | |
| obtain β¨C,hC,hbβ© := unitPacketScalar_uniform_bound w.n | |
| obtain β¨D,hD,hdβ© := scalarPacket_two_uniform_bound w.n | |
| refine β¨C*U,C*U,D*U,mul_nonneg hC hU,mul_nonneg hC hU,mul_nonneg hD hU,fun s hs j t => ?_β© | |
| have h := hb (s j) U hU (ha _ (hs j)) t | |
| rw [scalarPacket_deriv_eq] | |
| exact β¨h.1,h.2,hd (s j) U hU (ha _ (hs j)) tβ© | |
| end HarmonicCounterexample.LinearODE | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.LinearODE | |
| open Set Filter Schedule Pulses AngularStream FiniteControl.SmoothWord | |
| open scoped Topology ContDiff | |
| variable {ΞΊ : Type*} (w : PhysicalWord ΞΊ) | |
| /-- The complete global profile has uniform jet budgets selected before every | |
| history and before the late starting index. -/ | |
| theorem PhysicalWord.profile_uniform_bounds (qstar : β) : β M C1 C2 : β, | |
| 0 β€ M β§ 0 β€ C1 β§ 0 β€ C2 β§ | |
| β s : β β Fin w.n β β,(β j,s j β w.admissible) β | |
| (β j t,|unitPacketScalar (s j) t| β€ M) β§ | |
| β j0 j,j0 β€ j β β t β Icc (time j) (time (j+1)), | |
| |deriv (scalar s qstar j0) t| β€ C1/pulse j β§ | |
| |deriv (deriv (scalar s qstar j0)) t| β€ C2/pulse j^2 := by | |
| obtain β¨M,D1,D2,hM,hD1,hD2,hbβ© := w.scalar_uniform_bounds | |
| obtain β¨B1,B2,hB1,hB2,hb1,hb2β© := ramp_derivatives_bounded | |
| refine β¨M,D1+2*|qstar-1| *B1,D2+2*|qstar-1| *B2,hM, | |
| add_nonneg hD1 (by positivity),add_nonneg hD2 (by positivity),fun s hs => ?_β© | |
| refine β¨fun j t => (hb s hs j t).1,fun j0 j hj t ht => ?_β© | |
| change |deriv (profile (fun j => unitPacketScalar (s j)) qstar j0) t| β€ _ β§ | |
| |deriv (deriv (profile (fun j => unitPacketScalar (s j)) qstar j0)) t| β€ _ | |
| rw [profile_deriv_period (fun j => scalarPacket_smooth (s j)) | |
| (fun j _ h => scalarPacket_zero_before (s j) h) (fun j _ h => scalarPacket_zero_after (s j) h) hj ht, | |
| profile_deriv_two_period (fun j => scalarPacket_smooth (s j)) | |
| (fun j _ h => scalarPacket_zero_before (s j) h) (fun j _ h => scalarPacket_zero_after (s j) h) hj ht] | |
| exact β¨increment_deriv_bound (fun j => scalarPacket_smooth (s j)) | |
| (fun j t => (hb s hs j t).2.1) hb1 qstar j t, | |
| increment_deriv_two_bound (fun j => scalarPacket_smooth (s j)) | |
| (fun j t => (hb s hs j t).2.2) hb2 qstar j tβ© | |
| lemma PhysicalWord.scalar_positive_threshold {qstar : β} (hq : 1 β€ qstar) : | |
| β J : β,β j0,J β€ j0 β β s : β β Fin w.n β β, | |
| (β j,s j β w.admissible) β β t,1/2 β€ scalar s qstar j0 t β§ | |
| scalar s qstar j0 t β€ qstar+1/2 := by | |
| obtain β¨M,D1,D2,hM,hD1,hD2,hbβ© := w.scalar_uniform_bounds | |
| obtain β¨J,hJβ© := eventually_atTop.1 (pulse_atTop_limit.eventually_ge_atTop (2*M)) | |
| refine β¨J,fun j0 hj0 s hs t => ?_β© | |
| by_cases ht : t β€ time j0 | |
| Β· rw [scalar_initial s ht];constructor <;> linarith | |
| Β· obtain β¨j,hj,hlo,hhiβ© := GlobalGrowth.grid_bracket time_atTop j0 (le_of_not_ge ht) | |
| have h := profile_bounds_on_period (fun j _ ht => scalarPacket_zero_before (s j) ht) | |
| (fun j _ ht => scalarPacket_zero_after (s j) ht) (fun j u => (hb s hs j u).1) hq hj hlo hhi | |
| change 1-M/pulse j β€ scalar s qstar j0 t β§ scalar s qstar j0 t β€ qstar+M/pulse j at h | |
| have hq : M/pulse j β€ 1/2 := (div_le_iffβ (pulse_pos j)).2 (by linarith [hJ j (hj0.trans hj)]) | |
| constructor <;> linarith | |
| /-- One geometric threshold, before the subsequently tuned infinite stream, | |
| absorbs the radial and BOTH tangent curvature costs on EVERY active period. -/ | |
| theorem PhysicalWord.curvature_threshold {m a ΞΌ qstar : β} | |
| (hm : 1 β€ m) (hΞΌ : 0 < ΞΌ) (hΞΌ1 : ΞΌ β€ 1/4) (hqstar : 1 β€ qstar) | |
| (ha : Tendsto (Scale.profile ΞΌ) atTop (π a)) | |
| (hH : β q β Icc 1 qstar,0 < m+1-2*q-(m-1)*a^2*q^(-1/m)) | |
| (hV : β q β Icc 1 qstar,0 < (m-1)*q*(q-a^2*q^(-1/m))) : | |
| β J : β,β j0,J β€ j0 β β s : β β Fin w.n β β, | |
| (β j,s j β w.admissible) β | |
| (β t,1/2 β€ scalar s qstar j0 t β§ scalar s qstar j0 t β€ qstar+1/2) β§ | |
| β j,j0 β€ j β β t β Icc (time j) (time (j+1)), | |
| let q := scalar s qstar j0 | |
| let v := logSlope q | |
| 0 β€ Berger.radialRicciNumerator (m+1) | |
| (Scale.slope ΞΌ t-v t/m) (v t) | |
| (deriv (Scale.slope ΞΌ) t-deriv v t/m) (deriv v t) β§ | |
| 0 < Berger.horizontalRicciNumerator (m+1) | |
| ((Scale.profile ΞΌ t)^2*(q t)^(-1/m)) (q t) | |
| (Scale.slope ΞΌ t-v t/m) (v t) (deriv (Scale.slope ΞΌ) t-deriv v t/m) β§ | |
| 0 < Berger.verticalRicciNumerator (m+1) | |
| ((Scale.profile ΞΌ t)^2*(q t)^(-1/m)) (q t) | |
| (Scale.slope ΞΌ t-v t/m) (v t) | |
| (deriv (Scale.slope ΞΌ) t-deriv v t/m) (deriv v t) := by | |
| obtain β¨M,C1,C2,hM,hC1,hC2,hbβ© := w.profile_uniform_bounds qstar | |
| obtain β¨J0,hJ0β© := w.scalar_positive_threshold hqstar | |
| obtain β¨J1,hJ1β© := Berger.radialRicci_of_pulse_budget (C:=C1) hm hΞΌ hΞΌ1 | |
| obtain β¨J2,hJ2β© := Berger.tangentRicci_of_pulse_budget (C1:=C1) (C2:=C2) hM hqstar ha hH hV | |
| refine β¨max J0 (max J1 J2),fun j0 hj0 s hs => ?_β© | |
| have hj00 : J0 β€ j0 := (le_max_left _ _).trans hj0 | |
| have hj01 : J1 β€ j0 := (le_trans (le_max_left _ _) (le_max_right _ _)).trans hj0 | |
| have hj02 : J2 β€ j0 := (le_trans (le_max_right _ _) (le_max_right _ _)).trans hj0 | |
| refine β¨hJ0 j0 hj00 s hs,fun j hj t ht => ?_β© | |
| have hd := (hb s hs).2 j0 j hj t ht | |
| have hq := (hJ0 j0 hj00 s hs t).1 | |
| have hv := profile_bounds_on_period (fun j _ h => scalarPacket_zero_before (s j) h) | |
| (fun j _ h => scalarPacket_zero_after (s j) h) (hb s hs).1 hqstar hj ht.1 ht.2 | |
| exact β¨hJ1 j (hj01.trans hj) _ t hq hd.1 ht, | |
| hJ2 j (hj02.trans hj) _ t (scalar_smooth s qstar j0) hq hv.1 hv.2 hd.1 hd.2 ht.1β© | |
| end HarmonicCounterexample.LinearODE | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.Berger | |
| /-- The horizontal Ricci margin is smallest at the Berger dwell endpoint, | |
| not at an untested point of the ramp. -/ | |
| lemma static_horizontal_margin {m a q qstar : β} (hm : 1 < m) (ha : a^2 < 1) | |
| (hq : q β Set.Icc 1 qstar) | |
| (hstar : 0 < m+1-2*qstar-(m-1)*a^2*qstar^(-1/m)) : | |
| 0 < m+1-2*q-(m-1)*a^2*q^(-1/m) := by | |
| let F : β β β := fun x => m+1-2*x-(m-1)*a^2*x^(-1/m) | |
| have hd (x : β) (hx : 1 β€ x) : | |
| HasDerivAt F (-2+(m-1)*a^2/m*x^(-1/m-1)) x := by | |
| have hp := Real.hasDerivAt_rpow_const (p := -1/m) (Or.inl (by linarith : x β 0)) | |
| convert! ((hasDerivAt_const x (m+1)).sub ((hasDerivAt_id x).const_mul 2)).sub | |
| (hp.const_mul ((m-1)*a^2)) using 1 | |
| ring | |
| have hn (x : β) (hx : 1 β€ x) : -2+(m-1)*a^2/m*x^(-1/m-1) β€ 0 := by | |
| have hm0 : 0 < m := by linarith | |
| have hc0 : 0 β€ (m-1)*a^2/m := div_nonneg (mul_nonneg (by linarith) (sq_nonneg a)) hm0.le | |
| have hc1 : (m-1)*a^2/m β€ 1 := by | |
| apply (div_le_iffβ hm0).2 | |
| nlinarith [sq_nonneg a] | |
| have hp : x^(-1/m-1) β€ 1 := | |
| Real.rpow_le_one_of_one_le_of_nonpos hx (by have := div_nonpos_of_nonpos_of_nonneg (by norm_num : (-1:β) β€ 0) hm0.le; linarith) | |
| have hb := (mul_le_mul_of_nonneg_left hp hc0).trans (by simpa using hc1) | |
| linarith | |
| have hanti : AntitoneOn F (Set.Icc 1 qstar) := by | |
| apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc 1 qstar) | |
| Β· intro x hx | |
| exact (hd x hx.1).continuousAt.continuousWithinAt | |
| Β· intro x hx | |
| exact (hd x (interior_subset hx).1).hasDerivWithinAt | |
| Β· intro x hx | |
| exact hn x (interior_subset hx).1 | |
| exact hstar.trans_le (hanti hq β¨hq.1.trans hq.2,le_rflβ© hq.2) | |
| end HarmonicCounterexample.Berger | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.Construction | |
| open Filter | |
| open scoped Topology | |
| def qstar : β := 101/100 | |
| def a : β := Real.sqrt ((99853/100000:β)*qstar^(1/15:β)) | |
| lemma qstar_pos : 0<qstar := by norm_num [qstar] | |
| lemma qstar_ge_one : 1β€qstar := by norm_num [qstar] | |
| lemma a_pos : 0<a := Real.sqrt_pos.2 (mul_pos (by norm_num) (Real.rpow_pos_of_pos qstar_pos _)) | |
| lemma a_square : a^2=(99853/100000:β)*qstar^(1/15:β) := | |
| Real.sq_sqrt (mul_nonneg (by norm_num) (Real.rpow_nonneg qstar_pos.le _)) | |
| lemma qstar_small_power : qstar^(1/15:β) β€ 1001/1000 := by | |
| have hp : qstar β€ (1001/1000:β)^15 := by norm_num [qstar] | |
| have hh := Real.rpow_le_rpow qstar_pos.le hp (by norm_num : (0:β) β€ 1/15) | |
| rw [β Real.rpow_natCast,β Real.rpow_mul (by norm_num : (0:β) β€ 1001/1000)] at hh | |
| norm_num at hh β’ | |
| exact hh | |
| lemma a_square_lt_one : a^2<1 := by | |
| rw [a_square] | |
| have hh := mul_le_mul_of_nonneg_left qstar_small_power (by norm_num : (0:β) β€ 99853/100000) | |
| linarith | |
| lemma a_lt_one : a<1 := by nlinarith [a_pos,a_square_lt_one] | |
| lemma a_lower : 99/100 β€ a := by | |
| have h := Real.one_le_rpow qstar_ge_one (by norm_num : (0:β) β€ 1/15) | |
| have he := a_square | |
| nlinarith [a_pos] | |
| lemma scale_total_lower : (4/5:β) β€ Scale.total := by | |
| have h := Real.rpow_le_rpow_of_exponent_le (by norm_num : (1:β) β€ 5) | |
| (by norm_num : (-1:β) β€ -1/4) | |
| norm_num at h | |
| unfold Scale.total | |
| linarith [Scale.primitive_nonneg 4] | |
| lemma a_close : Real.exp (-Scale.total/4) β€ a := by | |
| rw [β Real.exp_log a_pos,Real.exp_le_exp] | |
| have h := Real.one_sub_inv_le_log_of_pos a_pos | |
| have hi : aβ»ΒΉ β€ (100/99:β) := by | |
| have hh := one_div_le_one_div_of_le (by norm_num : (0:β)<99/100) a_lower | |
| simpa using hh | |
| linarith [scale_total_lower] | |
| lemma static_horizontal (q : β) (hq : q β Set.Icc 1 qstar) : | |
| 0 < 15+1-2*q-(15-1)*a^2*q^(-1/15:β) := by | |
| apply Berger.static_horizontal_margin (by norm_num : (1:β)<15) a_square_lt_one hq | |
| rw [a_square] | |
| have hp : qstar^(1/15:β)*qstar^(-1/15:β)=1 := by | |
| rw [β Real.rpow_add qstar_pos] | |
| norm_num | |
| calc | |
| _ = 15+1-2*qstar-(15-1)*(99853/100000:β)* | |
| (qstar^(1/15:β)*qstar^(-1/15:β)) := by ring | |
| _ > 0 := by rw [hp];norm_num [qstar] | |
| lemma static_vertical (q : β) (hq : q β Set.Icc 1 qstar) : | |
| 0 < (15-1)*q*(q-a^2*q^(-1/15:β)) := | |
| Berger.static_vertical_margin (by norm_num) a_square_lt_one hq.1 | |
| lemma exists_scale : β ΞΌ:β,0<ΞΌ β§ ΞΌβ€1/4 β§ | |
| Tendsto (Scale.profile ΞΌ) atTop (π a) β§ Real.exp (-ΞΌ*Scale.total)=a := | |
| Scale.choose_scale a_pos a_lt_one a_close | |
| end HarmonicCounterexample.Construction | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.Control | |
| open Module RealForm ComplexAngular Berger ComplexStarModule | |
| attribute [local instance 100] LieRing.ofAssociativeRing | |
| section Generic | |
| variable {V W:Type*} [AddCommGroup V] [Module β V] [AddCommGroup W] [Module β W] | |
| lemma conj_traceFree (e:Vββ[β]W) (A:Module.End β V) : | |
| e.conj (traceFreeEnd A)=traceFreeEnd (e.conj A) := by | |
| simp only [traceFreeEnd,LinearMap.coe_mk,AddHom.coe_mk,map_sub,map_smul, | |
| LinearMap.trace_conj',β e.finrank_eq] | |
| congr 1 | |
| exact congrArg _ (e.conj_id) | |
| lemma conj_mul (e:Vββ[β]W) (A B:Module.End β V) : | |
| e.conj (A*B)=e.conj A*e.conj B := e.conj_comp B A | |
| end Generic | |
| section Complexification | |
| variable {V:Type*} [AddCommGroup V] [Module β V] [StarAddMonoid V] [StarModule β V] | |
| lemma complexify_one : complexify (1:Module.End β (selfAdjoint V))=1 := by | |
| ext x | |
| change (realPart x:V)+Complex.I β’ (imaginaryPart x:V)=x | |
| exact realPart_add_I_smul_imaginaryPart x | |
| lemma complexify_traceFree [FiniteDimensional β V] (A:Module.End β (selfAdjoint V)) : | |
| complexify (traceFreeEnd A)=traceFreeEnd (complexify A) := by | |
| let : FiniteDimensional β (selfAdjoint V) := FiniteDimensional.of_surjective realPart realPart_surjective | |
| change complexifyLinear (A-(LinearMap.trace β _ A/(Module.finrank β _:β)) β’ 1)=_ | |
| rw [map_sub,map_smul] | |
| change complexify A-(LinearMap.trace β _ A/(Module.finrank β _:β)) β’ complexify 1=_ | |
| rw [complexify_one] | |
| simp only [traceFreeEnd,LinearMap.coe_mk,AddHom.coe_mk, | |
| complexify_trace (Module.finBasis β _),real_form_finrank,β Complex.ofReal_natCast,β Complex.ofReal_div] | |
| rfl | |
| end Complexification | |
| lemma restrictReal_traceFree_square (l:β) (J:ComplexStructure (Fin 8βFin 8)) (c:β) : | |
| restrictReal ((c:β) β’ traceFreeEnd (harmonicField l J*harmonicField l J))= | |
| c β’ traceFreeEnd (restrictReal (harmonicField l J)*restrictReal (harmonicField l J)) := by | |
| apply complexify_injective | |
| rw [complexify_restrictReal _ (harmonicEnd_star_of_conj _ (harmonic_weighted_generator_real l c J))] | |
| change _=complexifyLinear (c β’ traceFreeEnd (_*_)) | |
| rw [map_smul] | |
| change _=c β’ complexify (traceFreeEnd (_*_)) | |
| rw [complexify_traceFree,complexify_mul, | |
| complexify_restrictReal _ (harmonicField_star l J)] | |
| rfl | |
| lemma cartesian_conj_rotation (l:β) (J:ComplexStructure (Fin 8βFin 8)) : | |
| (realCartesianHarmonic l).conj (restrictReal (harmonicField l J))= | |
| Angular.rotation (J.reindex finSumFinEquiv.symm) l := by | |
| apply LinearMap.ext;intro P | |
| change realCartesianHarmonic l (restrictReal (harmonicField l J) ((realCartesianHarmonic l).symm P))=_ | |
| rw [realCartesian_rotation,LinearEquiv.apply_symm_apply] | |
| /-- Actual Cartesian generators share the original real-form simultaneous control. -/ | |
| def cartesianGenerator (L:β) (c:Fin Lββ) (J:ComplexStructure (Fin 8βFin 8)) : | |
| βl:Fin L,Module.End β (Angular.harmonicPolynomials 16 (l.val+2)) := fun l=> | |
| c l β’ traceFreeEnd (Angular.rotation (J.reindex finSumFinEquiv.symm) (l.val+2)* | |
| Angular.rotation (J.reindex finSumFinEquiv.symm) (l.val+2)) | |
| def endTupleConj {Ξ±:Type*} {V W:Ξ±βType*} | |
| [βi,AddCommGroup (V i)] [βi,Module β (V i)] [βi,AddCommGroup (W i)] [βi,Module β (W i)] | |
| (e:βi,V iββ[β]W i) : | |
| (βi,Module.End β (V i)) βββ ββ (βi,Module.End β (W i)) := | |
| (AlgEquiv.piCongrRight (fun i=>(e i).conjAlgEquiv β)).toLieEquiv | |
| def cartesianTupleEquiv (L:β) : | |
| (βl:Fin L,Module.End β (realHarmonicSpace (l.val+2))) βββ ββ | |
| (βl:Fin L,Module.End β (Angular.harmonicPolynomials 16 (l.val+2))) := | |
| endTupleConj (fun l:Fin L=>realCartesianHarmonic (l.val+2)) | |
| lemma cartesianTupleEquiv_apply (L:β) | |
| (X:βl:Fin L,Module.End β (realHarmonicSpace (l.val+2))) (l:Fin L) : | |
| cartesianTupleEquiv L X l=(realCartesianHarmonic (l.val+2)).conj (X l) := rfl | |
| lemma cartesian_generator_eq (L:β) (c:Fin Lββ) (J:ComplexStructure (Fin 8βFin 8)) : | |
| cartesianTupleEquiv L (realHarmonicTupleGenerator L c J)=cartesianGenerator L c J := by | |
| funext l | |
| rw [cartesianTupleEquiv_apply] | |
| change (realCartesianHarmonic (l.val+2)).conj (restrictReal (_ β’ traceFreeEnd (_*_)))=_ | |
| rw [restrictReal_traceFree_square,map_smul,conj_traceFree,conj_mul] | |
| change _=c l β’ traceFreeEnd (_*_) | |
| rw [cartesian_conj_rotation] | |
| theorem cartesian_simultaneous (L:β) (c:Fin Lββ) (hc:βl,c lβ 0) | |
| {X:βl:Fin L,Module.End β (Angular.harmonicPolynomials 16 (l.val+2))} | |
| (hX:βl,LinearMap.trace β _ (X l)=0) : | |
| XβLieSubalgebra.lieSpan β _ (Set.range (cartesianGenerator L c)) := by | |
| have ht (l:Fin L) : LinearMap.trace β _ ((cartesianTupleEquiv L).symm X l)=0 := by | |
| change LinearMap.trace β _ ((realCartesianHarmonic (l.val+2)).symm.conj (X l))=0 | |
| rw [LinearMap.trace_conj',hX l] | |
| have h := harmonic_simultaneous_actual_real L c hc ht | |
| have hm : X β (LieSubalgebra.lieSpan β _ (Set.range (realHarmonicTupleGenerator L c))).map | |
| (cartesianTupleEquiv L).toLieHom := | |
| (LieSubalgebra.mem_map _ _ _).mpr β¨(cartesianTupleEquiv L).symm X,h,(cartesianTupleEquiv L).apply_symm_apply Xβ© | |
| rw [LieSubalgebra.map_lieSpan] at hm | |
| have he : (cartesianTupleEquiv L).toLieHom '' Set.range (realHarmonicTupleGenerator L c)= | |
| Set.range (cartesianGenerator L c) := by | |
| rw [β Set.range_comp] | |
| exact congrArg Set.range (funext (cartesian_generator_eq L c)) | |
| rw [he] at hm | |
| exact hm | |
| end HarmonicCounterexample.Control | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.Control | |
| open Module | |
| attribute [local instance 100] LieRing.ofAssociativeRing | |
| variable {Ξ± ΞΊ:Type*} {V:Ξ±βType*} {ΞΉ:Ξ±βType*} | |
| [βi,AddCommGroup (V i)] [βi,Module β (V i)] | |
| [βi,Fintype (ΞΉ i)] [βi,DecidableEq (ΞΉ i)] | |
| def matrixTupleEquiv (b:βi,Basis (ΞΉ i) β (V i)) : | |
| (βi,End β (V i)) βββ ββ (βi,Matrix (ΞΉ i) (ΞΉ i) β) := | |
| (AlgEquiv.piCongrRight (fun i=>LinearMap.toMatrixAlgEquiv (b i))).toLieEquiv | |
| lemma matrixTupleEquiv_apply (b:βi,Basis (ΞΉ i) β (V i)) (X:βi,End β (V i)) (i:Ξ±) : | |
| matrixTupleEquiv b X i=LinearMap.toMatrix (b i) (b i) (X i) := rfl | |
| theorem simultaneous_toMatrix (b:βi,Basis (ΞΉ i) β (V i)) | |
| (g:ΞΊββi,End β (V i)) | |
| (hg:βX,(βi,LinearMap.trace β (V i) (X i)=0)β | |
| XβLieSubalgebra.lieSpan β _ (Set.range g)) : | |
| βX:(βi,Matrix (ΞΉ i) (ΞΉ i) β),(βi,(X i).trace=0)β | |
| XβLieSubalgebra.lieSpan β _ (Set.range (fun k=>matrixTupleEquiv b (g k))) := by | |
| intro X hX | |
| have ht (i:Ξ±) : LinearMap.trace β (V i) ((matrixTupleEquiv b).symm X i)=0 := by | |
| rw [LinearMap.trace_eq_matrix_trace β (b i)] | |
| change (matrixTupleEquiv b ((matrixTupleEquiv b).symm X) i).trace=0 | |
| rw [LieEquiv.apply_symm_apply] | |
| exact hX i | |
| have hm : Xβ(LieSubalgebra.lieSpan β _ (Set.range g)).map (matrixTupleEquiv b).toLieHom := | |
| (LieSubalgebra.mem_map _ _ _).mpr β¨(matrixTupleEquiv b).symm X,hg _ ht,(matrixTupleEquiv b).apply_symm_apply Xβ© | |
| rw [LieSubalgebra.map_lieSpan] at hm | |
| simpa only [β Set.range_comp,LieEquiv.coe_toLieHom,Function.comp_def] using hm | |
| end HarmonicCounterexample.Control | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.LinearODE | |
| open Module | |
| variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E] [FiniteDimensional β E] | |
| lemma orthogonalMatrix_eigen (T:EβL[β]E) (h:T.toLinearMap.IsSymmetric) : | |
| orthogonalMatrix (h.eigenvectorBasis rfl) T=Matrix.diagonal (h.eigenvalues rfl) := by | |
| change LinearMap.toMatrix _ _ T.toLinearMap=_ | |
| exact h.toMatrix_eigenvectorBasis rfl | |
| structure SpectralData (T:EβL[β]E) where | |
| basis : OrthonormalBasis (Fin (Module.finrank β E)) β E | |
| value : Fin (Module.finrank β E)ββ | |
| eigen : β i,T (basis i)=value i β’ basis i | |
| diagonal : orthogonalMatrix basis T=Matrix.diagonal value | |
| def spectralData (T:EβL[β]E) (h:T.toLinearMap.IsSymmetric) : SpectralData T where | |
| basis := h.eigenvectorBasis rfl | |
| value := h.eigenvalues rfl | |
| eigen i := h.apply_eigenvectorBasis rfl i | |
| diagonal := orthogonalMatrix_eigen T h | |
| end HarmonicCounterexample.LinearODE | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.Construction | |
| open Module Berger Angular LinearODE Control ComplexAngular | |
| open scoped InnerProductSpace | |
| abbrev H (l:β) := harmonicPolynomials 16 (l+2) | |
| abbrev Index (l:β) := Fin (Module.finrank β (H l)) | |
| abbrev CS := ComplexStructure (Fin 8βFin 8) | |
| def Jround : ComplexStructure (Fin 16) := (ComplexStructure.block 8).reindex (finSumFinEquiv (m:=8) (n:=8)).symm | |
| def D (l:β) (J:CS) : H lβL[β]H l := | |
| rotationCLM (J.reindex (finSumFinEquiv (m:=8) (n:=8)).symm) (l+2)*rotationCLM (J.reindex (finSumFinEquiv (m:=8) (n:=8)).symm) (l+2) | |
| def Dround (l:β) : H lβL[β]H l := D l (ComplexStructure.block 8) | |
| lemma dim_ge_two (l:β) : 2β€Module.finrank β (H l) := by | |
| rw [β (realCartesianHarmonic (l+2)).finrank_eq,realHarmonicSpace_finrank, | |
| harmonicSpace_finrank_sixteen] | |
| have h1 := Nat.choose_pos (show 14β€l+16 by omega) | |
| have h2 := Nat.choose_pos (show 14β€l+15 by omega) | |
| omega | |
| instance indexNontrivial (l:β) : Nontrivial (Index l) := Fin.nontrivial_iff_two_le.mpr (dim_ge_two l) | |
| instance CSnonempty : Nonempty CS := β¨ComplexStructure.block 8β© | |
| lemma D_symmetric (l:β) (J:CS) : (D l J).IsSymmetric := | |
| rotationCLM_square_symmetric _ _ | |
| lemma Dround_symmetric (l:β) : (Dround l).toLinearMap.IsSymmetric := D_symmetric l _ | |
| def spectrum (l:β) : SpectralData (Dround l) := spectralData (Dround l) (Dround_symmetric l) | |
| abbrev basis (l:β) : OrthonormalBasis (Index l) β (H l) := (spectrum l).basis | |
| abbrev d0 (l:β) : Index lββ := (spectrum l).value | |
| lemma basis_eigen (l:β) (i:Index l) : Dround l (basis l i)=d0 l i β’ basis l i := by | |
| with_reducible exact (spectrum l).eigen i | |
| lemma Dround_diagonal (l:β) : orthogonalMatrix (basis l) (Dround l)=Matrix.diagonal (d0 l) := by | |
| with_reducible exact (spectrum l).diagonal | |
| def degree (l:β) : β := (l:β)+2 | |
| def B (l:β) : β := degree l*(degree l+14) | |
| def beta : β := (a^2)β»ΒΉ | |
| def theta (l:β) : β := -7+Real.sqrt (49+beta*B l) | |
| lemma degree_pos (l:β) : 0<degree l := by unfold degree;positivity | |
| lemma B_pos (l:β) : 0<B l := mul_pos (degree_pos l) (by linarith [degree_pos l]) | |
| lemma beta_pos : 0<beta := inv_pos.mpr (sq_pos_of_pos a_pos) | |
| lemma theta_pos (l:β) : 0<theta l := by | |
| have hb := mul_pos beta_pos (B_pos l) | |
| have h := Real.sq_sqrt (show 0β€49+beta*B l by linarith) | |
| have hn := Real.sqrt_nonneg (49+beta*B l) | |
| unfold theta;nlinarith | |
| lemma theta_root (l:β) : beta*B l-14*theta l-(theta l)^2=0 := by | |
| have h := Real.sq_sqrt (show 0β€49+beta*B l by have := mul_pos beta_pos (B_pos l);linarith) | |
| unfold theta;nlinarith | |
| lemma D_nonpos (l:β) (J:CS) (v:H l) : inner β v (D l J v) β€ 0 := by | |
| have h := rotationCLM_square_nonpos (J.reindex (finSumFinEquiv (m:=8) (n:=8)).symm) (l+2) v | |
| exact h | |
| lemma D_lower (l:β) (J:CS) (v:H l) : -(B l*βvβ^2)β€ inner β v (D l J v) := by | |
| have h := rotationCLM_square_lower (J.reindex (finSumFinEquiv (m:=8) (n:=8)).symm) (l+2) v | |
| change _ β€ inner β v (D l J v) at h | |
| simp only [Nat.cast_add,Nat.cast_ofNat] at h | |
| have hb : (l+2:β)^2β€B l := by unfold B degree;nlinarith [Nat.cast_nonneg (Ξ±:=β) l] | |
| exact (by nlinarith [sq_nonneg βvβ] : -(B l*βvβ^2)β€-(l+2:β)^2*βvβ^2).trans h | |
| def system (L:β) : PulseSystem (fun l:Fin L=>H l.val) (fun l:Fin L=>Index l.val) CS where | |
| basis l := basis l.val | |
| r := 1/15 | |
| pβ := 14 | |
| Ξ³ := 10 | |
| M := 2 | |
| B l := B l.val | |
| Ξ² _ := beta | |
| ΞΈ l := theta l.val | |
| D l J := D l.val J | |
| hD l := D_nonpos l.val | |
| hBD l := D_lower l.val | |
| hM := by norm_num | |
| hB l := (B_pos l.val).le | |
| hΞΈ l := theta_pos l.val | |
| hΞ³ := by norm_num | |
| hden l := by have := theta_pos l.val;linarith | |
| hroot l := theta_root l.val | |
| end HarmonicCounterexample.Construction | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.LinearODE | |
| variable {E:Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| lemma slow_linearMap (r B beta p theta:β) (D:EβL[β]E) : | |
| (bergerSlowGenerator r B beta p theta 1 D).toLinearMap= | |
| (beta/(p+2*theta)) β’ ((r*B) β’ (1:Module.End β E)+D.toLinearMap) := by | |
| ext v | |
| simp only [bergerSlowGenerator,mul_one,ContinuousLinearMap.coe_coe, | |
| smul_apply,add_apply,one_apply_eq_self,LinearMap.smul_apply, | |
| LinearMap.add_apply,Module.End.one_apply,smul_smul] | |
| lemma orthogonalMatrix_eq_matrix {F:Type*} [NormedAddCommGroup F] {ΞΉ:Type*} [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| [InnerProductSpace β F] [FiniteDimensional β F] (b:OrthonormalBasis ΞΉ β F) (T:FβL[β]F) | |
| (A:Module.End β F) (h:T.toLinearMap=A) : | |
| orthogonalMatrix b T=LinearMap.toMatrix b.toBasis b.toBasis A := by | |
| change LinearMap.toMatrix b.toBasis b.toBasis T.toLinearMap=_ | |
| rw [h] | |
| lemma orthogonalMatrix_toMatrix {F:Type*} [NormedAddCommGroup F] [InnerProductSpace β F] | |
| [FiniteDimensional β F] {ΞΉ:Type*} [Fintype ΞΉ] [DecidableEq ΞΉ] | |
| (b:OrthonormalBasis ΞΉ β F) (T:FβL[β]F) : | |
| orthogonalMatrix b T=LinearMap.toMatrix b.toBasis b.toBasis T.toLinearMap := rfl | |
| end HarmonicCounterexample.LinearODE | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.Control | |
| open Module | |
| variable {Ξ±:Type*} {V:Ξ±βType*} {ΞΉ:Ξ±βType*} | |
| [βi,AddCommGroup (V i)] [βi,Module β (V i)] | |
| [βi,Fintype (ΞΉ i)] [βi,DecidableEq (ΞΉ i)] | |
| lemma matrixTupleEquiv_trace (b:βi,Basis (ΞΉ i) β (V i)) | |
| (X:βi,Module.End β (V i)) (i:Ξ±) : | |
| (matrixTupleEquiv b X i).trace=LinearMap.trace β (V i) (X i) := | |
| (LinearMap.trace_eq_matrix_trace β (b i) (X i)).symm | |
| end HarmonicCounterexample.Control | |
| end | |
| noncomputable section | |
| namespace HarmonicCounterexample.Construction | |
| open Module Angular LinearODE Control Berger | |
| attribute [local instance 100] LieRing.ofAssociativeRing | |
| open scoped BigOperators | |
| lemma D_trace (l:β) (J:CS) : LinearMap.trace β (H l) (D l J).toLinearMap= | |
| -(B l/15)*(Module.finrank β (H l):β) := by | |
| have h := rotation_square_trace16 (J.reindex (finSumFinEquiv (m:=8) (n:=8)).symm) (l+2) | |
| simp only [Nat.cast_add,Nat.cast_ofNat] at h | |
| exact h | |
| lemma rank_ne (l:β) : (Module.finrank β (H l):β)β 0 := by | |
| exact_mod_cast (show Module.finrank β (H l)β 0 by have := dim_ge_two l;omega) | |
| lemma traceFree_D (l:β) (J:CS) : | |
| traceFreeEnd (D l J).toLinearMap=(B l/15) β’ (1:Module.End β (H l))+(D l J).toLinearMap := by | |
| change (D l J).toLinearMap-(LinearMap.trace β (H l) (D l J).toLinearMap/ | |
| (Module.finrank β (H l):β)) β’ 1=_ | |
| rw [D_trace,mul_div_cancel_rightβ _ (rank_ne l)] | |
| module | |
| lemma traceFree_D_trace (l:β) (J:CS) : | |
| LinearMap.trace β (H l) (traceFreeEnd (D l J).toLinearMap)=0 := by | |
| rw [traceFree_D,map_add,map_smul,LinearMap.trace_one,D_trace] | |
| simp only [smul_eq_mul] | |
| ring | |
| def controlScale (L:β) (l:Fin L) : β := beta/(14+2*theta l.val) | |
| lemma controlScale_ne (L:β) (l:Fin L) : controlScale L lβ 0 := | |
| div_ne_zero beta_pos.ne' (by have := theta_pos l.val;linarith) | |
| lemma slow_toLinearMap (l:β) (J:CS) : | |
| (bergerSlowGenerator (1/15) (B l) beta 14 (theta l) 1 (D l J)).toLinearMap= | |
| (beta/(14+2*theta l)) β’ traceFreeEnd (D l J).toLinearMap := by | |
| rw [traceFree_D] | |
| have h := LinearODE.slow_linearMap (1/15) (B l) beta 14 (theta l) (D l J) | |
| norm_num only [one_div_mul_eq_div] at h | |
| with_reducible exact h | |
| lemma D_toLinearMap (l:β) (J:CS) : (D l J).toLinearMap= | |
| rotation (J.reindex finSumFinEquiv.symm) (l+2)*rotation (J.reindex finSumFinEquiv.symm) (l+2) := by | |
| ext P | |
| rfl | |
| lemma generator_eq (L:β) : (system L).generator= | |
| fun J=>matrixTupleEquiv (fun l:Fin L=>(basis l.val).toBasis) | |
| (cartesianGenerator L (controlScale L) J) := by | |
| funext J l | |
| simp only [PulseSystem.generator,matrixTupleEquiv_apply,cartesianGenerator,system] | |
| rw [orthogonalMatrix_toMatrix,slow_toLinearMap,D_toLinearMap] | |
| unfold controlScale | |
| congr 1 | |
| lemma generator_trace (L:β) (J:CS) (l:Fin L) : ((system L).generator J l).trace=0 := by | |
| rw [generator_eq,matrixTupleEquiv_trace] | |
| have h := traceFree_D_trace l.val J | |
| have hm := (LinearMap.trace β (H l.val)).map_smul (controlScale L l) | |
| (traceFreeEnd (D l.val J).toLinearMap) | |
| simp only [h,smul_zero] at hm | |
| exact hm | |
| lemma generator_full (L:β) (X:βl:Fin L,Matrix (Index l.val) (Index l.val) β) | |
| (hX:βl,(X l).trace=0) : | |
| XβLieSubalgebra.lieSpan β _ (Set.range (system L).generator) := by | |
| rw [generator_eq] | |
| exact simultaneous_toMatrix (fun l:Fin L=>(basis l.val).toBasis) | |
| (cartesianGenerator L (controlScale L)) | |
| (fun X hX=>cartesian_simultaneous L (controlScale L) (controlScale_ne L) hX) X hX | |
| end HarmonicCounterexample.Construction | |
| end | |
| end OAI | |