Navier–Stokes: the Lean blow-up proof, cleaned up together
OpenAI's 2026 Lean proofs of blowup for forced Navier–Stokes and Euler, rerun by others, not refereed, no ruling from Clay; cleaned up together: more readable, faster to build

refactor(Euler/Parent): 22 small modules folded into the file that imports them (−23.4%, measured) #698
Merged
+0 −54 Euler/ParentChildEulerMatch.lean deleted
| @@ -1,54 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketExactPressure | |
| 2 | -import Euler.ParentPacketExactDivergence | |
| 3 | - | |
| 4 | -/-! The new parent is the particle map of the actual corrected Euler | |
| 5 | -velocity, and its acceleration is minus the actual constructed pressure | |
| 6 | -force. Both matches are derived from the existing parent law and Euler. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentPacketFrames.Parent | |
| 11 | - | |
| 12 | -open Set EulerSmoothLimit EulerLiftedGradientSpace EulerTransverseFrameCoordinates | |
| 13 | - EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 14 | - EulerGraphInvariantFlow EulerLagrangian | |
| 15 | - | |
| 16 | -variable (A : EulerParentPacketFrames.Parent) | |
| 17 | - {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 18 | - (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 19 | - (support : Set Space) (hSupport : IsCompact support) | |
| 20 | - | |
| 21 | - | |
| 22 | -variable {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 23 | - {Z R : FieldTower P A.T} | |
| 24 | - (B : Budget P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 25 | - (residual : ApproximationResidual P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 26 | - {raw : EulerPacketProfileRecursion.VectorField} | |
| 27 | - (V : EulerPacketCylinderField.Field P A.T raw) (hV : Z=V.toFieldTower) | |
| 28 | - (G : EulerPhysicalGraphFlowBounds.Data P A.T) (hG : G.A=B.liftedPacketCoefficient P V) | |
| 29 | - (k : ℝ) (hk : k*κ=1) (hgraph : ∀ t q, graphConstraint k m (G.A.field t q)=0) | |
| 30 | - (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 31 | - (Y : Icc (0 : ℝ) A.T → Space → Space) | |
| 32 | - (hYX : ∀ t x, Y t (A.position t x)=x) | |
| 33 | - (hXY : ∀ t x, A.position t (Y t x)=x) (hY : Continuous (Function.uncurry Y)) | |
| 34 | - (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) | |
| 35 | - (force : Icc (0 : ℝ) A.T → Space → Space) | |
| 36 | - (hforce : Continuous (Function.uncurry force)) | |
| 37 | - (hgradient : ∀ (t : Icc (0 : ℝ) A.T) x, gradient (fun y => p (t,y)) x=force t x) | |
| 38 | - (hvelocity : ∀ (t : Icc (0 : ℝ) A.T) x, A.velocity.field t x=u (t,A.position t x)) | |
| 39 | - (hu : ∀ t ∈ Ioo 0 A.T, ∀ x, DifferentiableAt ℝ u (t,x)) | |
| 40 | - (hp : ∀ (t : Icc (0 : ℝ) A.T) x, DifferentiableAt ℝ (fun y => p (t,y)) x) | |
| 41 | - (heuler : ∀ t ∈ Ioo 0 A.T, ∀ x, momentumResidual u p (t,x)=0) | |
| 42 | - | |
| 43 | -include hV hG hYX hvelocity in | |
| 44 | -theorem child_velocity_exact (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 45 | - (A.child G k m hgraph nextEll hnext hnext1).velocity.field t x = | |
| 46 | - A.exactPacketVelocity m hm J support hSupport B residual k Y u | |
| 47 | - (t,(A.child G k m hgraph nextEll hnext hnext1).position t x) := by | |
| 48 | - have h := A.child_velocity_corrected B V hV G hG k hgraph nextEll hnext hnext1 | |
| 49 | - Y (fun s y => u (s,y)) hYX hvelocity t x | |
| 50 | - exact h.trans | |
| 51 | - (A.exactPacketVelocity_eq_corrected m hm J support hSupport B residual k Y u t | |
| 52 | - ((A.child G k m hgraph nextEll hnext hnext1).position t x)).symm | |
| 53 | - | |
| 54 | -end EulerParentPacketFrames.Parent | |
+0 −59 Euler/ParentCorrectionCostEnvelope.lean deleted
| @@ -1,59 +0,0 @@ | ||
| 1 | -import Euler.ParentCoefficientPolynomial | |
| 2 | -import Euler.PacketCorrectionPrimitiveBounds | |
| 3 | - | |
| 4 | -/-! Composing the actual coefficient envelope with the parent label | |
| 5 | -polynomial gives a single fixed polynomial in the parent size K. -/ | |
| 6 | - | |
| 7 | -noncomputable section | |
| 8 | - | |
| 9 | -namespace EulerParentCorrectionCost | |
| 10 | - | |
| 11 | -open EulerParentCoefficientPolynomial EulerPacketCorrectionPrimitive EulerPolynomialCost | |
| 12 | - | |
| 13 | -variable (P : ℝ) [Fact (0 < P)] | |
| 14 | - | |
| 15 | -def parentEnvelope (K : ℝ) : ℝ := | |
| 16 | - 1+leafEnvelope K+primitiveEnvelope P (leafEnvelope K) | |
| 17 | - | |
| 18 | -def parentPolynomial : Polynomial ℝ := | |
| 19 | - 1+leafPolynomial+(primitivePolynomial P).comp leafPolynomial | |
| 20 | - | |
| 21 | -def parentConstant : ℝ := coefficientCost (parentPolynomial P) | |
| 22 | -def parentPower : ℕ := (parentPolynomial P).natDegree | |
| 23 | - | |
| 24 | -theorem parentConstant_pos : 0 < parentConstant P := coefficientCost_pos _ | |
| 25 | - | |
| 26 | -theorem parentPolynomial_eval (K : ℝ) : (parentPolynomial P).eval K=parentEnvelope P K := by | |
| 27 | - simp only [parentPolynomial,parentEnvelope,Polynomial.eval_add,Polynomial.eval_one, | |
| 28 | - Polynomial.eval_comp,leafPolynomial_eval,primitivePolynomial_eval] | |
| 29 | - | |
| 30 | -theorem parentEnvelope_power (K : ℝ) (hK : 1 ≤ K) : | |
| 31 | - parentEnvelope P K ≤ parentConstant P*K^parentPower P := by | |
| 32 | - rw [← parentPolynomial_eval] | |
| 33 | - exact (le_abs_self _).trans (eval_bound (parentPolynomial P) K hK) | |
| 34 | - | |
| 35 | -theorem parentEnvelope_bounds (K : ℝ) (hK : 0 ≤ K) : | |
| 36 | - 1 ≤ parentEnvelope P K ∧ leafEnvelope K ≤ parentEnvelope P K ∧ | |
| 37 | - primitiveEnvelope P (leafEnvelope K) ≤ parentEnvelope P K := by | |
| 38 | - have hl := (leaf_bounds K hK).1 | |
| 39 | - have hp := (primitive_components P (leafEnvelope K) (zero_le_one.trans hl)).1 | |
| 40 | - unfold parentEnvelope | |
| 41 | - exact ⟨by linarith,by linarith,by linarith⟩ | |
| 42 | - | |
| 43 | -end EulerParentCorrectionCost | |
| 44 | - | |
| 45 | -namespace EulerPacketCylinderField.CoefficientBudget | |
| 46 | - | |
| 47 | -open EulerParentCorrectionCost EulerParentCoefficientPolynomial | |
| 48 | - | |
| 49 | -variable {P T : ℝ} [Fact (0 < P)] {O : EulerPacketProfileRecursion.Operators} | |
| 50 | - {C : CoefficientData P T O} (B : CoefficientBudget C) | |
| 51 | - | |
| 52 | -theorem parent_primitive_bound (K : ℝ) (hK : 0 ≤ K) | |
| 53 | - (hR : B.Rc ≤ leafEnvelope K) (hC : B.amplitude ≤ leafEnvelope K) : | |
| 54 | - B.multiplierCost ≤ parentEnvelope P K ∧ B.termCost ≤ parentEnvelope P K := by | |
| 55 | - have h := B.primitive_bound (leafEnvelope K) (zero_le_one.trans (leaf_bounds K hK).1) hR hC | |
| 56 | - have he := (parentEnvelope_bounds P K hK).2.2 | |
| 57 | - exact ⟨h.1.trans he,h.2.trans he⟩ | |
| 58 | - | |
| 59 | -end EulerPacketCylinderField.CoefficientBudget | |
+193 −1 Euler/ParentEulerChild.lean View file
| @@ -1,10 +1,202 @@ | ||
| 1 | 1 | import Euler.ParentEulerState |
| 2 | -import Euler.ParentChildEulerMatch | |
| 2 | +import Euler.ParentPacketExactPressure | |
| 3 | +import Euler.ParentPacketExactEuler | |
| 4 | +import Euler.PacketExactPhysicalEuler | |
| 3 | 5 | |
| 4 | 6 | /-! The same exact packet that constructs the next particle map supplies |
| 5 | 7 | its physical Euler evolution. All new flow and Euler laws are proved |
| 6 | 8 | from the old evolution and the actual correction solver. -/ |
| 7 | 9 | |
| 10 | +/-! ## From `Euler/ParentPacketExactDivergence.lean` | |
| 11 | + | |
| 12 | +The text of `Euler/ParentPacketExactDivergence.lean`, folded into this file, which was its only importer. -/ | |
| 13 | + | |
| 14 | +section | |
| 15 | + | |
| 16 | +/-! Incompressibility of the actual corrected parent velocity. The | |
| 17 | +normalized packet uses the parent's genuine determinant-one Jacobian, | |
| 18 | +and the final physical rescaling preserves divergence exactly. -/ | |
| 19 | + | |
| 20 | +noncomputable section | |
| 21 | + | |
| 22 | +namespace EulerSpatialRescaling | |
| 23 | + | |
| 24 | +open EulerSmoothLimit | |
| 25 | + | |
| 26 | +theorem divergence_eq (ell : ℝ) (hell : ell ≠ 0) | |
| 27 | + (u : ℝ × Space → Space) (t : ℝ) (x : Space) | |
| 28 | + (hu : DifferentiableAt ℝ (fun y => u (t,y)) (ell⁻¹ • x)) : | |
| 29 | + divergence (fun y => velocity ell u (t,y)) x = | |
| 30 | + divergence (fun y => u (t,y)) (ell⁻¹ • x) := by | |
| 31 | + rw [divergence_eq_trace,spatial_derivative ell hell u t x hu] | |
| 32 | + rfl | |
| 33 | + | |
| 34 | +end EulerSpatialRescaling | |
| 35 | + | |
| 36 | +namespace EulerParentPacketFrames.Parent | |
| 37 | + | |
| 38 | +open Set Filter EulerSmoothLimit EulerLiftedGradientSpace EulerTransverseFrameCoordinates | |
| 39 | + EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 40 | + EulerPacketPhysicalTransform EulerLagrangian | |
| 41 | +open scoped ContDiff Topology | |
| 42 | + | |
| 43 | +variable (A : EulerParentPacketFrames.Parent) | |
| 44 | + | |
| 45 | +theorem normalizedVelocity_divergence (u : ℝ × Space → Space) (t : ℝ) (x : Space) | |
| 46 | + (hu : DifferentiableAt ℝ (fun y => u (t,y)) (A.ell • x)) : | |
| 47 | + divergence (fun y => A.normalizedVelocity u (t,y)) x = | |
| 48 | + divergence (fun y => u (t,y)) (A.ell • x) := by | |
| 49 | + have h := EulerSpatialRescaling.divergence_eq A.ell⁻¹ (inv_ne_zero A.ell_pos.ne') | |
| 50 | + u t x (by simpa only [inv_inv] using hu) | |
| 51 | + simpa only [normalizedVelocity,inv_inv] using h | |
| 52 | + | |
| 53 | +theorem packetPosition_spatial_frame (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 54 | + fderiv ℝ (fun y => A.packetPosition (t,y)) x=A.packetFrame (t,x) := by | |
| 55 | + rw [(A.packetPosition_spatial t x).fderiv] | |
| 56 | + exact (A.frame.realField_apply A.T A.T_pos.le t x).symm | |
| 57 | + | |
| 58 | +theorem packetFrame_det (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 59 | + (EulerPacketPiola.operatorMatrix (A.packetFrame (t,x))).det=1 := by | |
| 60 | + change (EulerPacketPiola.operatorMatrix (A.frame.realField A.T A.T_pos.le t x)).det=1 | |
| 61 | + rw [A.frame.realField_apply A.T A.T_pos.le t x] | |
| 62 | + exact A.frame_det t x | |
| 63 | + | |
| 64 | +variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 65 | + (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 66 | + (support : Set Space) (hSupport : IsCompact support) | |
| 67 | + {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 68 | + {Z R : FieldTower P A.T} | |
| 69 | + (B : Budget P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 70 | + (residual : ApproximationResidual P A.T_pos | |
| 71 | + (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 72 | + (k : ℝ) (hk : k*κ=1) (Y : Icc (0 : ℝ) A.T → Space → Space) | |
| 73 | + (hYX : ∀ t x, Y t (A.position t x)=x) | |
| 74 | + (hXY : ∀ t x, A.position t (Y t x)=x) (hY : Continuous (Function.uncurry Y)) | |
| 75 | + (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) | |
| 76 | + (hvelocity : ∀ (t : Icc (0 : ℝ) A.T) x, A.velocity.field t x=u (t,A.position t x)) | |
| 77 | + (hu : ∀ t ∈ Ioo 0 A.T, ∀ x, DifferentiableAt ℝ u (t,x)) | |
| 78 | + (hp : ∀ (t : Icc (0 : ℝ) A.T) x, DifferentiableAt ℝ (fun y => p (t,y)) x) | |
| 79 | + (heuler : ∀ t ∈ Ioo 0 A.T, ∀ x, momentumResidual u p (t,x)=0) | |
| 80 | + (hdiv : ∀ t ∈ Ioo 0 A.T, ∀ x, divergence (fun y => u (t,y)) x=0) | |
| 81 | + | |
| 82 | +include hYX hXY hY hvelocity hu hp heuler hdiv hk in | |
| 83 | +theorem normalizedExact_euler (t : ℝ) (ht : t ∈ Ioo 0 A.T) (x : Space) : | |
| 84 | + momentumResidual (A.normalizedExactVelocity m hm J support hSupport B residual k Y u) | |
| 85 | + (A.normalizedExactPressure m hm J support hSupport B residual k Y p) (t,x)=0 ∧ | |
| 86 | + divergence (fun y => A.normalizedExactVelocity m hm J support hSupport B residual k Y u (t,y)) x=0 := by | |
| 87 | + let y := A.packetInverse Y (t,x) | |
| 88 | + have hy : A.packetPosition (t,y)=x := A.packetInverse_right Y hXY (t,x) | |
| 89 | + have hd : divergence (fun z => A.normalizedVelocity u (t,z)) (A.packetPosition (t,y))=0 := by | |
| 90 | + rw [A.normalizedVelocity_divergence u t (A.packetPosition (t,y))] | |
| 91 | + · exact hdiv t ht _ | |
| 92 | + · exact (hu t ht _).comp _ (hasFDerivAt_prodMk_right t _).differentiableAt | |
| 93 | + have hh := exact_source_euler (A.transverseData m hm J support hSupport) | |
| 94 | + (exactPacketOfResidual P B residual) k hk A.packetFrame (A.normalizedVelocity u) | |
| 95 | + (A.normalizedPressure p) A.packetPosition (A.packetInverse Y) | |
| 96 | + (A.packetFrame_match m hm J support hSupport) t ht y | |
| 97 | + (fun s z => A.packetInverse_left Y hYX (s,z)) | |
| 98 | + (A.packetInverseCoordinates_differentiableAt Y hXY hY t ht (A.packetPosition (t,y))) | |
| 99 | + (A.packetPosition_contDiffAt_two t ht y) | |
| 100 | + (A.packetPosition_frame_eventually t ht y) | |
| 101 | + (A.packetPosition_velocity_eventually u hvelocity t ht y) | |
| 102 | + (A.packetPosition_spatial_frame ⟨t,ht.1.le,ht.2.le⟩) | |
| 103 | + (A.packetFrame_det ⟨t,ht.1.le,ht.2.le⟩) | |
| 104 | + (A.normalizedVelocity_differentiableAt u t (A.packetPosition (t,y)) | |
| 105 | + (hu t ht (A.ell • A.packetPosition (t,y)))) | |
| 106 | + (A.normalizedPressure_differentiableAt p t (A.packetPosition (t,y)) | |
| 107 | + (hp ⟨t,ht.1.le,ht.2.le⟩ (A.ell • A.packetPosition (t,y)))) | |
| 108 | + (A.normalizedMomentum_zero u p t (A.packetPosition (t,y)) | |
| 109 | + (hu t ht (A.ell • A.packetPosition (t,y))) | |
| 110 | + (hp ⟨t,ht.1.le,ht.2.le⟩ (A.ell • A.packetPosition (t,y))) | |
| 111 | + (heuler t ht (A.ell • A.packetPosition (t,y)))) hd | |
| 112 | + rw [hy] at hh | |
| 113 | + exact hh | |
| 114 | + | |
| 115 | +include hYX hXY hY hvelocity hu hp heuler hdiv hk in | |
| 116 | +theorem exactPacket_euler (t : ℝ) (ht : t ∈ Ioo 0 A.T) (x : Space) : | |
| 117 | + momentumResidual (A.exactPacketVelocity m hm J support hSupport B residual k Y u) | |
| 118 | + (A.exactPacketPressure m hm J support hSupport B residual k Y p) (t,x)=0 ∧ | |
| 119 | + divergence (fun y => A.exactPacketVelocity m hm J support hSupport B residual k Y u (t,y)) x=0 := by | |
| 120 | + refine ⟨A.exactPacket_momentum m hm J support hSupport B residual k hk Y | |
| 121 | + hYX hXY hY u p hvelocity hu hp heuler t ht x,?_⟩ | |
| 122 | + have hd : DifferentiableAt ℝ | |
| 123 | + (fun y => A.normalizedExactVelocity m hm J support hSupport B residual k Y u (t,y)) | |
| 124 | + (A.ell⁻¹ • x) := | |
| 125 | + (A.normalizedExactVelocity_differentiableAt m hm J support hSupport B residual k Y | |
| 126 | + hYX hXY hY u hu t ht (A.ell⁻¹ • x)).comp _ | |
| 127 | + (hasFDerivAt_prodMk_right t _).differentiableAt | |
| 128 | + change divergence (fun y => EulerSpatialRescaling.velocity A.ell | |
| 129 | + (A.normalizedExactVelocity m hm J support hSupport B residual k Y u) (t,y)) x=0 | |
| 130 | + rw [EulerSpatialRescaling.divergence_eq A.ell A.ell_pos.ne' _ t x hd] | |
| 131 | + exact (A.normalizedExact_euler m hm J support hSupport B residual k hk Y | |
| 132 | + hYX hXY hY u p hvelocity hu hp heuler hdiv t ht (A.ell⁻¹ • x)).2 | |
| 133 | + | |
| 134 | +end EulerParentPacketFrames.Parent | |
| 135 | +end | |
| 136 | + | |
| 137 | +end | |
| 138 | + | |
| 139 | +/-! ## From `Euler/ParentChildEulerMatch.lean` | |
| 140 | + | |
| 141 | +The text of `Euler/ParentChildEulerMatch.lean`, folded into this file, which was its only importer. -/ | |
| 142 | + | |
| 143 | +section | |
| 144 | + | |
| 145 | +/-! The new parent is the particle map of the actual corrected Euler | |
| 146 | +velocity, and its acceleration is minus the actual constructed pressure | |
| 147 | +force. Both matches are derived from the existing parent law and Euler. -/ | |
| 148 | + | |
| 149 | +noncomputable section | |
| 150 | + | |
| 151 | +namespace EulerParentPacketFrames.Parent | |
| 152 | + | |
| 153 | +open Set EulerSmoothLimit EulerLiftedGradientSpace EulerTransverseFrameCoordinates | |
| 154 | + EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 155 | + EulerGraphInvariantFlow EulerLagrangian | |
| 156 | + | |
| 157 | +variable (A : EulerParentPacketFrames.Parent) | |
| 158 | + {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 159 | + (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 160 | + (support : Set Space) (hSupport : IsCompact support) | |
| 161 | + | |
| 162 | + | |
| 163 | +variable {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 164 | + {Z R : FieldTower P A.T} | |
| 165 | + (B : Budget P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 166 | + (residual : ApproximationResidual P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 167 | + {raw : EulerPacketProfileRecursion.VectorField} | |
| 168 | + (V : EulerPacketCylinderField.Field P A.T raw) (hV : Z=V.toFieldTower) | |
| 169 | + (G : EulerPhysicalGraphFlowBounds.Data P A.T) (hG : G.A=B.liftedPacketCoefficient P V) | |
| 170 | + (k : ℝ) (hk : k*κ=1) (hgraph : ∀ t q, graphConstraint k m (G.A.field t q)=0) | |
| 171 | + (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 172 | + (Y : Icc (0 : ℝ) A.T → Space → Space) | |
| 173 | + (hYX : ∀ t x, Y t (A.position t x)=x) | |
| 174 | + (hXY : ∀ t x, A.position t (Y t x)=x) (hY : Continuous (Function.uncurry Y)) | |
| 175 | + (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) | |
| 176 | + (force : Icc (0 : ℝ) A.T → Space → Space) | |
| 177 | + (hforce : Continuous (Function.uncurry force)) | |
| 178 | + (hgradient : ∀ (t : Icc (0 : ℝ) A.T) x, gradient (fun y => p (t,y)) x=force t x) | |
| 179 | + (hvelocity : ∀ (t : Icc (0 : ℝ) A.T) x, A.velocity.field t x=u (t,A.position t x)) | |
| 180 | + (hu : ∀ t ∈ Ioo 0 A.T, ∀ x, DifferentiableAt ℝ u (t,x)) | |
| 181 | + (hp : ∀ (t : Icc (0 : ℝ) A.T) x, DifferentiableAt ℝ (fun y => p (t,y)) x) | |
| 182 | + (heuler : ∀ t ∈ Ioo 0 A.T, ∀ x, momentumResidual u p (t,x)=0) | |
| 183 | + | |
| 184 | +include hV hG hYX hvelocity in | |
| 185 | +theorem child_velocity_exact (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 186 | + (A.child G k m hgraph nextEll hnext hnext1).velocity.field t x = | |
| 187 | + A.exactPacketVelocity m hm J support hSupport B residual k Y u | |
| 188 | + (t,(A.child G k m hgraph nextEll hnext hnext1).position t x) := by | |
| 189 | + have h := A.child_velocity_corrected B V hV G hG k hgraph nextEll hnext hnext1 | |
| 190 | + Y (fun s y => u (s,y)) hYX hvelocity t x | |
| 191 | + exact h.trans | |
| 192 | + (A.exactPacketVelocity_eq_corrected m hm J support hSupport B residual k Y u t | |
| 193 | + ((A.child G k m hgraph nextEll hnext hnext1).position t x)).symm | |
| 194 | + | |
| 195 | +end EulerParentPacketFrames.Parent | |
| 196 | +end | |
| 197 | + | |
| 198 | +end | |
| 199 | + | |
| 8 | 200 | noncomputable section |
| 9 | 201 | |
| 10 | 202 | namespace EulerParentPacketFrames.Evolution |
+0 −19 Euler/ParentEulerEndpoints.lean deleted
| @@ -1,19 +0,0 @@ | ||
| 1 | -import Euler.ParentEulerSobolev | |
| 2 | - | |
| 3 | -/-! The physical gradient is continuous up to the endpoints in the | |
| 4 | -actual Sobolev class. Incompressibility therefore holds at time zero | |
| 5 | -and the final time as well as in the open Euler interval. -/ | |
| 6 | - | |
| 7 | -noncomputable section | |
| 8 | - | |
| 9 | -namespace EulerParentPacketFrames.SobolevData | |
| 10 | - | |
| 11 | -open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field | |
| 12 | - EulerMeanSobolevBoundedField EulerMeanCoefficients | |
| 13 | -open scoped Topology | |
| 14 | - | |
| 15 | -variable {A : Parent} {E : Evolution A} (S : SobolevData E) | |
| 16 | - | |
| 17 | -include S | |
| 18 | - | |
| 19 | -end EulerParentPacketFrames.SobolevData | |
+0 −21 Euler/ParentEulerParity.lean deleted
| @@ -1,21 +0,0 @@ | ||
| 1 | -import Euler.ParentEulerState | |
| 2 | -import Euler.ParentPacketParity | |
| 3 | - | |
| 4 | -/-! The physical velocity and pressure force inherit the genuine | |
| 5 | -particle symmetry, so their values vanish at the fixed origin. -/ | |
| 6 | - | |
| 7 | -noncomputable section | |
| 8 | - | |
| 9 | -namespace EulerParentPacketFrames.Evolution | |
| 10 | - | |
| 11 | -open Set EulerSmoothLimit | |
| 12 | - | |
| 13 | -variable {A : Parent} (E : Evolution A) (O : OddData A) | |
| 14 | - | |
| 15 | -include O | |
| 16 | - | |
| 17 | -theorem strain_origin (t : Icc (0 : ℝ) A.T) : | |
| 18 | - A.strain.field t 0=fderiv ℝ (fun y => E.velocity (t,y)) 0 := by | |
| 19 | - rw [E.strain_eq,smul_zero,O.position_zero] | |
| 20 | - | |
| 21 | -end EulerParentPacketFrames.Evolution | |
+0 −58 Euler/ParentEulerSobolevChild.lean deleted
| @@ -1,58 +0,0 @@ | ||
| 1 | -import Euler.ParentEulerChild | |
| 2 | -import Euler.ParentEulerSobolev | |
| 3 | -import Euler.ParentPacketSobolevFields | |
| 4 | - | |
| 5 | -/-! The constructed child Euler evolution remains in the actual | |
| 6 | -all-order spatial Sobolev class. Its fields are the parent fields plus | |
| 7 | -the very same exact packet used in the particle-map construction. -/ | |
| 8 | - | |
| 9 | -noncomputable section | |
| 10 | - | |
| 11 | -namespace EulerParentPacketFrames.SobolevData | |
| 12 | - | |
| 13 | -open Set EulerSmoothLimit EulerTransverseFrameCoordinates | |
| 14 | - EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 15 | - EulerGraphInvariantFlow EulerLpTranslation EulerLpTranslation.SmoothL2Field | |
| 16 | - | |
| 17 | -variable {A : Parent} {E : Evolution A} (F : SobolevData E) (L : LabelData A) | |
| 18 | - {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 19 | - (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 20 | - (support : Set Space) (hSupport : IsCompact support) | |
| 21 | - {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 22 | - {Z R : FieldTower P A.T} | |
| 23 | - (B : Budget P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 24 | - (residual : ApproximationResidual P A.T_pos | |
| 25 | - (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 26 | - {raw : EulerPacketProfileRecursion.VectorField} | |
| 27 | - (V : EulerPacketCylinderField.Field P A.T raw) (hV : Z=V.toFieldTower) | |
| 28 | - (G : EulerPhysicalGraphFlowBounds.Data P A.T) (hG : G.A=B.liftedPacketCoefficient P V) | |
| 29 | - (k : ℝ) (hk : k*κ=1) (hgraph : ∀ t q, graphConstraint k m (G.A.field t q)=0) | |
| 30 | - (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 31 | - | |
| 32 | -def child : SobolevData | |
| 33 | - (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1) where | |
| 34 | - velocity t := addField (F.velocity t) | |
| 35 | - (L.packetVelocityField E.inverse m hm J support hSupport P κ | |
| 36 | - (exactPacketOfResidual P B residual).velocity k t) | |
| 37 | - force t := addField (F.force t) | |
| 38 | - (L.packetForceField E.inverse m hm J support hSupport P κ | |
| 39 | - (exactPacketOfResidual P B residual).pressure k t) | |
| 40 | - velocity_match t x := by | |
| 41 | - erw [Evolution.child_velocity,A.exactPacketVelocity_eq_corrected] | |
| 42 | - erw [addField_field,L.packetVelocityField_apply] | |
| 43 | - change E.velocity (t,x)+_=(F.velocity t).field x+_ | |
| 44 | - erw [F.velocity_match] | |
| 45 | - rfl | |
| 46 | - force_match t x := by | |
| 47 | - erw [Evolution.child_force] | |
| 48 | - erw [Parent.exactPacketForce,addField_field,F.force_match,L.packetForceField_apply] | |
| 49 | - simp only [ExactLiftedPacket.graphPressure,map_smul] | |
| 50 | - rfl | |
| 51 | - velocity_continuous := continuous_jetLp_addField _ _ F.velocity_continuous | |
| 52 | - (L.packetVelocityField_continuous E.inverse m hm J support hSupport P κ | |
| 53 | - (exactPacketOfResidual P B residual).velocity k) | |
| 54 | - force_continuous := continuous_jetLp_addField _ _ F.force_continuous | |
| 55 | - (L.packetForceField_continuous E.inverse m hm J support hSupport P κ | |
| 56 | - (exactPacketOfResidual P B residual).pressure k) | |
| 57 | - | |
| 58 | -end EulerParentPacketFrames.SobolevData | |
+45 −1 Euler/ParentEulerState.lean View file
| @@ -1,10 +1,54 @@ | ||
| 1 | -import Euler.ParentParticleRegularity | |
| 1 | +import Euler.ParentParticleInverse | |
| 2 | +import Euler.ContinuousInverseDerivative | |
| 3 | +import Euler.GevreyInverseMap | |
| 2 | 4 | import Euler.ParentLagrangianEuler |
| 3 | 5 | |
| 4 | 6 | /-! The physical Euler evolution carried by a particle parent. Its |
| 5 | 7 | acceleration law and the smoothness of its closed spatial slices are |
| 6 | 8 | consequences of the actual flow identities, rather than extra premises. -/ |
| 7 | 9 | |
| 10 | +/-! ## From `Euler/ParentParticleRegularity.lean` | |
| 11 | + | |
| 12 | +The text of `Euler/ParentParticleRegularity.lean`, folded into this file, which was its only importer. -/ | |
| 13 | + | |
| 14 | +section | |
| 15 | + | |
| 16 | +/-! Spatial smoothness of the actual physical particle inverse follows | |
| 17 | +from its inverse identities and the genuine determinant-one Jacobian. -/ | |
| 18 | + | |
| 19 | +noncomputable section | |
| 20 | + | |
| 21 | +namespace EulerParentPacketFrames.ParticleInverse | |
| 22 | + | |
| 23 | +open Set EulerSmoothLimit EulerContinuousInverseDerivative EulerGevreyComposition | |
| 24 | +open scoped ContDiff | |
| 25 | + | |
| 26 | +variable {A : Parent} (I : ParticleInverse A) | |
| 27 | + | |
| 28 | +theorem hasFDerivAt (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 29 | + HasFDerivAt (I.field t) | |
| 30 | + (A.inverse.field t (A.ell⁻¹ • I.field t x)) x := by | |
| 31 | + apply hasFDerivAt_inverse (A.position t) (I.field t) x | |
| 32 | + (A.frame.field t (A.ell⁻¹ • I.field t x)) | |
| 33 | + (A.inverse.field t (A.ell⁻¹ • I.field t x)) | |
| 34 | + (I.continuous.uncurry_left t).continuousAt | |
| 35 | + · simpa only [smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul] using | |
| 36 | + A.position_frame t (A.ell⁻¹ • I.field t x) | |
| 37 | + · exact Filter.Eventually.of_forall (I.right_inverse t) | |
| 38 | + · exact A.inverse_left t (A.ell⁻¹ • I.field t x) | |
| 39 | + | |
| 40 | +theorem smooth (t : Icc (0 : ℝ) A.T) : ContDiff ℝ ∞ (I.field t) := by | |
| 41 | + apply contDiff_of_fderiv_eq_comp (I.field t) | |
| 42 | + (fun y => A.inverse.field t (A.ell⁻¹ • y)) | |
| 43 | + (fun x => (I.hasFDerivAt t x).differentiableAt) | |
| 44 | + · exact (A.inverse.smooth t).comp (contDiff_id.const_smul A.ell⁻¹) | |
| 45 | + · exact fun x => (I.hasFDerivAt t x).fderiv | |
| 46 | + | |
| 47 | +end EulerParentPacketFrames.ParticleInverse | |
| 48 | +end | |
| 49 | + | |
| 50 | +end | |
| 51 | + | |
| 8 | 52 | noncomputable section |
| 9 | 53 | |
| 10 | 54 | namespace EulerParentPacketFrames |
+241 −1 Euler/ParentGeometryChoiceLow.lean View file
| @@ -1,10 +1,250 @@ | ||
| 1 | 1 | import Euler.ParentGeometryForwardChoice |
| 2 | 2 | import Euler.ParentGeometryJoinedChoice |
| 3 | -import Euler.ParentPacketChildLowGuards | |
| 3 | +import Euler.PacketForwardChildLowBounds | |
| 4 | +import Euler.ParentEulerLowBounds | |
| 5 | +import Euler.ParentEulerChild | |
| 4 | 6 | |
| 5 | 7 | /-! The same geometrically selected correction supplies the actual |
| 6 | 8 | child's whole-horizon physical bounds and its next localized source guard. -/ |
| 7 | 9 | |
| 10 | +/-! ## From `Euler/ParentPacketInitialLowBounds.lean` | |
| 11 | + | |
| 12 | +The text of `Euler/ParentPacketInitialLowBounds.lean`, folded into this file, which was its only importer. -/ | |
| 13 | + | |
| 14 | +section | |
| 15 | + | |
| 16 | +/-! The actual initialized packet changes the initial velocity gradient | |
| 17 | +by the exponentially small early/history size plus its correction error. | |
| 18 | +These are the costs needed to preserve the localized source guards. -/ | |
| 19 | + | |
| 20 | +noncomputable section | |
| 21 | + | |
| 22 | +namespace EulerPacketPhysicalLowBounds | |
| 23 | + | |
| 24 | +open EulerSmoothLimit EulerPeriodicProfile | |
| 25 | + | |
| 26 | +theorem norm_le_of_shear_error (V : Matrix) (amp δ θ ev size : ℝ) (r w : Space) | |
| 27 | + (hamp : 0 ≤ amp) (hδ : 0 < δ) (hδ1 : δ ≤ 1) | |
| 28 | + (hsize : amp*(‖r‖*‖w‖) ≤ δ*size) | |
| 29 | + (herr : ‖V-shearTerm amp (deriv (profile δ) θ) r w‖ ≤ ev) : ‖V‖ ≤ size+ev := by | |
| 30 | + have hshear : ‖shearTerm amp (deriv (profile δ) θ) r w‖ ≤ size := | |
| 31 | + (shearTerm_norm_le amp _ δ r w hamp (profile_deriv_abs δ hδ hδ1 θ)).trans | |
| 32 | + ((div_le_iff₀ hδ).2 (by linarith only [hsize])) | |
| 33 | + have h := norm_of_remainder V 0 (shearTerm amp (deriv (profile δ) θ) r w) ev | |
| 34 | + (by simpa only [sub_zero] using herr) | |
| 35 | + simp only [norm_zero,zero_add] at h | |
| 36 | + exact h.trans (add_le_add hshear le_rfl) | |
| 37 | + | |
| 38 | +end EulerPacketPhysicalLowBounds | |
| 39 | + | |
| 40 | +namespace EulerParentPacketFrames.Evolution | |
| 41 | + | |
| 42 | +open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit | |
| 43 | + EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 44 | + EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 45 | + EulerPacketSourceGeometry EulerPacketMovingFrame EulerPacketGeometryLowBounds | |
| 46 | + EulerPacketPhysicalLowBounds EulerPacketPrimaryFactorization EulerPeriodicProfile | |
| 47 | + EulerSpatialCutoffs EulerPacketTerminalDatum | |
| 48 | +open scoped ContDiff | |
| 49 | + | |
| 50 | +variable {A : Parent} (E : Evolution A) | |
| 51 | + | |
| 52 | +variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 53 | + (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 54 | + (support : Set Space) (hSupport : IsCompact support) | |
| 55 | + {κ : ℝ} {hκ : |κ| ≤ 1} {Z R : FieldTower period A.T} | |
| 56 | + (B : Budget period A.T_pos (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 57 | + (residual : ApproximationResidual period A.T_pos | |
| 58 | + (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 59 | + (k : ℝ) (hk : k*κ=1) | |
| 60 | + | |
| 61 | +section Joined | |
| 62 | + | |
| 63 | +variable {τ : ℝ} {hτ : 0 < τ} {hτT : τ < A.T} | |
| 64 | + {F : ParentFrame (A.transverseData m hm J support hSupport) τ} | |
| 65 | + {H : HistoryData ((A.transverseData m hm J support hSupport).initial τ hτ hτT.le)} | |
| 66 | + (G : Guards hτ hτT F H) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 67 | + (hs : tsupport innerCutoff ⊆ support) (hδ : 0 < G.δ) (hδ1 : G.δ ≤ 1) | |
| 68 | + | |
| 69 | +include hk hδ hδ1 in | |
| 70 | +theorem exactPacket_bad_gradient_increment | |
| 71 | + (ev ep : ℝ) (herr : E.SourceErrors m hm J support hSupport B residual k G hball hs ev ep) | |
| 72 | + (t : Icc (0 : ℝ) A.T) (ht : scaledTime τ F.a F.epsilon t ≤ 1) (x : Space) : | |
| 73 | + ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (t,y)) x- | |
| 74 | + fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ G.hchild*G.badRatio+ev := by | |
| 75 | + rw [(E.exactPacket_derivative_split m hm J support hSupport B residual k hk t x).1,add_sub_cancel_left] | |
| 76 | + apply norm_le_of_shear_error _ (G.primaryAmplitude hball) G.δ | |
| 77 | + (k*⟪m,E.inverse.normalized t (A.ell⁻¹ • x)⟫_ℝ) ev (G.hchild*G.badRatio) | |
| 78 | + ((A.transverseData m hm J support hSupport).normal.field t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 79 | + (canonicalVelocity τ hτ hτT H G.terminal hs t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 80 | + (G.primaryAmplitude_nonneg hball) hδ hδ1 | |
| 81 | + · simpa only [mul_assoc] using G.bad_primary_size hball t ht (E.inverse.normalized t (A.ell⁻¹ • x)) hs | |
| 82 | + · exact (herr t (A.ell⁻¹ • x)).1 | |
| 83 | + | |
| 84 | +include hk hδ hδ1 in | |
| 85 | +theorem exactPacket_initial_gradient_increment | |
| 86 | + (ev ep : ℝ) (herr : E.SourceErrors m hm J support hSupport B residual k G hball hs ev ep) | |
| 87 | + (x : Space) : | |
| 88 | + ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (0,y)) x- | |
| 89 | + fderiv ℝ (fun y => E.velocity (0,y)) x‖ ≤ G.hchild*G.badRatio+ev := by | |
| 90 | + apply E.exactPacket_bad_gradient_increment m hm J support hSupport B residual k hk G hball hs hδ hδ1 ev ep herr A.zeroTime _ x | |
| 91 | + change (F.a/F.epsilon)*(0-τ) ≤ 1 | |
| 92 | + have h : (F.a/F.epsilon)*(0-τ) ≤ 0 := | |
| 93 | + mul_nonpos_of_nonneg_of_nonpos (div_nonneg G.a_pos.le G.epsilon_pos.le) (by linarith only [hτ]) | |
| 94 | + linarith only [h] | |
| 95 | + | |
| 96 | +end Joined | |
| 97 | + | |
| 98 | +section Forward | |
| 99 | + | |
| 100 | +variable {F : ParentFrame (A.transverseData m hm J support hSupport) 0} | |
| 101 | + (G : ForwardGuards F) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 102 | + (hδ : 0 < G.δ) (hδ1 : G.δ ≤ 1) | |
| 103 | + | |
| 104 | +include hk hδ hδ1 in | |
| 105 | +theorem exactForwardPacket_early_gradient_increment | |
| 106 | + (ev ep : ℝ) (herr : E.ForwardSourceErrors m hm J support hSupport B residual k G hball ev ep) | |
| 107 | + (t : Icc (0 : ℝ) A.T) (ht : scaledTime 0 F.a F.epsilon t ≤ 1) (x : Space) : | |
| 108 | + ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (t,y)) x- | |
| 109 | + fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ G.hchild*G.earlyRatio+ev := by | |
| 110 | + rw [(E.exactPacket_derivative_split m hm J support hSupport B residual k hk t x).1,add_sub_cancel_left] | |
| 111 | + apply norm_le_of_shear_error _ (G.primaryAmplitude hball) G.δ | |
| 112 | + (k*⟪m,E.inverse.normalized t (A.ell⁻¹ • x)⟫_ℝ) ev (G.hchild*G.earlyRatio) | |
| 113 | + ((A.transverseData m hm J support hSupport).normal.field t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 114 | + (EulerPacketForwardFactorization.canonicalVelocity (A.transverseData m hm J support hSupport) G.initialCoordinate t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 115 | + (G.primaryAmplitude_nonneg hball) hδ hδ1 | |
| 116 | + · simpa only [mul_assoc] using G.early_primary_size hball t ht (E.inverse.normalized t (A.ell⁻¹ • x)) | |
| 117 | + · exact (herr t (A.ell⁻¹ • x)).1 | |
| 118 | + | |
| 119 | +include hk hδ hδ1 in | |
| 120 | +theorem exactForwardPacket_initial_gradient_increment | |
| 121 | + (ev ep : ℝ) (herr : E.ForwardSourceErrors m hm J support hSupport B residual k G hball ev ep) | |
| 122 | + (x : Space) : | |
| 123 | + ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (0,y)) x- | |
| 124 | + fderiv ℝ (fun y => E.velocity (0,y)) x‖ ≤ G.hchild*G.earlyRatio+ev := by | |
| 125 | + apply E.exactForwardPacket_early_gradient_increment m hm J support hSupport B residual k hk G hball hδ hδ1 ev ep herr A.zeroTime _ x | |
| 126 | + change (F.a/F.epsilon)*(0-0) ≤ 1 | |
| 127 | + norm_num | |
| 128 | + | |
| 129 | +end Forward | |
| 130 | + | |
| 131 | +end EulerParentPacketFrames.Evolution | |
| 132 | +end | |
| 133 | + | |
| 134 | +end | |
| 135 | + | |
| 136 | +/-! ## From `Euler/ParentPacketChildLowGuards.lean` | |
| 137 | + | |
| 138 | +The text of `Euler/ParentPacketChildLowGuards.lean`, folded into this file, which was its only importer. -/ | |
| 139 | + | |
| 140 | +section | |
| 141 | + | |
| 142 | +/-! The next packet's localized lower initial-gradient bounds and upper | |
| 143 | +pressure bound are consequences of the exact physical estimates. The | |
| 144 | +radius stays fixed, and the boundary parameter has a canonical value. -/ | |
| 145 | + | |
| 146 | +noncomputable section | |
| 147 | + | |
| 148 | +namespace EulerParentPacketFrames.Evolution | |
| 149 | + | |
| 150 | +open Set InnerProductSpace EulerSmoothLimit EulerMeanHarmonic | |
| 151 | + EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 152 | + EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 153 | + EulerGraphInvariantFlow EulerPacketTerminalDatum EulerSpatialCutoffs | |
| 154 | + EulerPacketSourceGeometry EulerPacketGeometryLowBounds | |
| 155 | + | |
| 156 | +variable {A : Parent} (E : Evolution A) | |
| 157 | + {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 158 | + (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 159 | + (support : Set Space) (hSupport : IsCompact support) | |
| 160 | + {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 161 | + {Z R : FieldTower period A.T} | |
| 162 | + (B : Budget period A.T_pos (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 163 | + (residual : ApproximationResidual period A.T_pos | |
| 164 | + (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 165 | + {raw : EulerPacketProfileRecursion.VectorField} | |
| 166 | + (V : EulerPacketCylinderField.Field period A.T raw) (hV : Z=V.toFieldTower) | |
| 167 | + (G : EulerPhysicalGraphFlowBounds.Data period A.T) (hG : G.A=B.liftedPacketCoefficient period V) | |
| 168 | + (k : ℝ) (hk : k*κ=1) (hgraph : ∀ t q, graphConstraint k m (G.A.field t q)=0) | |
| 169 | + (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 170 | + | |
| 171 | +section Joined | |
| 172 | + | |
| 173 | +variable {τ : ℝ} {hτ : 0 < τ} {hτT : τ < A.T} | |
| 174 | + {F : ParentFrame (A.transverseData m hm J support hSupport) τ} | |
| 175 | + {D : HistoryData ((A.transverseData m hm J support hSupport).initial τ hτ hτT.le)} | |
| 176 | + (C : Guards hτ hτT F D) (hball : (1/2 : ℝ) ≤ C.radius) | |
| 177 | + (hs : tsupport EulerSpatialCutoffs.innerCutoff ⊆ support) (hδ : 0 < C.δ) (hδ1 : C.δ ≤ 1) | |
| 178 | + | |
| 179 | +def joinedChildLowBounds (H : LowBounds A) (ev ep CM CH : ℝ) | |
| 180 | + (herr : E.SourceErrors m hm J support hSupport B residual k C hball hs ev ep) | |
| 181 | + (hCM : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ CM) | |
| 182 | + (hCH : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (E.force t) x‖ ≤ CH) | |
| 183 | + (hsmall : (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.badRatio)+ep)*(A.T^2/2)+ | |
| 184 | + (H.Be+(C.hchild*C.badRatio+ev))*A.T+ | |
| 185 | + boundaryLocalizationC2*(H.Bc+(C.hchild*C.badRatio+ev))*H.r^3*A.T ≤ 1/2) : | |
| 186 | + LowBounds (A.child G k m hgraph nextEll hnext hnext1) := by | |
| 187 | + have hev : 0 ≤ ev := (norm_nonneg _).trans (herr A.zeroTime 0).1 | |
| 188 | + have hep : 0 ≤ ep := (norm_nonneg _).trans (herr A.zeroTime 0).2 | |
| 189 | + have hCM0 : 0 ≤ CM := (norm_nonneg _).trans (hCM A.zeroTime 0) | |
| 190 | + apply E.updateLowBounds | |
| 191 | + (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1) | |
| 192 | + H (C.hchild*C.badRatio+ev) (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.badRatio)+ep) | |
| 193 | + · exact add_nonneg (mul_nonneg C.child_nonneg C.badRatio_nonneg) hev | |
| 194 | + · positivity [H.K_nonneg,C.child_nonneg,C.delta_nonneg,goodRatio_pos,C.badRatio_nonneg] | |
| 195 | + · intro x | |
| 196 | + exact E.exactPacket_initial_gradient_increment m hm J support hSupport B residual k hk | |
| 197 | + C hball hs hδ hδ1 ev ep herr x | |
| 198 | + · intro t x z | |
| 199 | + let EC := E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1 | |
| 200 | + rw [← EC.pressure_hessian_eq_force] | |
| 201 | + exact (E.exactPacket_whole_horizon_low_bounds m hm J support hSupport B residual k hk | |
| 202 | + C hball hs hδ hδ1 ev ep CM CH H.K herr hCM hCH | |
| 203 | + (E.force_quadratic_upper_of_lowBounds H) t x).2.2 z | |
| 204 | + · exact hsmall | |
| 205 | + | |
| 206 | +end Joined | |
| 207 | + | |
| 208 | +section Forward | |
| 209 | + | |
| 210 | +variable {F : ParentFrame (A.transverseData m hm J support hSupport) 0} | |
| 211 | + (C : ForwardGuards F) (hball : (1/2 : ℝ) ≤ C.radius) | |
| 212 | + (hδ : 0 < C.δ) (hδ1 : C.δ ≤ 1) | |
| 213 | + | |
| 214 | +def forwardChildLowBounds (H : LowBounds A) (ev ep CM CH : ℝ) | |
| 215 | + (herr : E.ForwardSourceErrors m hm J support hSupport B residual k C hball ev ep) | |
| 216 | + (hCM : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ CM) | |
| 217 | + (hCH : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (E.force t) x‖ ≤ CH) | |
| 218 | + (hsmall : (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.earlyRatio)+ep)*(A.T^2/2)+ | |
| 219 | + (H.Be+(C.hchild*C.earlyRatio+ev))*A.T+ | |
| 220 | + boundaryLocalizationC2*(H.Bc+(C.hchild*C.earlyRatio+ev))*H.r^3*A.T ≤ 1/2) : | |
| 221 | + LowBounds (A.child G k m hgraph nextEll hnext hnext1) := by | |
| 222 | + have hev : 0 ≤ ev := (norm_nonneg _).trans (herr A.zeroTime 0).1 | |
| 223 | + have hep : 0 ≤ ep := (norm_nonneg _).trans (herr A.zeroTime 0).2 | |
| 224 | + have hCM0 : 0 ≤ CM := (norm_nonneg _).trans (hCM A.zeroTime 0) | |
| 225 | + apply E.updateLowBounds | |
| 226 | + (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1) | |
| 227 | + H (C.hchild*C.earlyRatio+ev) (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.earlyRatio)+ep) | |
| 228 | + · exact add_nonneg (mul_nonneg C.child_nonneg C.earlyRatio_nonneg) hev | |
| 229 | + · positivity [H.K_nonneg,C.child_nonneg,C.delta_nonneg,goodRatio_pos,C.earlyRatio_nonneg] | |
| 230 | + · intro x | |
| 231 | + exact E.exactForwardPacket_initial_gradient_increment m hm J support hSupport B residual k hk | |
| 232 | + C hball hδ hδ1 ev ep herr x | |
| 233 | + · intro t x z | |
| 234 | + let EC := E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1 | |
| 235 | + rw [← EC.pressure_hessian_eq_force] | |
| 236 | + exact (E.exactForwardPacket_whole_horizon_low_bounds m hm J support hSupport B residual k hk | |
| 237 | + C hball hδ hδ1 ev ep CM CH H.K herr hCM hCH | |
| 238 | + (E.force_quadratic_upper_of_lowBounds H) t x).2.2 z | |
| 239 | + · exact hsmall | |
| 240 | + | |
| 241 | +end Forward | |
| 242 | + | |
| 243 | +end EulerParentPacketFrames.Evolution | |
| 244 | +end | |
| 245 | + | |
| 246 | +end | |
| 247 | + | |
| 8 | 248 | noncomputable section |
| 9 | 249 | |
| 10 | 250 | namespace EulerParentPacketFrames.GeometryForwardChoice |
+139 −1 Euler/ParentGeometryChoiceRenewal.lean View file
| @@ -1,9 +1,147 @@ | ||
| 1 | 1 | import Euler.ParentGeometryChoiceCenter |
| 2 | -import Euler.ParentTargetRenewal | |
| 2 | +import Euler.ParentRenewalParameters | |
| 3 | +import Euler.PacketForwardGeometryLowBounds | |
| 3 | 4 | |
| 4 | 5 | /-! Actual frame renewal for the very correction and flow chosen by |
| 5 | 6 | the geometric packet factories. Center source matching is derived. -/ |
| 6 | 7 | |
| 8 | +/-! ## From `Euler/ParentTargetRenewal.lean` | |
| 9 | + | |
| 10 | +The text of `Euler/ParentTargetRenewal.lean`, folded into this file, which was its only importer. -/ | |
| 11 | + | |
| 12 | +section | |
| 13 | + | |
| 14 | +/-! The geometric target of the actual forward or joined primary is the | |
| 15 | +activation time of the next parent frame. These factories are the checked | |
| 16 | +`SmoothState` renewals with the source-selected amplitude and primary; | |
| 17 | +all target matching is proved from their definitions. -/ | |
| 18 | + | |
| 19 | +noncomputable section | |
| 20 | + | |
| 21 | +namespace EulerParentPacketFrames.SmoothState | |
| 22 | + | |
| 23 | +open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit | |
| 24 | + EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 25 | + EulerPacketSourceGeometry EulerSpatialCutoffs EulerPeriodicProfile | |
| 26 | + EulerPacketMovingFrame EulerPacketNormalizedPrimary | |
| 27 | + | |
| 28 | +variable {A N : Parent} (S : SmoothState A) (T : SmoothState N) (hTime : N.T=A.T) | |
| 29 | + {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 30 | + (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 31 | + (support : Set Space) (hSupport : IsCompact support) | |
| 32 | + {V : Type} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 33 | + (mNext : Space) (hmNext : ‖mNext‖=1) (JNext : V ≃ₗᵢ[ℝ] referencePlane mNext) | |
| 34 | + (supportNext : Set Space) (hSupportNext : IsCompact supportNext) | |
| 35 | + | |
| 36 | +local notation "D" => A.transverseData m hm J support hSupport | |
| 37 | +local notation "DNext" => N.transverseData mNext hmNext JNext supportNext hSupportNext | |
| 38 | + | |
| 39 | +section Forward | |
| 40 | + | |
| 41 | +variable {P : ParentFrame (A.transverseData m hm J support hSupport) 0} (G : ForwardGuards P) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 42 | + | |
| 43 | +local notation "Geo" => ForwardGuards.lowGeometry G hball | |
| 44 | +local notation "tNext" => PhysicalGeometryData.targetTime (ForwardGuards.lowGeometry G hball) | |
| 45 | + | |
| 46 | +variable (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 47 | + (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 48 | + (hM : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerStrain t‖ ≤ CM) | |
| 49 | + (hH : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerCurvature t‖ ≤ CH) | |
| 50 | + (hδ : 0 < G.δ) (k : ℝ) | |
| 51 | + (hsource : ∀ t : Icc (0 : ℝ) A.T, (G.lowGeometry hball).targetTime ≤ (t : ℝ) → | |
| 52 | + ‖fderiv ℝ (S.velocityIncrement T t) 0- | |
| 53 | + (G.primaryAmplitude hball*deriv (profile G.δ) | |
| 54 | + (k*⟪m,S.evolution.inverse.normalized t 0⟫_ℝ)) • | |
| 55 | + rankOne ℝ (EulerPacketForwardFactorization.canonicalVelocity | |
| 56 | + (A.transverseData m hm J support hSupport) G.initialCoordinate t (S.evolution.inverse.normalized t 0)) | |
| 57 | + ((A.transverseData m hm J support hSupport).normal.field t (S.evolution.inverse.normalized t 0))‖ ≤ error) | |
| 58 | + | |
| 59 | +/-- The next actual frame, using exactly the forward source primary and | |
| 60 | +its target-normalized amplitude. -/ | |
| 61 | +def forwardTargetRenewal : ParentFrame DNext tNext := | |
| 62 | + S.forwardRenewal T hTime m hm J support hSupport | |
| 63 | + mNext hmNext JNext supportNext hSupportNext | |
| 64 | + tNext ((G.lowGeometry hball).target_time_mem).1 CM CH K error | |
| 65 | + hCM hK he hMK hHK hM hH G.δ hδ (G.primaryAmplitude hball) k | |
| 66 | + G.initialCoordinate G.initialCoordinate_ne_zero hsource | |
| 67 | + | |
| 68 | +local notation "Q" => forwardTargetRenewal S T hTime m hm J support hSupport | |
| 69 | + mNext hmNext JNext supportNext hSupportNext G hball CM CH K error | |
| 70 | + hCM hK he hMK hHK hM hH hδ k hsource | |
| 71 | + | |
| 72 | +/-- In particular, the new ray and primary are the old source's actual | |
| 73 | +physical ray and primary at the target, not freely chosen frame vectors. -/ | |
| 74 | +theorem forwardTargetRenewal_matches : RenewalAtTarget Geo Q := by | |
| 75 | + let t : Icc (0 : ℝ) A.T := ⟨tNext,(G.lowGeometry hball).target_time_mem⟩ | |
| 76 | + constructor | |
| 77 | + · change A.centerStrain t = (D).M.field ((D).clamp (t : ℝ)) 0 | |
| 78 | + rw [Data.clamp_coe D t] | |
| 79 | + exact (A.source_strain_eq m hm J support hSupport t).symm | |
| 80 | + · change A.sourceNormal m t = (D).normal.field ((D).clamp (t : ℝ)) 0 | |
| 81 | + rw [Data.clamp_coe D t] | |
| 82 | + exact (A.source_normal_eq m hm J support hSupport t).symm | |
| 83 | + · rfl | |
| 84 | + · rfl | |
| 85 | + | |
| 86 | +end Forward | |
| 87 | + | |
| 88 | +section Joined | |
| 89 | + | |
| 90 | +variable (s : ℝ) (hs : 0 < s) (hsT : s < A.T) | |
| 91 | + (H : HistoryData ((A.transverseData m hm J support hSupport).initial s hs hsT.le)) | |
| 92 | + {P : ParentFrame (A.transverseData m hm J support hSupport) s} | |
| 93 | + (G : Guards hs hsT P H) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 94 | + (hcut : tsupport innerCutoff ⊆ support) | |
| 95 | + | |
| 96 | +local notation "Geo" => Guards.lowGeometry G hball | |
| 97 | +local notation "tNext" => PhysicalGeometryData.targetTime (Guards.lowGeometry G hball) | |
| 98 | + | |
| 99 | +variable (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 100 | + (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 101 | + (hM : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerStrain t‖ ≤ CM) | |
| 102 | + (hH : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerCurvature t‖ ≤ CH) | |
| 103 | + (hδ : 0 < G.δ) (k : ℝ) | |
| 104 | + (hsource : ∀ t : Icc (0 : ℝ) A.T, (G.lowGeometry hball).targetTime ≤ (t : ℝ) → | |
| 105 | + ‖fderiv ℝ (S.velocityIncrement T t) 0- | |
| 106 | + (G.primaryAmplitude hball*deriv (profile G.δ) | |
| 107 | + (k*⟪m,S.evolution.inverse.normalized t 0⟫_ℝ)) • | |
| 108 | + rankOne ℝ (EulerPacketPrimaryFactorization.canonicalVelocity | |
| 109 | + s hs hsT H G.terminal hcut t (S.evolution.inverse.normalized t 0)) | |
| 110 | + ((A.transverseData m hm J support hSupport).normal.field t (S.evolution.inverse.normalized t 0))‖ ≤ error) | |
| 111 | + | |
| 112 | +/-- The joined renewal retains the activation-selected endpoint and | |
| 113 | +its actual stationary-history initial trace. -/ | |
| 114 | +def joinedTargetRenewal : ParentFrame DNext tNext := | |
| 115 | + S.joinedRenewal T hTime m hm J support hSupport | |
| 116 | + mNext hmNext JNext supportNext hSupportNext | |
| 117 | + tNext (hs.le.trans ((G.lowGeometry hball).target_time_mem).1) CM CH K error | |
| 118 | + hCM hK he hMK hHK hM hH G.δ hδ (G.primaryAmplitude hball) k | |
| 119 | + s hs hsT H G.terminal G.terminal_properties.1 hcut hsource | |
| 120 | + | |
| 121 | +local notation "Q" => joinedTargetRenewal S T hTime m hm J support hSupport | |
| 122 | + mNext hmNext JNext supportNext hSupportNext s hs hsT H G hball hcut CM CH K error | |
| 123 | + hCM hK he hMK hHK hM hH hδ k hsource | |
| 124 | + | |
| 125 | +theorem joinedTargetRenewal_matches : RenewalAtTarget Geo Q := by | |
| 126 | + let t : Icc (0 : ℝ) A.T := | |
| 127 | + ⟨tNext,hs.le.trans ((G.lowGeometry hball).target_time_mem).1, | |
| 128 | + ((G.lowGeometry hball).target_time_mem).2⟩ | |
| 129 | + constructor | |
| 130 | + · change A.centerStrain t = (D).M.field ((D).clamp (t : ℝ)) 0 | |
| 131 | + rw [Data.clamp_coe D t] | |
| 132 | + exact (A.source_strain_eq m hm J support hSupport t).symm | |
| 133 | + · change A.sourceNormal m t = (D).normal.field ((D).clamp (t : ℝ)) 0 | |
| 134 | + rw [Data.clamp_coe D t] | |
| 135 | + exact (A.source_normal_eq m hm J support hSupport t).symm | |
| 136 | + · rfl | |
| 137 | + · rfl | |
| 138 | + | |
| 139 | +end Joined | |
| 140 | +end EulerParentPacketFrames.SmoothState | |
| 141 | +end | |
| 142 | + | |
| 143 | +end | |
| 144 | + | |
| 7 | 145 | noncomputable section |
| 8 | 146 | |
| 9 | 147 | namespace EulerParentPacketFrames.Evolution |
+97 −1 Euler/ParentGeometryJoinedChoice.lean View file
| @@ -1,4 +1,6 @@ | ||
| 1 | -import Euler.ParentUniformJoinedChild | |
| 1 | +import Euler.ParentPacketChildChoice | |
| 2 | +import Euler.PacketInitializedUniformChild | |
| 3 | +import Euler.PacketUniversalFrequency | |
| 2 | 4 | import Euler.ParentInitializedState |
| 3 | 5 | import Euler.PacketChildLowBounds |
| 4 | 6 | import Euler.PacketInitialExactLimit |
| @@ -6,6 +8,100 @@ import Euler.PacketInitialExactLimit | ||
| 6 | 8 | /-! Actual activation geometry and one uniform frequency comparison |
| 7 | 9 | construct the joined packet, its physical state, and both source errors. -/ |
| 8 | 10 | |
| 11 | +/-! ## From `Euler/ParentUniformJoinedChild.lean` | |
| 12 | + | |
| 13 | +The text of `Euler/ParentUniformJoinedChild.lean`, folded into this file, which was its only importer. -/ | |
| 14 | + | |
| 15 | +section | |
| 16 | + | |
| 17 | +/-! The positive-history packet at the fixed frequency constructs the | |
| 18 | +actual next parent, with the same errors and the k^80 label bound. -/ | |
| 19 | + | |
| 20 | +noncomputable section | |
| 21 | + | |
| 22 | +namespace EulerParentPacketFrames.LabelData | |
| 23 | + | |
| 24 | +open Set InnerProductSpace EulerSmoothLimit EulerSpatialCutoffs | |
| 25 | + EulerTransversePacketProvider EulerPacketCylinderField EulerPacketProfileRecursion | |
| 26 | + EulerPacketSourceFrequency EulerAllOrderDriftCorrection EulerGraphInvariantFlow | |
| 27 | + EulerPacketPrimaryFactorization EulerPeriodicProfile EulerPacketTerminalDatum | |
| 28 | + | |
| 29 | +variable {A : Parent} (L : LabelData A) (I : ParticleInverse A) (H : LowBounds A) | |
| 30 | + {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 31 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) | |
| 32 | + (S : Set Space) (hS : IsCompact S) | |
| 33 | + (τ : ℝ) (hτ : 0 < τ) (hτT : τ < A.T) | |
| 34 | + (J : JoinedInputs (A.meanData H) (A.transverseData m hm R S hS) τ hτ hτT | |
| 35 | + (A.historyOn H m hm R S hS τ hτ hτT)) | |
| 36 | + (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (ξ : U) | |
| 37 | + (hs : tsupport innerCutoff ⊆ S) (α : ℝ) (hα : 0 < α) | |
| 38 | + (W : ℝ) | |
| 39 | + (hW : EulerPacketRadiusPolynomial.RadiusPrimitives J.mean J.linear J.normal | |
| 40 | + (joinedCoefficientBudget period (A.meanData H) (A.transverseData m hm R S hS) | |
| 41 | + rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) J.normal) δ ξ W) | |
| 42 | + (hprofile : ∀ t, α*J.linear.fullProfile t ≤ W) | |
| 43 | + (k : ℝ) (hk : UniversalFrequency k) | |
| 44 | + (hfrequency : EulerPacketInitializedOutputCost.uniformConstant* | |
| 45 | + W^EulerPacketInitializedOutputCost.uniformPower ≤ smallPower k) | |
| 46 | + (hKk : L.K ≤ k) (hinv : A.ell⁻¹ ≤ k^(3/4 : ℝ)) | |
| 47 | + (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 48 | + | |
| 49 | +include hδ1 hα J hW hprofile hfrequency hKk hinv in | |
| 50 | +theorem joined_uniform_child : | |
| 51 | + ∃ (hn : 1 ≤ truncation k) | |
| 52 | + (Q : Budget period A.T_pos | |
| 53 | + (initializedCorrectionData (A.meanData H) (A.transverseData m hm R S hS) | |
| 54 | + rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α | |
| 55 | + (A.sourceAgreement m hm R S hS H) (truncation k) hn k hk.four)) | |
| 56 | + (G : EulerPhysicalGraphFlowBounds.Data period A.T) | |
| 57 | + (hgraph : ∀ t z, graphConstraint k m (G.A.field t z)=0), | |
| 58 | + G.A=Q.liftedPacketCoefficient period | |
| 59 | + (initializedNormalizedField (A.meanData H) (A.transverseData m hm R S hS) | |
| 60 | + rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α (truncation k) k) ∧ | |
| 61 | + (∀ (t : Icc (0 : ℝ) A.T) (x : Space), | |
| 62 | + ‖fderiv ℝ (initializedExactPhysicalVelocity (A.meanData H) | |
| 63 | + (A.transverseData m hm R S hS) rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 64 | + δ hδ ξ hs α (A.sourceAgreement m hm R S hS H) | |
| 65 | + (truncation k) hn k hk.four Q t (I.normalized t)) x- | |
| 66 | + (α*deriv (profile δ) (k*⟪m,I.normalized t x⟫_ℝ)) • | |
| 67 | + rankOne ℝ (canonicalVelocity τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 68 | + ξ hs t (I.normalized t x)) | |
| 69 | + ((A.transverseData m hm R S hS).normal.field t (I.normalized t x))‖ ≤ k^(-(1/4 : ℝ)) ∧ | |
| 70 | + ‖fderiv ℝ (gradient (initializedExactPhysicalPressure (A.meanData H) | |
| 71 | + (A.transverseData m hm R S hS) rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 72 | + δ hδ ξ hs α (A.sourceAgreement m hm R S hS H) | |
| 73 | + (truncation k) hn k hk.four Q t (I.normalized t))) x- | |
| 74 | + (EulerPacketPrimaryPressure.coefficient τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 75 | + ξ hs α t (I.normalized t x)*deriv (profile δ) (k*⟪m,I.normalized t x⟫_ℝ)) • | |
| 76 | + rankOne ℝ ((A.transverseData m hm R S hS).normal.field t (I.normalized t x)) | |
| 77 | + ((A.transverseData m hm R S hS).normal.field t (I.normalized t x))‖ ≤ k^(-(1/4 : ℝ))) ∧ | |
| 78 | + (∀ (t : Icc (0 : ℝ) A.T) (x : Space), | |
| 79 | + ‖(G.displacementField k m A.ell A.ell_pos t).field x‖ ≤ k^(-(1/4 : ℝ))) ∧ | |
| 80 | + ∃ LC : LabelData (A.child G k m hgraph nextEll hnext hnext1), LC.K=k^80 := by | |
| 81 | + obtain ⟨hn,Q,G,E,_,_,hG,_,hgraph,_,herror,hmatch,hlabel,hdisplacement⟩ := | |
| 82 | + initialized_uniform_child_label_bounds (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 83 | + τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 84 | + δ hδ hδ1 ξ hs α hα J.linear J.normal (JoinedInputs.mean (U := U) J) | |
| 85 | + (A.sourceAgreement m hm R S hS H) W hW hprofile k hk.four hk.expansion_bound hk.log_bound | |
| 86 | + hfrequency hk.delta_bound hk.root_bound hk.trace_bound | |
| 87 | + (fun t x => A.packetPosition (t,x)) I.normalized | |
| 88 | + A.packetPosition_contDiff (fun t x => (A.packetPosition_spatial t x).fderiv) | |
| 89 | + I.normalized_right I.normalized_continuous A.frame_det | |
| 90 | + A.ell A.ell_pos A.ell_le_one L.displacement L.velocity L.acceleration L.K L.K_one | |
| 91 | + L.displacement_bound L.velocity_bound L.acceleration_bound 6 | |
| 92 | + hk.child_bound hKk hk.embedding_bound hk.derivative_bound hinv | |
| 93 | + let LC := L.child G k m hgraph nextEll hnext hnext1 E | |
| 94 | + (fun t => (hmatch t).1) (fun t => (hmatch t).2.1) (fun t => (hmatch t).2.2.1) | |
| 95 | + (fun t => (hmatch t).2.2.2.1) (fun t => (hmatch t).2.2.2.2.1) | |
| 96 | + (fun t => (hmatch t).2.2.2.2.2.1) | |
| 97 | + (k^80) (one_le_pow₀ hk.one_le) hlabel | |
| 98 | + exact ⟨hn,Q,G,hgraph,hG,herror,hdisplacement,LC,rfl⟩ | |
| 99 | + | |
| 100 | +end EulerParentPacketFrames.LabelData | |
| 101 | +end | |
| 102 | + | |
| 103 | +end | |
| 104 | + | |
| 9 | 105 | noncomputable section |
| 10 | 106 | |
| 11 | 107 | namespace EulerParentPacketFrames |
+0 −79 Euler/ParentHistoryCostPolynomial.lean deleted
| @@ -1,79 +0,0 @@ | ||
| 1 | -import Euler.TransverseHistoryParentCost | |
| 2 | -import Euler.PolynomialCostMajorant | |
| 3 | -import Euler.PacketParentLabelCoefficients | |
| 4 | - | |
| 5 | -/-! One fixed polynomial controls the complete history sensitivity | |
| 6 | -envelope for all parent label constants and reciprocal time bounds. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentHistoryCost | |
| 11 | - | |
| 12 | -open EulerPacketParentLabelBounds EulerPacketParentMeanCoercivity | |
| 13 | - EulerTransverseHistoryBounds EulerTransverseEndpointDifference EulerPolynomialCost | |
| 14 | - | |
| 15 | -def labelHistoryEnvelope (K Ti : ℝ) : ℝ := | |
| 16 | - parentDifferenceEnvelope Ti (frameAmplitude K) (gradientAmplitude K) | |
| 17 | - (27*(frameAmplitude K)^2*gradientAmplitude K) (coefficientRadius K) | |
| 18 | - | |
| 19 | -def labelHistoryPolynomial : Polynomial ℝ := | |
| 20 | - let X : Polynomial ℝ := Polynomial.X | |
| 21 | - let v := Polynomial.C embeddingCost*X^2 | |
| 22 | - let f := 1+v | |
| 23 | - let h := 27*f^2*v | |
| 24 | - let R := 1024+4*X | |
| 25 | - let ci := (3*f^2+1)^2 | |
| 26 | - let r := 1+(2*ci^2*f^2*v+ci*v)+ci*f | |
| 27 | - let d := v+f | |
| 28 | - let a := 1+h | |
| 29 | - let x := f*R | |
| 30 | - let y := v*R | |
| 31 | - let z := h*R | |
| 32 | - let s := r*(1+d^2*(2*r^2)*a)*(2*X*d) | |
| 33 | - let e := (1+3*d^2*(2*r^2)*a+2*d^4*(2*r^2)^2*a^2)*(y+x)+ | |
| 34 | - (d^3*(2*r^2)+d^5*(2*r^2)^2*a)*z | |
| 35 | - let sd := r*(2*X*e+(y+x)*s) | |
| 36 | - let g := (4*ci^2*f^2*v+2*ci*v)*x+2*ci*f*y | |
| 37 | - x*(2*(X+4*ci*f*v))*s+f*(4*g*s+(2*(X+4*ci*f*v))*sd) | |
| 38 | - | |
| 39 | -theorem labelHistoryPolynomial_eval (P : ℝ) : | |
| 40 | - labelHistoryPolynomial.eval P = | |
| 41 | - parentDifferenceEnvelope P (frameAmplitude P) (gradientAmplitude P) | |
| 42 | - (27*(frameAmplitude P)^2*gradientAmplitude P) (1024+4*P) := by | |
| 43 | - simp [labelHistoryPolynomial,parentDifferenceEnvelope,differenceEnvelope, | |
| 44 | - slopeDifferenceEnvelope,slopeEnvelope,generatorDifferenceEnvelope,endpointDifferenceCost, | |
| 45 | - gramInverseEnvelope,transportEnvelope,frameAmplitude,gradientAmplitude] | |
| 46 | - | |
| 47 | -def labelHistoryConstant : ℝ := coefficientCost labelHistoryPolynomial | |
| 48 | -def labelHistoryPower : ℕ := labelHistoryPolynomial.natDegree | |
| 49 | - | |
| 50 | -theorem labelHistoryConstant_pos : 0 < labelHistoryConstant := coefficientCost_pos _ | |
| 51 | - | |
| 52 | -theorem labelHistoryEnvelope_power (K Ti : ℝ) (hK : 0 ≤ K) (hTi : 0 ≤ Ti) : | |
| 53 | - labelHistoryEnvelope K Ti ≤ labelHistoryConstant*(1+K+Ti)^labelHistoryPower := by | |
| 54 | - let P := 1+K+Ti | |
| 55 | - have hP : 1 ≤ P := by dsimp [P]; linarith | |
| 56 | - have hP0 : 0 ≤ P := zero_le_one.trans hP | |
| 57 | - have hKP : K ≤ P := by dsimp [P]; linarith | |
| 58 | - have hTiP : Ti ≤ P := by dsimp [P]; linarith | |
| 59 | - have hE := embeddingCost_nonneg | |
| 60 | - have hF0 := frameAmplitude_nonneg K | |
| 61 | - have hV0 := gradientAmplitude_nonneg K | |
| 62 | - have hV : gradientAmplitude K ≤ gradientAmplitude P := by | |
| 63 | - unfold gradientAmplitude | |
| 64 | - gcongr | |
| 65 | - have hF : frameAmplitude K ≤ frameAmplitude P := add_le_add (le_refl (1 : ℝ)) hV | |
| 66 | - have hH : 27*(frameAmplitude K)^2*gradientAmplitude K ≤ | |
| 67 | - 27*(frameAmplitude P)^2*gradientAmplitude P := by gcongr | |
| 68 | - have hR : coefficientRadius K ≤ 1024+4*P := by | |
| 69 | - unfold coefficientRadius | |
| 70 | - apply max_le | |
| 71 | - · linarith | |
| 72 | - · linarith | |
| 73 | - have he : labelHistoryEnvelope K Ti ≤ labelHistoryPolynomial.eval P := by | |
| 74 | - rw [labelHistoryPolynomial_eval] | |
| 75 | - exact parentDifferenceEnvelope_mono hTi hF0 hV0 (by positivity) | |
| 76 | - (coefficientRadius_nonneg K) hTiP hF hV hH hR | |
| 77 | - exact he.trans ((le_abs_self _).trans (eval_bound labelHistoryPolynomial P hP)) | |
| 78 | - | |
| 79 | -end EulerParentHistoryCost | |
+0 −103 Euler/ParentHistoryFrequencyGuard.lean deleted
| @@ -1,103 +0,0 @@ | ||
| 1 | -import Euler.PacketNestedHorizons | |
| 2 | -import Euler.PacketSourceParameterScales | |
| 3 | - | |
| 4 | -/-! Reciprocal history times fit the literal previous-frequency budget. | |
| 5 | -Only the first geometric step needs coupling and tilt bounds. All later | |
| 6 | -step lengths are nonnegative independently of any future frame invariant. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentHistoryFrequency | |
| 11 | - | |
| 12 | -open Real EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence | |
| 13 | - EulerPacketSourceParameterScales EulerPacketSourceScaleActual | |
| 14 | - EulerPacketNestedHorizons EulerPacketBaseGuardScales | |
| 15 | - | |
| 16 | -theorem frequency_monotone (J : ℕ) (hJ : 2 ≤ J) (X : ℝ) (hX : 0 ≤ X) : | |
| 17 | - Monotone (frequency J X) := by | |
| 18 | - apply monotone_nat_of_le_succ | |
| 19 | - intro n | |
| 20 | - let j : ℝ := (J+n : ℕ) | |
| 21 | - have hj2 : (2 : ℝ) ≤ j := by | |
| 22 | - dsimp [j] | |
| 23 | - exact_mod_cast (show 2 ≤ J+n by omega) | |
| 24 | - have hj0 : 0 < j := by linarith only [hj2] | |
| 25 | - have hx : 0 ≤ scaleSequence J X n := | |
| 26 | - hX.trans (sequence_initial_le J (by omega) X hX n) | |
| 27 | - have hadd : ((J+(n+1) : ℕ) : ℝ)=j+1 := by | |
| 28 | - dsimp [j] | |
| 29 | - push_cast | |
| 30 | - ring | |
| 31 | - have hstep : j+1 ≤ j^2 := by linarith only [hj2,sq_nonneg (j-2)] | |
| 32 | - have hsq : (j+1)^2 ≤ (j^2)^2 := pow_le_pow_left₀ (by positivity) hstep 2 | |
| 33 | - apply exp_le_exp.mpr | |
| 34 | - change scaleSequence J X n/j^2 ≤ scaleSequence J X (n+1)/((J+(n+1) : ℕ) : ℝ)^2 | |
| 35 | - rw [scaleSequence_succ,hadd] | |
| 36 | - apply (div_le_div_iff₀ (sq_pos_of_pos hj0) (sq_pos_of_pos (by positivity))).2 | |
| 37 | - calc | |
| 38 | - scaleSequence J X n*(j+1)^2 ≤ scaleSequence J X n*(j^2)^2 := | |
| 39 | - mul_le_mul_of_nonneg_left hsq hx | |
| 40 | - _ = (j^2*scaleSequence J X n)*j^2 := by ring | |
| 41 | - | |
| 42 | -theorem initial_frequency_le_first (J D : ℕ) (hJ : 3 ≤ J) (X : ℝ) (hX : 0 ≤ X) | |
| 43 | - (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) : | |
| 44 | - X^D ≤ frequency J X 0 := by | |
| 45 | - let j : ℝ := (J-1 : ℕ) | |
| 46 | - have hj2 : (2 : ℝ) ≤ j := by | |
| 47 | - dsimp [j] | |
| 48 | - exact_mod_cast (show 2 ≤ J-1 by omega) | |
| 49 | - have hJ0 : (0 : ℝ) < J := by exact_mod_cast (show 0 < J by omega) | |
| 50 | - have hadd : (J : ℝ)=j+1 := by | |
| 51 | - dsimp [j] | |
| 52 | - exact_mod_cast (show J=J-1+1 by omega) | |
| 53 | - have hstep : j+1 ≤ j^2 := by linarith only [hj2,sq_nonneg (j-2)] | |
| 54 | - have hsq : (J : ℝ)^2 ≤ j^4 := by | |
| 55 | - rw [hadd] | |
| 56 | - simpa only [← pow_mul] using pow_le_pow_left₀ (by positivity) hstep 2 | |
| 57 | - apply hbase.trans | |
| 58 | - change exp (X/j^4) ≤ exp (X/(J : ℝ)^2) | |
| 59 | - exact exp_le_exp.mpr (div_le_div_of_nonneg_left hX (sq_pos_of_pos hJ0) hsq) | |
| 60 | - | |
| 61 | -theorem initial_frequency_le_previous (J D : ℕ) (hJ : 3 ≤ J) (X : ℝ) (hX : 0 ≤ X) | |
| 62 | - (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 63 | - X^D ≤ previousFrequency J D X n := by | |
| 64 | - cases n with | |
| 65 | - | zero => exact le_rfl | |
| 66 | - | succ n => | |
| 67 | - exact (initial_frequency_le_first J D hJ X hX hbase).trans | |
| 68 | - (frequency_monotone J (by omega) X hX (Nat.zero_le n)) | |
| 69 | - | |
| 70 | -theorem previousFrequency_one_le (J D : ℕ) (hJ : 3 ≤ J) (X : ℝ) (hX : 1 ≤ X) | |
| 71 | - (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 72 | - 1 ≤ previousFrequency J D X n := | |
| 73 | - (one_le_pow₀ hX).trans | |
| 74 | - (initial_frequency_le_previous J D hJ X (zero_le_one.trans hX) hbase n) | |
| 75 | - | |
| 76 | -theorem base_inverse_le_initial_frequency (J D : ℕ) (hJ : 1 ≤ J) (hD : 2000 ≤ D) | |
| 77 | - (X : ℝ) (hX : 2 ≤ X) : 12/baseHorizon J X ≤ X^D := by | |
| 78 | - have hx1 : 1 ≤ X := by linarith only [hX] | |
| 79 | - have hx0 : 0 ≤ X := zero_le_one.trans hx1 | |
| 80 | - have hxpow : 2 ≤ X^1000 := hX.trans (by | |
| 81 | - simpa only [pow_one] using pow_le_pow_right₀ hx1 (by decide : 1 ≤ 1000)) | |
| 82 | - calc | |
| 83 | - 12/baseHorizon J X ≤ 2*X^1000 := base_inverse_time_le J hJ X hx1 | |
| 84 | - _ ≤ X^1000*X^1000 := mul_le_mul_of_nonneg_right hxpow (pow_nonneg hx0 1000) | |
| 85 | - _ = X^2000 := by rw [← pow_add] | |
| 86 | - _ ≤ X^D := pow_le_pow_right₀ hx1 hD | |
| 87 | - | |
| 88 | -theorem base_inverse_le_previous_frequency (J D : ℕ) (hJ : 3 ≤ J) (hD : 2000 ≤ D) | |
| 89 | - (X : ℝ) (hX : 2 ≤ X) | |
| 90 | - (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 91 | - 12/baseHorizon J X ≤ previousFrequency J D X n := | |
| 92 | - (base_inverse_le_initial_frequency J D (by omega) hD X hX).trans | |
| 93 | - (initial_frequency_le_previous J D hJ X (by linarith only [hX]) hbase n) | |
| 94 | - | |
| 95 | -theorem base_inverse_le_previous_frequency_pow80 (J D : ℕ) (hJ : 3 ≤ J) (hD : 2000 ≤ D) | |
| 96 | - (X : ℝ) (hX : 2 ≤ X) | |
| 97 | - (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 98 | - 12/baseHorizon J X ≤ previousFrequency J D X n^80 := by | |
| 99 | - have hk := previousFrequency_one_le J D hJ X (by linarith only [hX]) hbase n | |
| 100 | - exact (base_inverse_le_previous_frequency J D hJ hD X hX hbase n).trans (by | |
| 101 | - simpa only [pow_one] using pow_le_pow_right₀ hk (by decide : 1 ≤ 80)) | |
| 102 | - | |
| 103 | -end EulerParentHistoryFrequency | |
+68 −1 Euler/ParentInitializedRadiusPolynomial.lean View file
| @@ -1,11 +1,78 @@ | ||
| 1 | 1 | import Euler.PacketSourceRadiusPolynomial |
| 2 | 2 | import Euler.ParentPacketJoinedInput |
| 3 | -import Euler.ParentCorrectionCostEnvelope | |
| 3 | +import Euler.ParentCoefficientPolynomial | |
| 4 | +import Euler.PacketCorrectionPrimitiveBounds | |
| 4 | 5 | import Euler.PacketJoinedCoefficientBudgets |
| 5 | 6 | |
| 6 | 7 | /-! Polynomial control of the literal canonical initialized radius built from |
| 7 | 8 | the parent fields. The boundary coefficient remains an explicit scalar input. -/ |
| 8 | 9 | |
| 10 | +/-! ## From `Euler/ParentCorrectionCostEnvelope.lean` | |
| 11 | + | |
| 12 | +The text of `Euler/ParentCorrectionCostEnvelope.lean`, folded into this file, which was its only importer. -/ | |
| 13 | + | |
| 14 | +section | |
| 15 | + | |
| 16 | +/-! Composing the actual coefficient envelope with the parent label | |
| 17 | +polynomial gives a single fixed polynomial in the parent size K. -/ | |
| 18 | + | |
| 19 | +noncomputable section | |
| 20 | + | |
| 21 | +namespace EulerParentCorrectionCost | |
| 22 | + | |
| 23 | +open EulerParentCoefficientPolynomial EulerPacketCorrectionPrimitive EulerPolynomialCost | |
| 24 | + | |
| 25 | +variable (P : ℝ) [Fact (0 < P)] | |
| 26 | + | |
| 27 | +def parentEnvelope (K : ℝ) : ℝ := | |
| 28 | + 1+leafEnvelope K+primitiveEnvelope P (leafEnvelope K) | |
| 29 | + | |
| 30 | +def parentPolynomial : Polynomial ℝ := | |
| 31 | + 1+leafPolynomial+(primitivePolynomial P).comp leafPolynomial | |
| 32 | + | |
| 33 | +def parentConstant : ℝ := coefficientCost (parentPolynomial P) | |
| 34 | +def parentPower : ℕ := (parentPolynomial P).natDegree | |
| 35 | + | |
| 36 | +theorem parentConstant_pos : 0 < parentConstant P := coefficientCost_pos _ | |
| 37 | + | |
| 38 | +theorem parentPolynomial_eval (K : ℝ) : (parentPolynomial P).eval K=parentEnvelope P K := by | |
| 39 | + simp only [parentPolynomial,parentEnvelope,Polynomial.eval_add,Polynomial.eval_one, | |
| 40 | + Polynomial.eval_comp,leafPolynomial_eval,primitivePolynomial_eval] | |
| 41 | + | |
| 42 | +theorem parentEnvelope_power (K : ℝ) (hK : 1 ≤ K) : | |
| 43 | + parentEnvelope P K ≤ parentConstant P*K^parentPower P := by | |
| 44 | + rw [← parentPolynomial_eval] | |
| 45 | + exact (le_abs_self _).trans (eval_bound (parentPolynomial P) K hK) | |
| 46 | + | |
| 47 | +theorem parentEnvelope_bounds (K : ℝ) (hK : 0 ≤ K) : | |
| 48 | + 1 ≤ parentEnvelope P K ∧ leafEnvelope K ≤ parentEnvelope P K ∧ | |
| 49 | + primitiveEnvelope P (leafEnvelope K) ≤ parentEnvelope P K := by | |
| 50 | + have hl := (leaf_bounds K hK).1 | |
| 51 | + have hp := (primitive_components P (leafEnvelope K) (zero_le_one.trans hl)).1 | |
| 52 | + unfold parentEnvelope | |
| 53 | + exact ⟨by linarith,by linarith,by linarith⟩ | |
| 54 | + | |
| 55 | +end EulerParentCorrectionCost | |
| 56 | + | |
| 57 | +namespace EulerPacketCylinderField.CoefficientBudget | |
| 58 | + | |
| 59 | +open EulerParentCorrectionCost EulerParentCoefficientPolynomial | |
| 60 | + | |
| 61 | +variable {P T : ℝ} [Fact (0 < P)] {O : EulerPacketProfileRecursion.Operators} | |
| 62 | + {C : CoefficientData P T O} (B : CoefficientBudget C) | |
| 63 | + | |
| 64 | +theorem parent_primitive_bound (K : ℝ) (hK : 0 ≤ K) | |
| 65 | + (hR : B.Rc ≤ leafEnvelope K) (hC : B.amplitude ≤ leafEnvelope K) : | |
| 66 | + B.multiplierCost ≤ parentEnvelope P K ∧ B.termCost ≤ parentEnvelope P K := by | |
| 67 | + have h := B.primitive_bound (leafEnvelope K) (zero_le_one.trans (leaf_bounds K hK).1) hR hC | |
| 68 | + have he := (parentEnvelope_bounds P K hK).2.2 | |
| 69 | + exact ⟨h.1.trans he,h.2.trans he⟩ | |
| 70 | + | |
| 71 | +end EulerPacketCylinderField.CoefficientBudget | |
| 72 | +end | |
| 73 | + | |
| 74 | +end | |
| 75 | + | |
| 9 | 76 | noncomputable section |
| 10 | 77 | |
| 11 | 78 | namespace EulerParentInitializedRadius |
+43 −1 Euler/ParentInitializedUniformCosts.lean View file
| @@ -1,10 +1,52 @@ | ||
| 1 | 1 | import Euler.PacketSourceUniformEnvelope |
| 2 | -import Euler.ParentPacketGeometryInput | |
| 2 | +import Euler.ParentPacketJoinedInput | |
| 3 | +import Euler.PacketGeometryJoinedBudget | |
| 3 | 4 | import Euler.ParentForwardRadiusPolynomial |
| 4 | 5 | |
| 5 | 6 | /-! The actual parent and chosen geometric profile supply every primitive |
| 6 | 7 | of the uniform correction and physical-output comparison. -/ |
| 7 | 8 | |
| 9 | +/-! ## From `Euler/ParentPacketGeometryInput.lean` | |
| 10 | + | |
| 11 | +The text of `Euler/ParentPacketGeometryInput.lean`, folded into this file, which was its only importer. -/ | |
| 12 | + | |
| 13 | +section | |
| 14 | + | |
| 15 | +/-! The actual activation geometry fills the remaining propagator input | |
| 16 | +in the parent-to-packet constructor. All three source budgets share one | |
| 17 | +radius and retain the growth profile derived from that geometry. -/ | |
| 18 | + | |
| 19 | +noncomputable section | |
| 20 | + | |
| 21 | +namespace EulerParentPacketFrames.LabelData | |
| 22 | + | |
| 23 | +open Set EulerSmoothLimit EulerTransversePacketProvider EulerPacketSourceGeometry | |
| 24 | + | |
| 25 | +variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 26 | + {G : Parent} (L : LabelData G) (H : LowBounds G) | |
| 27 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) | |
| 28 | + (S : Set Space) (hS : IsCompact S) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < G.T) | |
| 29 | + (P : ParentFrame (G.transverseData m hm R S hS) τ) | |
| 30 | + (J : Guards hτ hτT P (G.historyOn H m hm R S hS τ hτ hτT)) | |
| 31 | + (hball : (1/2 : ℝ) ≤ J.radius) | |
| 32 | + (Ti TiTotal : ℝ) (hτ1 : τ ≤ 1) (hTi : τ⁻¹ ≤ Ti) | |
| 33 | + (hT1 : G.T ≤ 1) (hTiTotal : G.T⁻¹ ≤ TiTotal) | |
| 34 | + (Ω : Set Space) (hΩ : MeasurableSet Ω) (hΩo : IsOpen Ω) | |
| 35 | + (hsub : S ⊆ Ω) (hΩball : ∀ x ∈ Ω, ‖x‖ ≤ (1/2 : ℝ)) | |
| 36 | + | |
| 37 | +def geometryInputs : | |
| 38 | + JoinedInputs (G.meanData H) (G.transverseData m hm R S hS) τ hτ hτT | |
| 39 | + (G.historyOn H m hm R S hS τ hτ hτT) := | |
| 40 | + L.joinedInputs H m hm R S hS τ hτ hτT Ti (560*P.horizon^10/P.epsilon) | |
| 41 | + hτ1 hTi J.growth_constant_pos.le (J.sourceGrowthProfile hball) | |
| 42 | + (J.sourceGrowthProfile_positive hball) (J.sourceGrowthProfile_initial hball) | |
| 43 | + Ω hΩ hΩo hsub hΩball (J.sourceGrowthProfile_propagator hball) TiTotal hT1 hTiTotal | |
| 44 | + | |
| 45 | +end EulerParentPacketFrames.LabelData | |
| 46 | +end | |
| 47 | + | |
| 48 | +end | |
| 49 | + | |
| 8 | 50 | noncomputable section |
| 9 | 51 | |
| 10 | 52 | namespace EulerParentPacketFrames.LabelData |
+214 −2 Euler/ParentNeighborThreshold.lean View file
| @@ -1,10 +1,222 @@ | ||
| 1 | -import Euler.ParentHistoryFrequencyGuard | |
| 2 | -import Euler.ParentPacketNeighborScaleGuard | |
| 1 | +import Euler.PacketNestedHorizons | |
| 2 | +import Euler.PacketSourceParameterScales | |
| 3 | +import Euler.ParentPacketNeighborPolynomial | |
| 4 | +import Euler.PacketSourceScaleActual | |
| 3 | 5 | |
| 4 | 6 | /-! Fixed coefficient thresholds for the literal neighboring-label guard. |
| 5 | 7 | The history reciprocal is derived from the initial geometric step, and |
| 6 | 8 | the only parent size input is the already constructed parent's label bound. -/ |
| 7 | 9 | |
| 10 | +/-! ## From `Euler/ParentHistoryFrequencyGuard.lean` | |
| 11 | + | |
| 12 | +The text of `Euler/ParentHistoryFrequencyGuard.lean`, folded into this file, which was its only importer. -/ | |
| 13 | + | |
| 14 | +section | |
| 15 | + | |
| 16 | +/-! Reciprocal history times fit the literal previous-frequency budget. | |
| 17 | +Only the first geometric step needs coupling and tilt bounds. All later | |
| 18 | +step lengths are nonnegative independently of any future frame invariant. -/ | |
| 19 | + | |
| 20 | +noncomputable section | |
| 21 | + | |
| 22 | +namespace EulerParentHistoryFrequency | |
| 23 | + | |
| 24 | +open Real EulerPacketSourceScaleChoice EulerPacketSourceScaleSequence | |
| 25 | + EulerPacketSourceParameterScales EulerPacketSourceScaleActual | |
| 26 | + EulerPacketNestedHorizons EulerPacketBaseGuardScales | |
| 27 | + | |
| 28 | +theorem frequency_monotone (J : ℕ) (hJ : 2 ≤ J) (X : ℝ) (hX : 0 ≤ X) : | |
| 29 | + Monotone (frequency J X) := by | |
| 30 | + apply monotone_nat_of_le_succ | |
| 31 | + intro n | |
| 32 | + let j : ℝ := (J+n : ℕ) | |
| 33 | + have hj2 : (2 : ℝ) ≤ j := by | |
| 34 | + dsimp [j] | |
| 35 | + exact_mod_cast (show 2 ≤ J+n by omega) | |
| 36 | + have hj0 : 0 < j := by linarith only [hj2] | |
| 37 | + have hx : 0 ≤ scaleSequence J X n := | |
| 38 | + hX.trans (sequence_initial_le J (by omega) X hX n) | |
| 39 | + have hadd : ((J+(n+1) : ℕ) : ℝ)=j+1 := by | |
| 40 | + dsimp [j] | |
| 41 | + push_cast | |
| 42 | + ring | |
| 43 | + have hstep : j+1 ≤ j^2 := by linarith only [hj2,sq_nonneg (j-2)] | |
| 44 | + have hsq : (j+1)^2 ≤ (j^2)^2 := pow_le_pow_left₀ (by positivity) hstep 2 | |
| 45 | + apply exp_le_exp.mpr | |
| 46 | + change scaleSequence J X n/j^2 ≤ scaleSequence J X (n+1)/((J+(n+1) : ℕ) : ℝ)^2 | |
| 47 | + rw [scaleSequence_succ,hadd] | |
| 48 | + apply (div_le_div_iff₀ (sq_pos_of_pos hj0) (sq_pos_of_pos (by positivity))).2 | |
| 49 | + calc | |
| 50 | + scaleSequence J X n*(j+1)^2 ≤ scaleSequence J X n*(j^2)^2 := | |
| 51 | + mul_le_mul_of_nonneg_left hsq hx | |
| 52 | + _ = (j^2*scaleSequence J X n)*j^2 := by ring | |
| 53 | + | |
| 54 | +theorem initial_frequency_le_first (J D : ℕ) (hJ : 3 ≤ J) (X : ℝ) (hX : 0 ≤ X) | |
| 55 | + (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) : | |
| 56 | + X^D ≤ frequency J X 0 := by | |
| 57 | + let j : ℝ := (J-1 : ℕ) | |
| 58 | + have hj2 : (2 : ℝ) ≤ j := by | |
| 59 | + dsimp [j] | |
| 60 | + exact_mod_cast (show 2 ≤ J-1 by omega) | |
| 61 | + have hJ0 : (0 : ℝ) < J := by exact_mod_cast (show 0 < J by omega) | |
| 62 | + have hadd : (J : ℝ)=j+1 := by | |
| 63 | + dsimp [j] | |
| 64 | + exact_mod_cast (show J=J-1+1 by omega) | |
| 65 | + have hstep : j+1 ≤ j^2 := by linarith only [hj2,sq_nonneg (j-2)] | |
| 66 | + have hsq : (J : ℝ)^2 ≤ j^4 := by | |
| 67 | + rw [hadd] | |
| 68 | + simpa only [← pow_mul] using pow_le_pow_left₀ (by positivity) hstep 2 | |
| 69 | + apply hbase.trans | |
| 70 | + change exp (X/j^4) ≤ exp (X/(J : ℝ)^2) | |
| 71 | + exact exp_le_exp.mpr (div_le_div_of_nonneg_left hX (sq_pos_of_pos hJ0) hsq) | |
| 72 | + | |
| 73 | +theorem initial_frequency_le_previous (J D : ℕ) (hJ : 3 ≤ J) (X : ℝ) (hX : 0 ≤ X) | |
| 74 | + (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 75 | + X^D ≤ previousFrequency J D X n := by | |
| 76 | + cases n with | |
| 77 | + | zero => exact le_rfl | |
| 78 | + | succ n => | |
| 79 | + exact (initial_frequency_le_first J D hJ X hX hbase).trans | |
| 80 | + (frequency_monotone J (by omega) X hX (Nat.zero_le n)) | |
| 81 | + | |
| 82 | +theorem previousFrequency_one_le (J D : ℕ) (hJ : 3 ≤ J) (X : ℝ) (hX : 1 ≤ X) | |
| 83 | + (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 84 | + 1 ≤ previousFrequency J D X n := | |
| 85 | + (one_le_pow₀ hX).trans | |
| 86 | + (initial_frequency_le_previous J D hJ X (zero_le_one.trans hX) hbase n) | |
| 87 | + | |
| 88 | +theorem base_inverse_le_initial_frequency (J D : ℕ) (hJ : 1 ≤ J) (hD : 2000 ≤ D) | |
| 89 | + (X : ℝ) (hX : 2 ≤ X) : 12/baseHorizon J X ≤ X^D := by | |
| 90 | + have hx1 : 1 ≤ X := by linarith only [hX] | |
| 91 | + have hx0 : 0 ≤ X := zero_le_one.trans hx1 | |
| 92 | + have hxpow : 2 ≤ X^1000 := hX.trans (by | |
| 93 | + simpa only [pow_one] using pow_le_pow_right₀ hx1 (by decide : 1 ≤ 1000)) | |
| 94 | + calc | |
| 95 | + 12/baseHorizon J X ≤ 2*X^1000 := base_inverse_time_le J hJ X hx1 | |
| 96 | + _ ≤ X^1000*X^1000 := mul_le_mul_of_nonneg_right hxpow (pow_nonneg hx0 1000) | |
| 97 | + _ = X^2000 := by rw [← pow_add] | |
| 98 | + _ ≤ X^D := pow_le_pow_right₀ hx1 hD | |
| 99 | + | |
| 100 | +theorem base_inverse_le_previous_frequency (J D : ℕ) (hJ : 3 ≤ J) (hD : 2000 ≤ D) | |
| 101 | + (X : ℝ) (hX : 2 ≤ X) | |
| 102 | + (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 103 | + 12/baseHorizon J X ≤ previousFrequency J D X n := | |
| 104 | + (base_inverse_le_initial_frequency J D (by omega) hD X hX).trans | |
| 105 | + (initial_frequency_le_previous J D hJ X (by linarith only [hX]) hbase n) | |
| 106 | + | |
| 107 | +theorem base_inverse_le_previous_frequency_pow80 (J D : ℕ) (hJ : 3 ≤ J) (hD : 2000 ≤ D) | |
| 108 | + (X : ℝ) (hX : 2 ≤ X) | |
| 109 | + (hbase : X^D ≤ exp (X/((J-1 : ℕ) : ℝ)^4)) (n : ℕ) : | |
| 110 | + 12/baseHorizon J X ≤ previousFrequency J D X n^80 := by | |
| 111 | + have hk := previousFrequency_one_le J D hJ X (by linarith only [hX]) hbase n | |
| 112 | + exact (base_inverse_le_previous_frequency J D hJ hD X hX hbase n).trans (by | |
| 113 | + simpa only [pow_one] using pow_le_pow_right₀ hk (by decide : 1 ≤ 80)) | |
| 114 | + | |
| 115 | +end EulerParentHistoryFrequency | |
| 116 | +end | |
| 117 | + | |
| 118 | +end | |
| 119 | + | |
| 120 | +/-! ## From `Euler/ParentPacketNeighborScaleGuard.lean` | |
| 121 | + | |
| 122 | +The text of `Euler/ParentPacketNeighborScaleGuard.lean`, folded into this file, which was its only importer. -/ | |
| 123 | + | |
| 124 | +section | |
| 125 | + | |
| 126 | +/-! The computed neighboring-label cost fits the source's monomial | |
| 127 | +majorant under fixed degree and constant guards. Thus the small support | |
| 128 | +scale discharges the literal neighbor comparison in the geometry step. -/ | |
| 129 | + | |
| 130 | +noncomputable section | |
| 131 | + | |
| 132 | +namespace EulerParentNeighborCost | |
| 133 | + | |
| 134 | +theorem polynomial_le_monomial (A K Ti H k h : ℝ) (n q c : ℕ) | |
| 135 | + (hA : 0 ≤ A) (hK : 0 ≤ K) (hTi : 0 ≤ Ti) (hH : 0 ≤ H) | |
| 136 | + (hk : 1 ≤ k) (hh : 1 ≤ h) (hKk : K ≤ k^q) (hTik : Ti ≤ k^q) (hHh : H ≤ h) | |
| 137 | + (hcost : A*4^n ≤ k) (hc : q*n+1 ≤ c) (hn : n ≤ c) : | |
| 138 | + A*(1+K+Ti+H)^n ≤ k^c*h^c := by | |
| 139 | + have hk0 : 0 ≤ k := zero_le_one.trans hk | |
| 140 | + have hh0 : 0 ≤ h := zero_le_one.trans hh | |
| 141 | + have hkq : 1 ≤ k^q := one_le_pow₀ hk | |
| 142 | + have hkq0 : 0 ≤ k^q := zero_le_one.trans hkq | |
| 143 | + have hkh : 1 ≤ k^q*h := one_le_mul_of_one_le_of_one_le hkq hh | |
| 144 | + have hkk : k^q ≤ k^q*h := le_mul_of_one_le_right hkq0 hh | |
| 145 | + have hhh : h ≤ k^q*h := le_mul_of_one_le_left hh0 hkq | |
| 146 | + have hb : 1+K+Ti+H ≤ 4*k^q*h := by | |
| 147 | + linarith only [hkh,hKk.trans hkk,hTik.trans hkk,hHh.trans hhh] | |
| 148 | + calc | |
| 149 | + _ ≤ A*(4*k^q*h)^n := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hb n) hA | |
| 150 | + _ = (A*4^n)*(k^(q*n)*h^n) := by simp only [mul_pow]; ring | |
| 151 | + _ ≤ k*(k^(q*n)*h^n) := mul_le_mul_of_nonneg_right hcost (by positivity) | |
| 152 | + _ = k^(q*n+1)*h^n := by rw [pow_succ]; ring | |
| 153 | + _ ≤ k^c*h^c := mul_le_mul (pow_le_pow_right₀ hk hc) (pow_le_pow_right₀ hh hn) | |
| 154 | + (pow_nonneg hh0 n) (pow_nonneg hk0 c) | |
| 155 | + | |
| 156 | +end EulerParentNeighborCost | |
| 157 | + | |
| 158 | +namespace EulerParentPacketFrames.LabelData | |
| 159 | + | |
| 160 | +open Set EulerSmoothLimit EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 161 | + EulerPacketSourceGeometry EulerParentNeighborCost EulerPacketSourceScaleSequence | |
| 162 | + EulerPacketSourceScaleActual | |
| 163 | + | |
| 164 | +variable {G : Parent} (L : LabelData G) | |
| 165 | + {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 166 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 167 | + (S : Set Space) (hS : IsCompact S) (H : LowBounds G) | |
| 168 | + (τ : ℝ) (hτ : 0 < τ) (hτT : τ < G.T) | |
| 169 | + (P : ParentFrame (G.transverseData m hm R S hS) τ) | |
| 170 | + (Ti CM CH : ℝ) (hτ1 : τ ≤ 1) (hTi : τ⁻¹ ≤ Ti) | |
| 171 | + (hCM : 0 ≤ CM) (hCH : 0 ≤ CH) (ha : 1/2 ≤ P.a) (hH : 1 ≤ P.shear) | |
| 172 | + | |
| 173 | +include hτ1 hTi hCM hCH ha hH in | |
| 174 | +theorem neighborScaleCost_monomial (k : ℝ) (q c : ℕ) | |
| 175 | + (hk : 1 ≤ k) (hKk : L.K ≤ k^q) (hTik : Ti ≤ k^q) | |
| 176 | + (hcost : (EulerParentNeighborCost.constant*(2*(1+CM+CH))^degree)*4^degree ≤ k) | |
| 177 | + (hc : q*degree+1 ≤ c) (hn : degree ≤ c) : | |
| 178 | + L.neighborScaleCost m hm R S hS H τ hτ hτT P CM CH ≤ k^c*P.shear^c := by | |
| 179 | + have hconst := EulerParentNeighborCost.constant_pos | |
| 180 | + exact (L.neighborScaleCost_low_polynomial m hm R S hS H τ hτ hτT P Ti CM CH | |
| 181 | + hτ1 hTi hCM hCH ha hH).trans | |
| 182 | + (polynomial_le_monomial | |
| 183 | + (EulerParentNeighborCost.constant*(2*(1+CM+CH))^degree) | |
| 184 | + L.K Ti P.shear k P.shear degree q c (by positivity) | |
| 185 | + (zero_le_one.trans L.K_one) ((inv_pos.mpr hτ).le.trans hTi) | |
| 186 | + (zero_le_one.trans hH) hk hH hKk hTik le_rfl hcost hc hn) | |
| 187 | + | |
| 188 | +include hτ1 hTi hCM hCH ha hH in | |
| 189 | +theorem neighbor_error_of_source_scales (J D : ℕ) (X ρ : ℝ) (j q c : ℕ) | |
| 190 | + (hρ : 0 ≤ ρ) (hρ1 : ρ ≤ 1) | |
| 191 | + (hshear : P.shear=previousShear J X j) | |
| 192 | + (hk : 1 ≤ previousFrequency J D X j) | |
| 193 | + (hKk : L.K ≤ previousFrequency J D X j^q) (hTik : Ti ≤ previousFrequency J D X j^q) | |
| 194 | + (hcost : (EulerParentNeighborCost.constant*(2*(1+CM+CH))^degree)*4^degree ≤ | |
| 195 | + previousFrequency J D X j) | |
| 196 | + (hc : q*degree+1 ≤ c) (hn : degree ≤ c) | |
| 197 | + (hscale : G.ell ≤ supportScale J X j) : | |
| 198 | + L.neighborScaleCost m hm R S hS H τ hτ hτT P CM CH*G.ell*ρ ≤ | |
| 199 | + neighborError J D X (c : ℝ) j := by | |
| 200 | + have hbound := L.neighborScaleCost_monomial m hm R S hS H τ hτ hτT P Ti CM CH | |
| 201 | + hτ1 hTi hCM hCH ha hH (previousFrequency J D X j) q c hk hKk hTik hcost hc hn | |
| 202 | + have hmono : 0 ≤ previousFrequency J D X j^c*P.shear^c := | |
| 203 | + mul_nonneg (pow_nonneg (zero_le_one.trans hk) c) (pow_nonneg (zero_le_one.trans hH) c) | |
| 204 | + calc | |
| 205 | + _ ≤ (previousFrequency J D X j^c*P.shear^c)*G.ell*ρ := | |
| 206 | + mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hbound G.ell_pos.le) hρ | |
| 207 | + _ ≤ (previousFrequency J D X j^c*P.shear^c)*G.ell := by | |
| 208 | + simpa only [mul_one] using mul_le_mul_of_nonneg_left hρ1 (mul_nonneg hmono G.ell_pos.le) | |
| 209 | + _ ≤ (previousFrequency J D X j^c*P.shear^c)*supportScale J X j := | |
| 210 | + mul_le_mul_of_nonneg_left hscale hmono | |
| 211 | + _ = neighborError J D X (c : ℝ) j := by | |
| 212 | + simp only [neighborError,Real.rpow_natCast,hshear] | |
| 213 | + ring | |
| 214 | + | |
| 215 | +end EulerParentPacketFrames.LabelData | |
| 216 | +end | |
| 217 | + | |
| 218 | +end | |
| 219 | + | |
| 8 | 220 | noncomputable section |
| 9 | 221 | |
| 10 | 222 | namespace EulerParentNeighborThreshold |
+97 −1 Euler/ParentNormalPacketParameters.lean View file
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | import Euler.ParentInitializedUniformCosts |
| 2 | 2 | import Euler.ParentForwardUniformCosts |
| 3 | -import Euler.ParentPacketParameterCaps | |
| 3 | +import Euler.ParentPacketNeighborPolynomial | |
| 4 | +import Euler.PacketParameterEnvelope | |
| 4 | 5 | import Euler.PacketLowConstants |
| 5 | 6 | import Euler.PacketUniformFrequencyScales |
| 6 | 7 | |
| @@ -8,6 +9,101 @@ import Euler.PacketUniformFrequencyScales | ||
| 8 | 9 | envelope. This includes the chosen terminal coordinate and canonical |
| 9 | 10 | boundary coefficient, with the polynomial first shear retained. -/ |
| 10 | 11 | |
| 12 | +/-! ## From `Euler/ParentPacketParameterCaps.lean` | |
| 13 | + | |
| 14 | +The text of `Euler/ParentPacketParameterCaps.lean`, folded into this file, which was its only importer. -/ | |
| 15 | + | |
| 16 | +section | |
| 17 | + | |
| 18 | +/-! Actual selected terminal coordinates and the canonical boundary | |
| 19 | +parameter have fixed polynomial caps. They are inputs to the uniform | |
| 20 | +normal-stage source envelope. -/ | |
| 21 | + | |
| 22 | +noncomputable section | |
| 23 | + | |
| 24 | +namespace EulerParentPacketParameterCaps | |
| 25 | + | |
| 26 | +open Real EulerPacketParentLabelBounds EulerTransverseActivationSelection EulerMeanHarmonic | |
| 27 | + | |
| 28 | +def terminalConstant (CM CH : ℝ) : ℝ := | |
| 29 | + 8*(activationConstant CM CH+1)*(1+3*(1+embeddingCost)^2) | |
| 30 | + | |
| 31 | +theorem terminalConstant_nonneg (CM CH : ℝ) (hCH : 0 ≤ CH) : | |
| 32 | + 0 ≤ terminalConstant CM CH := by | |
| 33 | + unfold terminalConstant activationConstant | |
| 34 | + positivity | |
| 35 | + | |
| 36 | +def boundaryConstant (CM : ℝ) : ℝ := boundaryLocalizationC1*(CM+2)+1 | |
| 37 | + | |
| 38 | +theorem boundaryConstant_pos (CM : ℝ) (hCM : 0 ≤ CM) : 0 < boundaryConstant CM := by | |
| 39 | + unfold boundaryConstant | |
| 40 | + positivity [boundaryLocalizationC1_nonneg] | |
| 41 | + | |
| 42 | +theorem boundary_parameter_bound (CM Bc L X : ℝ) (hX : 1 ≤ X) | |
| 43 | + (hBc : Bc ≤ CM*X^1000+2) (hL : L=boundaryLocalizationC1*Bc+1) : | |
| 44 | + L ≤ boundaryConstant CM*X^1000 := by | |
| 45 | + have hp : 1 ≤ X^1000 := one_le_pow₀ hX | |
| 46 | + have hb : Bc ≤ (CM+2)*X^1000 := by linarith only [hBc,hp] | |
| 47 | + have h := mul_le_mul_of_nonneg_left hb boundaryLocalizationC1_nonneg | |
| 48 | + rw [hL] | |
| 49 | + unfold boundaryConstant | |
| 50 | + linarith only [h,hp] | |
| 51 | + | |
| 52 | +end EulerParentPacketParameterCaps | |
| 53 | + | |
| 54 | +namespace EulerParentPacketFrames.LabelData | |
| 55 | + | |
| 56 | +open Set EulerSmoothLimit EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 57 | + EulerPacketSourceGeometry EulerPacketParentLabelBounds EulerGevrey | |
| 58 | + EulerParentPacketParameterCaps EulerTransverseActivationSelection | |
| 59 | + | |
| 60 | +variable {A : Parent} (L : LabelData A) | |
| 61 | + {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 62 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 63 | + (support : Set Space) (hsupport : IsCompact support) | |
| 64 | + {τ : ℝ} {hτ : 0 < τ} {hτT : τ < A.T} | |
| 65 | + {P : ParentFrame (A.transverseData m hm R support hsupport) τ} | |
| 66 | + {H : HistoryData ((A.transverseData m hm R support hsupport).initial τ hτ hτT.le)} | |
| 67 | + (G : Guards hτ hτT P H) | |
| 68 | + | |
| 69 | +theorem selected_terminal_bound (hH : 1 ≤ P.shear) : | |
| 70 | + ‖G.terminal‖ ≤ terminalConstant G.CM G.CH*L.K^4 := by | |
| 71 | + let D := A.transverseData m hm R support hsupport | |
| 72 | + have hK0 := zero_le_one.trans L.K_one | |
| 73 | + have hF : ∀ t x, ‖D.F.field t x‖ ≤ frameAmplitude L.K := by | |
| 74 | + intro t x | |
| 75 | + change ‖A.frame.field t x‖ ≤ frameAmplitude L.K | |
| 76 | + have h := L.frame_scaled_bound 0 t x | |
| 77 | + simpa only [norm_iteratedFDeriv_zero,majorant,Nat.zero_add,Nat.factorial_zero, | |
| 78 | + Nat.cast_one,pow_zero,mul_one,one_pow] using h | |
| 79 | + have hInv := D.inverseBound_le_of_frame (frameAmplitude L.K) | |
| 80 | + (frameAmplitude_nonneg L.K) A.frame_det hF | |
| 81 | + have hK2 : 1 ≤ L.K^2 := one_le_pow₀ L.K_one | |
| 82 | + have hK4 : 1 ≤ L.K^4 := one_le_pow₀ L.K_one | |
| 83 | + have hEmb := embeddingCost_nonneg | |
| 84 | + have hFcap : frameAmplitude L.K ≤ (1+embeddingCost)*L.K^2 := by | |
| 85 | + unfold frameAmplitude gradientAmplitude | |
| 86 | + linarith only [hK2] | |
| 87 | + have hFsquare := pow_le_pow_left₀ (frameAmplitude_nonneg L.K) hFcap 2 | |
| 88 | + have hIcap : D.inverseBound ≤ (1+3*(1+embeddingCost)^2)*L.K^4 := by | |
| 89 | + linarith only [hInv,hFsquare,hK4] | |
| 90 | + have hAct : 0 ≤ 8*(activationConstant G.CM G.CH+1) := by | |
| 91 | + unfold activationConstant | |
| 92 | + positivity [G.CH_nonneg] | |
| 93 | + calc | |
| 94 | + _ ≤ P.terminalBound G.CM G.CH := G.terminal_properties.2.2.2.1 | |
| 95 | + _ ≤ 8*(activationConstant G.CM G.CH+1)*D.inverseBound := by | |
| 96 | + unfold ParentFrame.terminalBound | |
| 97 | + exact div_le_self (mul_nonneg hAct D.inverseBound_pos.le) hH | |
| 98 | + _ ≤ 8*(activationConstant G.CM G.CH+1)*((1+3*(1+embeddingCost)^2)*L.K^4) := | |
| 99 | + mul_le_mul_of_nonneg_left hIcap hAct | |
| 100 | + _ = _ := by unfold terminalConstant; ring | |
| 101 | + | |
| 102 | +end EulerParentPacketFrames.LabelData | |
| 103 | +end | |
| 104 | + | |
| 105 | +end | |
| 106 | + | |
| 11 | 107 | noncomputable section |
| 12 | 108 | |
| 13 | 109 | namespace EulerNormalPacketParameters |
+0 −83 Euler/ParentNormalizedEuler.lean deleted
| @@ -1,83 +0,0 @@ | ||
| 1 | -import Euler.ParentNormalizedGeometry | |
| 2 | -import Euler.EulerSpatialRescaling | |
| 3 | - | |
| 4 | -/-! Normalizing the actual parent Euler velocity and pressure preserves | |
| 5 | -Euler and supplies the true time law of the normalized particle map. -/ | |
| 6 | - | |
| 7 | -noncomputable section | |
| 8 | - | |
| 9 | -namespace EulerParentPacketFrames.Parent | |
| 10 | - | |
| 11 | -open Set Filter EulerSmoothLimit EulerLagrangian | |
| 12 | -open scoped Topology | |
| 13 | - | |
| 14 | -variable (A : EulerParentPacketFrames.Parent) | |
| 15 | - | |
| 16 | -def normalizedVelocity (u : ℝ × Space → Space) : ℝ × Space → Space := | |
| 17 | - EulerSpatialRescaling.velocity A.ell⁻¹ u | |
| 18 | - | |
| 19 | -def normalizedPressure (p : ℝ × Space → ℝ) : ℝ × Space → ℝ := | |
| 20 | - EulerSpatialRescaling.pressure A.ell⁻¹ p | |
| 21 | - | |
| 22 | -@[simp] theorem normalizedVelocity_apply (u : ℝ × Space → Space) (q : ℝ × Space) : | |
| 23 | - A.normalizedVelocity u q=A.ell⁻¹ • u (q.1,A.ell • q.2) := by | |
| 24 | - simp only [normalizedVelocity,EulerSpatialRescaling.velocity,EulerSpatialRescaling.coordinates_apply,inv_inv] | |
| 25 | - | |
| 26 | -@[simp] theorem normalizedPressure_apply (p : ℝ × Space → ℝ) (q : ℝ × Space) : | |
| 27 | - A.normalizedPressure p q=(A.ell⁻¹)^2*p (q.1,A.ell • q.2) := by | |
| 28 | - simp only [normalizedPressure,EulerSpatialRescaling.pressure,EulerSpatialRescaling.coordinates_apply,inv_inv] | |
| 29 | - | |
| 30 | -theorem normalizedVelocity_differentiableAt (u : ℝ × Space → Space) (t : ℝ) (x : Space) | |
| 31 | - (hu : DifferentiableAt ℝ u (t,A.ell • x)) : | |
| 32 | - DifferentiableAt ℝ (A.normalizedVelocity u) (t,x) := by | |
| 33 | - apply (EulerSpatialRescaling.velocity_hasFDerivAt A.ell⁻¹ u (t,x) ?_).differentiableAt | |
| 34 | - simpa only [EulerSpatialRescaling.coordinates_apply,inv_inv] using hu | |
| 35 | - | |
| 36 | -theorem normalizedPressure_differentiableAt (p : ℝ × Space → ℝ) (t : ℝ) (x : Space) | |
| 37 | - (hp : DifferentiableAt ℝ (fun y => p (t,y)) (A.ell • x)) : | |
| 38 | - DifferentiableAt ℝ (fun y => A.normalizedPressure p (t,y)) x := by | |
| 39 | - have hc : DifferentiableAt ℝ (fun y => p (t,A.ell • y)) x := | |
| 40 | - hp.comp x (A.ell • ContinuousLinearMap.id ℝ Space).differentiableAt | |
| 41 | - have he : (fun y => A.normalizedPressure p (t,y)) = (fun y => (A.ell⁻¹)^2*p (t,A.ell • y)) := | |
| 42 | - funext (fun y => A.normalizedPressure_apply p (t,y)) | |
| 43 | - rw [he] | |
| 44 | - exact hc.const_mul ((A.ell⁻¹)^2) | |
| 45 | - | |
| 46 | -theorem normalizedMomentum_zero (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) | |
| 47 | - (t : ℝ) (x : Space) | |
| 48 | - (hu : DifferentiableAt ℝ u (t,A.ell • x)) | |
| 49 | - (hp : DifferentiableAt ℝ (fun y => p (t,y)) (A.ell • x)) | |
| 50 | - (he : momentumResidual u p (t,A.ell • x)=0) : | |
| 51 | - momentumResidual (A.normalizedVelocity u) (A.normalizedPressure p) (t,x)=0 := by | |
| 52 | - apply EulerSpatialRescaling.momentumResidual_zero A.ell⁻¹ (inv_ne_zero A.ell_pos.ne') u p (t,x) | |
| 53 | - · simpa only [EulerSpatialRescaling.coordinates_apply,inv_inv] using hu | |
| 54 | - · simpa only [inv_inv] using hp | |
| 55 | - · simpa only [EulerSpatialRescaling.coordinates_apply,inv_inv] using he | |
| 56 | - | |
| 57 | -theorem packetPosition_velocity_eventually (u : ℝ × Space → Space) | |
| 58 | - (hvelocity : ∀ (t : Icc (0 : ℝ) A.T) x, A.velocity.field t x=u (t,A.position t x)) | |
| 59 | - (t : ℝ) (ht : t ∈ Ioo 0 A.T) (x : Space) : | |
| 60 | - (fun q => fderiv ℝ A.packetPosition q (1,0)) =ᶠ[𝓝 (t,x)] | |
| 61 | - fun q => A.normalizedVelocity u (q.1,A.packetPosition q) := by | |
| 62 | - filter_upwards [(continuous_fst.tendsto (t,x)).eventually (Ioo_mem_nhds ht.1 ht.2)] with q hq | |
| 63 | - rw [A.packetPosition_time q.1 hq q.2,A.normalizedVelocity_apply] | |
| 64 | - have hp : A.ell • A.packetPosition q = | |
| 65 | - A.position ⟨q.1,hq.1.le,hq.2.le⟩ (A.ell • q.2) := by | |
| 66 | - rw [A.packetPosition_apply ⟨q.1,hq.1.le,hq.2.le⟩ q.2, | |
| 67 | - smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul] | |
| 68 | - rw [hp,hvelocity] | |
| 69 | - | |
| 70 | -theorem normalizedVelocity_restore (u : ℝ × Space → Space) (q : ℝ × Space) : | |
| 71 | - EulerSpatialRescaling.velocity A.ell (A.normalizedVelocity u) q=u q := by | |
| 72 | - simp only [EulerSpatialRescaling.velocity,EulerSpatialRescaling.coordinates_apply, | |
| 73 | - normalizedVelocity_apply,smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul,Prod.mk.eta] | |
| 74 | - | |
| 75 | -theorem normalizedVelocity_add_restore (u w : ℝ × Space → Space) (q : ℝ × Space) : | |
| 76 | - EulerSpatialRescaling.velocity A.ell (fun r => A.normalizedVelocity u r+w r) q = | |
| 77 | - u q + A.ell • w (q.1,A.ell⁻¹ • q.2) := by | |
| 78 | - change A.ell • (A.normalizedVelocity u (q.1,A.ell⁻¹ • q.2)+w (q.1,A.ell⁻¹ • q.2))=_ | |
| 79 | - rw [smul_add] | |
| 80 | - change EulerSpatialRescaling.velocity A.ell (A.normalizedVelocity u) q+_=_ | |
| 81 | - rw [A.normalizedVelocity_restore] | |
| 82 | - | |
| 83 | -end EulerParentPacketFrames.Parent | |
+0 −105 Euler/ParentPacketChildLowGuards.lean deleted
| @@ -1,105 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketInitialLowBounds | |
| 2 | -import Euler.ParentEulerChild | |
| 3 | - | |
| 4 | -/-! The next packet's localized lower initial-gradient bounds and upper | |
| 5 | -pressure bound are consequences of the exact physical estimates. The | |
| 6 | -radius stays fixed, and the boundary parameter has a canonical value. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentPacketFrames.Evolution | |
| 11 | - | |
| 12 | -open Set InnerProductSpace EulerSmoothLimit EulerMeanHarmonic | |
| 13 | - EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 14 | - EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 15 | - EulerGraphInvariantFlow EulerPacketTerminalDatum EulerSpatialCutoffs | |
| 16 | - EulerPacketSourceGeometry EulerPacketGeometryLowBounds | |
| 17 | - | |
| 18 | -variable {A : Parent} (E : Evolution A) | |
| 19 | - {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 20 | - (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 21 | - (support : Set Space) (hSupport : IsCompact support) | |
| 22 | - {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 23 | - {Z R : FieldTower period A.T} | |
| 24 | - (B : Budget period A.T_pos (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 25 | - (residual : ApproximationResidual period A.T_pos | |
| 26 | - (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 27 | - {raw : EulerPacketProfileRecursion.VectorField} | |
| 28 | - (V : EulerPacketCylinderField.Field period A.T raw) (hV : Z=V.toFieldTower) | |
| 29 | - (G : EulerPhysicalGraphFlowBounds.Data period A.T) (hG : G.A=B.liftedPacketCoefficient period V) | |
| 30 | - (k : ℝ) (hk : k*κ=1) (hgraph : ∀ t q, graphConstraint k m (G.A.field t q)=0) | |
| 31 | - (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 32 | - | |
| 33 | -section Joined | |
| 34 | - | |
| 35 | -variable {τ : ℝ} {hτ : 0 < τ} {hτT : τ < A.T} | |
| 36 | - {F : ParentFrame (A.transverseData m hm J support hSupport) τ} | |
| 37 | - {D : HistoryData ((A.transverseData m hm J support hSupport).initial τ hτ hτT.le)} | |
| 38 | - (C : Guards hτ hτT F D) (hball : (1/2 : ℝ) ≤ C.radius) | |
| 39 | - (hs : tsupport EulerSpatialCutoffs.innerCutoff ⊆ support) (hδ : 0 < C.δ) (hδ1 : C.δ ≤ 1) | |
| 40 | - | |
| 41 | -def joinedChildLowBounds (H : LowBounds A) (ev ep CM CH : ℝ) | |
| 42 | - (herr : E.SourceErrors m hm J support hSupport B residual k C hball hs ev ep) | |
| 43 | - (hCM : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ CM) | |
| 44 | - (hCH : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (E.force t) x‖ ≤ CH) | |
| 45 | - (hsmall : (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.badRatio)+ep)*(A.T^2/2)+ | |
| 46 | - (H.Be+(C.hchild*C.badRatio+ev))*A.T+ | |
| 47 | - boundaryLocalizationC2*(H.Bc+(C.hchild*C.badRatio+ev))*H.r^3*A.T ≤ 1/2) : | |
| 48 | - LowBounds (A.child G k m hgraph nextEll hnext hnext1) := by | |
| 49 | - have hev : 0 ≤ ev := (norm_nonneg _).trans (herr A.zeroTime 0).1 | |
| 50 | - have hep : 0 ≤ ep := (norm_nonneg _).trans (herr A.zeroTime 0).2 | |
| 51 | - have hCM0 : 0 ≤ CM := (norm_nonneg _).trans (hCM A.zeroTime 0) | |
| 52 | - apply E.updateLowBounds | |
| 53 | - (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1) | |
| 54 | - H (C.hchild*C.badRatio+ev) (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.badRatio)+ep) | |
| 55 | - · exact add_nonneg (mul_nonneg C.child_nonneg C.badRatio_nonneg) hev | |
| 56 | - · positivity [H.K_nonneg,C.child_nonneg,C.delta_nonneg,goodRatio_pos,C.badRatio_nonneg] | |
| 57 | - · intro x | |
| 58 | - exact E.exactPacket_initial_gradient_increment m hm J support hSupport B residual k hk | |
| 59 | - C hball hs hδ hδ1 ev ep herr x | |
| 60 | - · intro t x z | |
| 61 | - let EC := E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1 | |
| 62 | - rw [← EC.pressure_hessian_eq_force] | |
| 63 | - exact (E.exactPacket_whole_horizon_low_bounds m hm J support hSupport B residual k hk | |
| 64 | - C hball hs hδ hδ1 ev ep CM CH H.K herr hCM hCH | |
| 65 | - (E.force_quadratic_upper_of_lowBounds H) t x).2.2 z | |
| 66 | - · exact hsmall | |
| 67 | - | |
| 68 | -end Joined | |
| 69 | - | |
| 70 | -section Forward | |
| 71 | - | |
| 72 | -variable {F : ParentFrame (A.transverseData m hm J support hSupport) 0} | |
| 73 | - (C : ForwardGuards F) (hball : (1/2 : ℝ) ≤ C.radius) | |
| 74 | - (hδ : 0 < C.δ) (hδ1 : C.δ ≤ 1) | |
| 75 | - | |
| 76 | -def forwardChildLowBounds (H : LowBounds A) (ev ep CM CH : ℝ) | |
| 77 | - (herr : E.ForwardSourceErrors m hm J support hSupport B residual k C hball ev ep) | |
| 78 | - (hCM : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ CM) | |
| 79 | - (hCH : ∀ (t : Icc (0 : ℝ) A.T) x, ‖fderiv ℝ (E.force t) x‖ ≤ CH) | |
| 80 | - (hsmall : (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.earlyRatio)+ep)*(A.T^2/2)+ | |
| 81 | - (H.Be+(C.hchild*C.earlyRatio+ev))*A.T+ | |
| 82 | - boundaryLocalizationC2*(H.Bc+(C.hchild*C.earlyRatio+ev))*H.r^3*A.T ≤ 1/2) : | |
| 83 | - LowBounds (A.child G k m hgraph nextEll hnext hnext1) := by | |
| 84 | - have hev : 0 ≤ ev := (norm_nonneg _).trans (herr A.zeroTime 0).1 | |
| 85 | - have hep : 0 ≤ ep := (norm_nonneg _).trans (herr A.zeroTime 0).2 | |
| 86 | - have hCM0 : 0 ≤ CM := (norm_nonneg _).trans (hCM A.zeroTime 0) | |
| 87 | - apply E.updateLowBounds | |
| 88 | - (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1) | |
| 89 | - H (C.hchild*C.earlyRatio+ev) (H.K+2*CM*C.hchild*(C.δ*goodRatio+C.earlyRatio)+ep) | |
| 90 | - · exact add_nonneg (mul_nonneg C.child_nonneg C.earlyRatio_nonneg) hev | |
| 91 | - · positivity [H.K_nonneg,C.child_nonneg,C.delta_nonneg,goodRatio_pos,C.earlyRatio_nonneg] | |
| 92 | - · intro x | |
| 93 | - exact E.exactForwardPacket_initial_gradient_increment m hm J support hSupport B residual k hk | |
| 94 | - C hball hδ hδ1 ev ep herr x | |
| 95 | - · intro t x z | |
| 96 | - let EC := E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1 | |
| 97 | - rw [← EC.pressure_hessian_eq_force] | |
| 98 | - exact (E.exactForwardPacket_whole_horizon_low_bounds m hm J support hSupport B residual k hk | |
| 99 | - C hball hδ hδ1 ev ep CM CH H.K herr hCM hCH | |
| 100 | - (E.force_quadratic_upper_of_lowBounds H) t x).2.2 z | |
| 101 | - · exact hsmall | |
| 102 | - | |
| 103 | -end Forward | |
| 104 | - | |
| 105 | -end EulerParentPacketFrames.Evolution | |
+0 −61 Euler/ParentPacketCorrectionParity.lean deleted
| @@ -1,61 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketParity | |
| 2 | -import Euler.ParentPacketJoinedInput | |
| 3 | -import Euler.PacketLiftedParity | |
| 4 | -import Euler.PacketForwardInitializedCorrectionParity | |
| 5 | - | |
| 6 | -/-! Actual odd parent fields supply the parity data for both initialized | |
| 7 | -packet branches. The resulting corrected coefficient, and hence the | |
| 8 | -actual next particle map, retain oddness without a new symmetry premise. -/ | |
| 9 | - | |
| 10 | -noncomputable section | |
| 11 | - | |
| 12 | -namespace EulerParentPacketFrames.OddData | |
| 13 | - | |
| 14 | -open Set EulerSmoothLimit EulerSpatialCutoffs EulerPacketTerminalDatum | |
| 15 | - EulerPacketCylinderField EulerPacketProfileRecursion EulerCorrectionAssembly | |
| 16 | - EulerTimeIntervalRestriction EulerGraphInvariantFlow EulerAllOrderCorrectionData | |
| 17 | - EulerAllOrderDriftCorrection | |
| 18 | - | |
| 19 | -variable {A : Parent} (O : OddData A) (H : LowBounds A) | |
| 20 | - {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 21 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) | |
| 22 | - (S : Set Space) (hS : IsCompact S) (hSym : ∀ x, -x ∈ S ↔ x ∈ S) | |
| 23 | - (δ : ℝ) (hδ : 0 < δ) (ξ : U) (hs : tsupport innerCutoff ⊆ S) (α : ℝ) | |
| 24 | - | |
| 25 | -include O hSym | |
| 26 | - | |
| 27 | -theorem forwardCorrectionParity (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : | |
| 28 | - ParityData period | |
| 29 | - (forwardInitializedCorrectionData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 30 | - δ hδ ξ hs α (A.sourceAgreement m hm R S hS H) N hN k hk) := | |
| 31 | - forwardInitializedCorrectionParityData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 32 | - δ hδ ξ hs α (O.meanEvenData H) hSym O.frame_even O.strain_even | |
| 33 | - (A.sourceAgreement m hm R S hS H) N hN k hk | |
| 34 | - | |
| 35 | -theorem joinedCorrectionParity (τ : ℝ) (hτ : 0 < τ) (hτT : τ < A.T) | |
| 36 | - (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : | |
| 37 | - ParityData period | |
| 38 | - (initializedCorrectionData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 39 | - τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α | |
| 40 | - (A.sourceAgreement m hm R S hS H) N hN k hk) := by | |
| 41 | - apply initializedCorrectionParityData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 42 | - τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α | |
| 43 | - (O.meanEvenData H) hSym O.frame_even O.strain_even | |
| 44 | - _ (A.sourceAgreement m hm R S hS H) N hN k hk | |
| 45 | - intro t x | |
| 46 | - exact O.curvature_even (initialInclusion A.T τ hτT.le t) x | |
| 47 | - | |
| 48 | -omit hSym [CompleteSpace U] in | |
| 49 | -theorem childOfPacket {P : ℝ} [Fact (0 < P)] {C : EulerAllOrderCorrectionData.Data P A.T} | |
| 50 | - (B : Budget P A.T_pos C) (E : ParityData P C) | |
| 51 | - {raw : VectorField} (V : Field P A.T raw) (hV : C.approximation=V.toFieldTower) | |
| 52 | - (G : EulerPhysicalGraphFlowBounds.Data P A.T) (hG : G.A=B.liftedPacketCoefficient P V) | |
| 53 | - (k : ℝ) (hgraph : ∀ t z, graphConstraint k C.direction (G.A.field t z)=0) | |
| 54 | - (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) : | |
| 55 | - OddData (A.child G k C.direction hgraph nextEll hnext hnext1) := by | |
| 56 | - apply O.child G _ k C.direction hgraph nextEll hnext hnext1 | |
| 57 | - intro t | |
| 58 | - rw [hG] | |
| 59 | - exact B.liftedPacketCoefficient_odd P V hV E t | |
| 60 | - | |
| 61 | -end EulerParentPacketFrames.OddData | |
+0 −122 Euler/ParentPacketExactDivergence.lean deleted
| @@ -1,122 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketExactEuler | |
| 2 | -import Euler.PacketExactPhysicalEuler | |
| 3 | - | |
| 4 | -/-! Incompressibility of the actual corrected parent velocity. The | |
| 5 | -normalized packet uses the parent's genuine determinant-one Jacobian, | |
| 6 | -and the final physical rescaling preserves divergence exactly. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerSpatialRescaling | |
| 11 | - | |
| 12 | -open EulerSmoothLimit | |
| 13 | - | |
| 14 | -theorem divergence_eq (ell : ℝ) (hell : ell ≠ 0) | |
| 15 | - (u : ℝ × Space → Space) (t : ℝ) (x : Space) | |
| 16 | - (hu : DifferentiableAt ℝ (fun y => u (t,y)) (ell⁻¹ • x)) : | |
| 17 | - divergence (fun y => velocity ell u (t,y)) x = | |
| 18 | - divergence (fun y => u (t,y)) (ell⁻¹ • x) := by | |
| 19 | - rw [divergence_eq_trace,spatial_derivative ell hell u t x hu] | |
| 20 | - rfl | |
| 21 | - | |
| 22 | -end EulerSpatialRescaling | |
| 23 | - | |
| 24 | -namespace EulerParentPacketFrames.Parent | |
| 25 | - | |
| 26 | -open Set Filter EulerSmoothLimit EulerLiftedGradientSpace EulerTransverseFrameCoordinates | |
| 27 | - EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 28 | - EulerPacketPhysicalTransform EulerLagrangian | |
| 29 | -open scoped ContDiff Topology | |
| 30 | - | |
| 31 | -variable (A : EulerParentPacketFrames.Parent) | |
| 32 | - | |
| 33 | -theorem normalizedVelocity_divergence (u : ℝ × Space → Space) (t : ℝ) (x : Space) | |
| 34 | - (hu : DifferentiableAt ℝ (fun y => u (t,y)) (A.ell • x)) : | |
| 35 | - divergence (fun y => A.normalizedVelocity u (t,y)) x = | |
| 36 | - divergence (fun y => u (t,y)) (A.ell • x) := by | |
| 37 | - have h := EulerSpatialRescaling.divergence_eq A.ell⁻¹ (inv_ne_zero A.ell_pos.ne') | |
| 38 | - u t x (by simpa only [inv_inv] using hu) | |
| 39 | - simpa only [normalizedVelocity,inv_inv] using h | |
| 40 | - | |
| 41 | -theorem packetPosition_spatial_frame (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 42 | - fderiv ℝ (fun y => A.packetPosition (t,y)) x=A.packetFrame (t,x) := by | |
| 43 | - rw [(A.packetPosition_spatial t x).fderiv] | |
| 44 | - exact (A.frame.realField_apply A.T A.T_pos.le t x).symm | |
| 45 | - | |
| 46 | -theorem packetFrame_det (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 47 | - (EulerPacketPiola.operatorMatrix (A.packetFrame (t,x))).det=1 := by | |
| 48 | - change (EulerPacketPiola.operatorMatrix (A.frame.realField A.T A.T_pos.le t x)).det=1 | |
| 49 | - rw [A.frame.realField_apply A.T A.T_pos.le t x] | |
| 50 | - exact A.frame_det t x | |
| 51 | - | |
| 52 | -variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 53 | - (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 54 | - (support : Set Space) (hSupport : IsCompact support) | |
| 55 | - {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 56 | - {Z R : FieldTower P A.T} | |
| 57 | - (B : Budget P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 58 | - (residual : ApproximationResidual P A.T_pos | |
| 59 | - (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 60 | - (k : ℝ) (hk : k*κ=1) (Y : Icc (0 : ℝ) A.T → Space → Space) | |
| 61 | - (hYX : ∀ t x, Y t (A.position t x)=x) | |
| 62 | - (hXY : ∀ t x, A.position t (Y t x)=x) (hY : Continuous (Function.uncurry Y)) | |
| 63 | - (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) | |
| 64 | - (hvelocity : ∀ (t : Icc (0 : ℝ) A.T) x, A.velocity.field t x=u (t,A.position t x)) | |
| 65 | - (hu : ∀ t ∈ Ioo 0 A.T, ∀ x, DifferentiableAt ℝ u (t,x)) | |
| 66 | - (hp : ∀ (t : Icc (0 : ℝ) A.T) x, DifferentiableAt ℝ (fun y => p (t,y)) x) | |
| 67 | - (heuler : ∀ t ∈ Ioo 0 A.T, ∀ x, momentumResidual u p (t,x)=0) | |
| 68 | - (hdiv : ∀ t ∈ Ioo 0 A.T, ∀ x, divergence (fun y => u (t,y)) x=0) | |
| 69 | - | |
| 70 | -include hYX hXY hY hvelocity hu hp heuler hdiv hk in | |
| 71 | -theorem normalizedExact_euler (t : ℝ) (ht : t ∈ Ioo 0 A.T) (x : Space) : | |
| 72 | - momentumResidual (A.normalizedExactVelocity m hm J support hSupport B residual k Y u) | |
| 73 | - (A.normalizedExactPressure m hm J support hSupport B residual k Y p) (t,x)=0 ∧ | |
| 74 | - divergence (fun y => A.normalizedExactVelocity m hm J support hSupport B residual k Y u (t,y)) x=0 := by | |
| 75 | - let y := A.packetInverse Y (t,x) | |
| 76 | - have hy : A.packetPosition (t,y)=x := A.packetInverse_right Y hXY (t,x) | |
| 77 | - have hd : divergence (fun z => A.normalizedVelocity u (t,z)) (A.packetPosition (t,y))=0 := by | |
| 78 | - rw [A.normalizedVelocity_divergence u t (A.packetPosition (t,y))] | |
| 79 | - · exact hdiv t ht _ | |
| 80 | - · exact (hu t ht _).comp _ (hasFDerivAt_prodMk_right t _).differentiableAt | |
| 81 | - have hh := exact_source_euler (A.transverseData m hm J support hSupport) | |
| 82 | - (exactPacketOfResidual P B residual) k hk A.packetFrame (A.normalizedVelocity u) | |
| 83 | - (A.normalizedPressure p) A.packetPosition (A.packetInverse Y) | |
| 84 | - (A.packetFrame_match m hm J support hSupport) t ht y | |
| 85 | - (fun s z => A.packetInverse_left Y hYX (s,z)) | |
| 86 | - (A.packetInverseCoordinates_differentiableAt Y hXY hY t ht (A.packetPosition (t,y))) | |
| 87 | - (A.packetPosition_contDiffAt_two t ht y) | |
| 88 | - (A.packetPosition_frame_eventually t ht y) | |
| 89 | - (A.packetPosition_velocity_eventually u hvelocity t ht y) | |
| 90 | - (A.packetPosition_spatial_frame ⟨t,ht.1.le,ht.2.le⟩) | |
| 91 | - (A.packetFrame_det ⟨t,ht.1.le,ht.2.le⟩) | |
| 92 | - (A.normalizedVelocity_differentiableAt u t (A.packetPosition (t,y)) | |
| 93 | - (hu t ht (A.ell • A.packetPosition (t,y)))) | |
| 94 | - (A.normalizedPressure_differentiableAt p t (A.packetPosition (t,y)) | |
| 95 | - (hp ⟨t,ht.1.le,ht.2.le⟩ (A.ell • A.packetPosition (t,y)))) | |
| 96 | - (A.normalizedMomentum_zero u p t (A.packetPosition (t,y)) | |
| 97 | - (hu t ht (A.ell • A.packetPosition (t,y))) | |
| 98 | - (hp ⟨t,ht.1.le,ht.2.le⟩ (A.ell • A.packetPosition (t,y))) | |
| 99 | - (heuler t ht (A.ell • A.packetPosition (t,y)))) hd | |
| 100 | - rw [hy] at hh | |
| 101 | - exact hh | |
| 102 | - | |
| 103 | -include hYX hXY hY hvelocity hu hp heuler hdiv hk in | |
| 104 | -theorem exactPacket_euler (t : ℝ) (ht : t ∈ Ioo 0 A.T) (x : Space) : | |
| 105 | - momentumResidual (A.exactPacketVelocity m hm J support hSupport B residual k Y u) | |
| 106 | - (A.exactPacketPressure m hm J support hSupport B residual k Y p) (t,x)=0 ∧ | |
| 107 | - divergence (fun y => A.exactPacketVelocity m hm J support hSupport B residual k Y u (t,y)) x=0 := by | |
| 108 | - refine ⟨A.exactPacket_momentum m hm J support hSupport B residual k hk Y | |
| 109 | - hYX hXY hY u p hvelocity hu hp heuler t ht x,?_⟩ | |
| 110 | - have hd : DifferentiableAt ℝ | |
| 111 | - (fun y => A.normalizedExactVelocity m hm J support hSupport B residual k Y u (t,y)) | |
| 112 | - (A.ell⁻¹ • x) := | |
| 113 | - (A.normalizedExactVelocity_differentiableAt m hm J support hSupport B residual k Y | |
| 114 | - hYX hXY hY u hu t ht (A.ell⁻¹ • x)).comp _ | |
| 115 | - (hasFDerivAt_prodMk_right t _).differentiableAt | |
| 116 | - change divergence (fun y => EulerSpatialRescaling.velocity A.ell | |
| 117 | - (A.normalizedExactVelocity m hm J support hSupport B residual k Y u) (t,y)) x=0 | |
| 118 | - rw [EulerSpatialRescaling.divergence_eq A.ell A.ell_pos.ne' _ t x hd] | |
| 119 | - exact (A.normalizedExact_euler m hm J support hSupport B residual k hk Y | |
| 120 | - hYX hXY hY u p hvelocity hu hp heuler hdiv t ht (A.ell⁻¹ • x)).2 | |
| 121 | - | |
| 122 | -end EulerParentPacketFrames.Parent | |
+92 −1 Euler/ParentPacketExactEuler.lean View file
| @@ -1,10 +1,101 @@ | ||
| 1 | -import Euler.ParentNormalizedEuler | |
| 1 | +import Euler.ParentNormalizedGeometry | |
| 2 | +import Euler.EulerSpatialRescaling | |
| 2 | 3 | import Euler.PacketExactEulerianField |
| 3 | 4 | |
| 4 | 5 | /-! The actual source packet is Euler in the physical parent coordinates. |
| 5 | 6 | The normalized frame and inverse identities are supplied by the parent |
| 6 | 7 | construction, and the final physical scaling is explicit. -/ |
| 7 | 8 | |
| 9 | +/-! ## From `Euler/ParentNormalizedEuler.lean` | |
| 10 | + | |
| 11 | +The text of `Euler/ParentNormalizedEuler.lean`, folded into this file, which was its only importer. -/ | |
| 12 | + | |
| 13 | +section | |
| 14 | + | |
| 15 | +/-! Normalizing the actual parent Euler velocity and pressure preserves | |
| 16 | +Euler and supplies the true time law of the normalized particle map. -/ | |
| 17 | + | |
| 18 | +noncomputable section | |
| 19 | + | |
| 20 | +namespace EulerParentPacketFrames.Parent | |
| 21 | + | |
| 22 | +open Set Filter EulerSmoothLimit EulerLagrangian | |
| 23 | +open scoped Topology | |
| 24 | + | |
| 25 | +variable (A : EulerParentPacketFrames.Parent) | |
| 26 | + | |
| 27 | +def normalizedVelocity (u : ℝ × Space → Space) : ℝ × Space → Space := | |
| 28 | + EulerSpatialRescaling.velocity A.ell⁻¹ u | |
| 29 | + | |
| 30 | +def normalizedPressure (p : ℝ × Space → ℝ) : ℝ × Space → ℝ := | |
| 31 | + EulerSpatialRescaling.pressure A.ell⁻¹ p | |
| 32 | + | |
| 33 | +@[simp] theorem normalizedVelocity_apply (u : ℝ × Space → Space) (q : ℝ × Space) : | |
| 34 | + A.normalizedVelocity u q=A.ell⁻¹ • u (q.1,A.ell • q.2) := by | |
| 35 | + simp only [normalizedVelocity,EulerSpatialRescaling.velocity,EulerSpatialRescaling.coordinates_apply,inv_inv] | |
| 36 | + | |
| 37 | +@[simp] theorem normalizedPressure_apply (p : ℝ × Space → ℝ) (q : ℝ × Space) : | |
| 38 | + A.normalizedPressure p q=(A.ell⁻¹)^2*p (q.1,A.ell • q.2) := by | |
| 39 | + simp only [normalizedPressure,EulerSpatialRescaling.pressure,EulerSpatialRescaling.coordinates_apply,inv_inv] | |
| 40 | + | |
| 41 | +theorem normalizedVelocity_differentiableAt (u : ℝ × Space → Space) (t : ℝ) (x : Space) | |
| 42 | + (hu : DifferentiableAt ℝ u (t,A.ell • x)) : | |
| 43 | + DifferentiableAt ℝ (A.normalizedVelocity u) (t,x) := by | |
| 44 | + apply (EulerSpatialRescaling.velocity_hasFDerivAt A.ell⁻¹ u (t,x) ?_).differentiableAt | |
| 45 | + simpa only [EulerSpatialRescaling.coordinates_apply,inv_inv] using hu | |
| 46 | + | |
| 47 | +theorem normalizedPressure_differentiableAt (p : ℝ × Space → ℝ) (t : ℝ) (x : Space) | |
| 48 | + (hp : DifferentiableAt ℝ (fun y => p (t,y)) (A.ell • x)) : | |
| 49 | + DifferentiableAt ℝ (fun y => A.normalizedPressure p (t,y)) x := by | |
| 50 | + have hc : DifferentiableAt ℝ (fun y => p (t,A.ell • y)) x := | |
| 51 | + hp.comp x (A.ell • ContinuousLinearMap.id ℝ Space).differentiableAt | |
| 52 | + have he : (fun y => A.normalizedPressure p (t,y)) = (fun y => (A.ell⁻¹)^2*p (t,A.ell • y)) := | |
| 53 | + funext (fun y => A.normalizedPressure_apply p (t,y)) | |
| 54 | + rw [he] | |
| 55 | + exact hc.const_mul ((A.ell⁻¹)^2) | |
| 56 | + | |
| 57 | +theorem normalizedMomentum_zero (u : ℝ × Space → Space) (p : ℝ × Space → ℝ) | |
| 58 | + (t : ℝ) (x : Space) | |
| 59 | + (hu : DifferentiableAt ℝ u (t,A.ell • x)) | |
| 60 | + (hp : DifferentiableAt ℝ (fun y => p (t,y)) (A.ell • x)) | |
| 61 | + (he : momentumResidual u p (t,A.ell • x)=0) : | |
| 62 | + momentumResidual (A.normalizedVelocity u) (A.normalizedPressure p) (t,x)=0 := by | |
| 63 | + apply EulerSpatialRescaling.momentumResidual_zero A.ell⁻¹ (inv_ne_zero A.ell_pos.ne') u p (t,x) | |
| 64 | + · simpa only [EulerSpatialRescaling.coordinates_apply,inv_inv] using hu | |
| 65 | + · simpa only [inv_inv] using hp | |
| 66 | + · simpa only [EulerSpatialRescaling.coordinates_apply,inv_inv] using he | |
| 67 | + | |
| 68 | +theorem packetPosition_velocity_eventually (u : ℝ × Space → Space) | |
| 69 | + (hvelocity : ∀ (t : Icc (0 : ℝ) A.T) x, A.velocity.field t x=u (t,A.position t x)) | |
| 70 | + (t : ℝ) (ht : t ∈ Ioo 0 A.T) (x : Space) : | |
| 71 | + (fun q => fderiv ℝ A.packetPosition q (1,0)) =ᶠ[𝓝 (t,x)] | |
| 72 | + fun q => A.normalizedVelocity u (q.1,A.packetPosition q) := by | |
| 73 | + filter_upwards [(continuous_fst.tendsto (t,x)).eventually (Ioo_mem_nhds ht.1 ht.2)] with q hq | |
| 74 | + rw [A.packetPosition_time q.1 hq q.2,A.normalizedVelocity_apply] | |
| 75 | + have hp : A.ell • A.packetPosition q = | |
| 76 | + A.position ⟨q.1,hq.1.le,hq.2.le⟩ (A.ell • q.2) := by | |
| 77 | + rw [A.packetPosition_apply ⟨q.1,hq.1.le,hq.2.le⟩ q.2, | |
| 78 | + smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul] | |
| 79 | + rw [hp,hvelocity] | |
| 80 | + | |
| 81 | +theorem normalizedVelocity_restore (u : ℝ × Space → Space) (q : ℝ × Space) : | |
| 82 | + EulerSpatialRescaling.velocity A.ell (A.normalizedVelocity u) q=u q := by | |
| 83 | + simp only [EulerSpatialRescaling.velocity,EulerSpatialRescaling.coordinates_apply, | |
| 84 | + normalizedVelocity_apply,smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul,Prod.mk.eta] | |
| 85 | + | |
| 86 | +theorem normalizedVelocity_add_restore (u w : ℝ × Space → Space) (q : ℝ × Space) : | |
| 87 | + EulerSpatialRescaling.velocity A.ell (fun r => A.normalizedVelocity u r+w r) q = | |
| 88 | + u q + A.ell • w (q.1,A.ell⁻¹ • q.2) := by | |
| 89 | + change A.ell • (A.normalizedVelocity u (q.1,A.ell⁻¹ • q.2)+w (q.1,A.ell⁻¹ • q.2))=_ | |
| 90 | + rw [smul_add] | |
| 91 | + change EulerSpatialRescaling.velocity A.ell (A.normalizedVelocity u) q+_=_ | |
| 92 | + rw [A.normalizedVelocity_restore] | |
| 93 | + | |
| 94 | +end EulerParentPacketFrames.Parent | |
| 95 | +end | |
| 96 | + | |
| 97 | +end | |
| 98 | + | |
| 8 | 99 | noncomputable section |
| 9 | 100 | |
| 10 | 101 | namespace EulerParentPacketFrames.Parent |
+0 −177 Euler/ParentPacketGeometryFrame.lean deleted
| @@ -1,177 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketStrainEvolution | |
| 2 | -import Euler.ParentPacketHessianSymmetry | |
| 3 | -import Euler.PacketSourceGeometryData | |
| 4 | -import Euler.PacketForwardFactorization | |
| 5 | - | |
| 6 | -/-! Actual parent source trajectories supply the older geometric frame. | |
| 7 | -Its matrix derivative is derived from the parent curvature, and its ray | |
| 8 | -and primary velocity are the constructed source trajectories. -/ | |
| 9 | - | |
| 10 | -noncomputable section | |
| 11 | - | |
| 12 | -namespace EulerParentPacketFrames | |
| 13 | - | |
| 14 | -open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficients | |
| 15 | - EulerTransversePacketProvider EulerTransverseFrameCoordinates EulerVolterraConvolution | |
| 16 | - EulerPacketSourceGeometry EulerPacketNormalizedPrimary EulerPacketMovingFrame | |
| 17 | - EulerPacketPrimaryShear EulerPacketRay | |
| 18 | -open scoped ContDiff | |
| 19 | - | |
| 20 | -namespace Parent | |
| 21 | - | |
| 22 | -variable (G : Parent) | |
| 23 | - | |
| 24 | -def sourceNormal (m : Space) (t : ℝ) : Space := | |
| 25 | - (G.inverse.realField G.T G.T_pos.le t 0).adjoint m | |
| 26 | - | |
| 27 | -theorem sourceNormal_apply (m : Space) (t : Icc (0 : ℝ) G.T) : | |
| 28 | - G.sourceNormal m t = (G.inverse.field t 0).adjoint m := by | |
| 29 | - simp only [sourceNormal,SmoothTimeField.realField_apply] | |
| 30 | - | |
| 31 | -theorem sourceNormal_equation (m : Space) (t : Icc (0 : ℝ) G.T) : | |
| 32 | - HasDerivWithinAt (G.sourceNormal m) | |
| 33 | - (-(G.centerStrain t).adjoint (G.sourceNormal m t)) (Icc (0 : ℝ) G.T) t := by | |
| 34 | - have h := (EulerTransverseBoundedFrame.normalMap m).hasFDerivAt.comp_hasDerivWithinAt | |
| 35 | - (t : ℝ) (G.inverse_time t 0) | |
| 36 | - change HasDerivWithinAt (G.sourceNormal m) ((G.inverseDerivative.field t 0).adjoint m) | |
| 37 | - (Icc (0 : ℝ) G.T) t at h | |
| 38 | - apply h.congr_deriv | |
| 39 | - rw [G.inverseDerivative_apply,G.sourceNormal_apply] | |
| 40 | - have hb : G.centerStrain t = G.strain.field t 0 := by | |
| 41 | - simp only [centerStrain,extendPath,projIcc_of_mem G.T_pos.le t.property] | |
| 42 | - rw [hb,G.strain_apply] | |
| 43 | - simp only [map_neg,adjoint_comp,neg_apply,comp_apply] | |
| 44 | - | |
| 45 | -theorem sourceNormal_ne_zero (m : Space) (hm : m ≠ 0) (t : Icc (0 : ℝ) G.T) : | |
| 46 | - G.sourceNormal m t ≠ 0 := by | |
| 47 | - have hi : (G.inverse.field t 0).comp (G.frame.field t 0) = ContinuousLinearMap.id ℝ Space := by | |
| 48 | - apply ContinuousLinearMap.ext | |
| 49 | - intro v | |
| 50 | - exact G.inverse_left t 0 v | |
| 51 | - have hc := congrArg (fun A : Space →L[ℝ] Space => A.adjoint m) hi | |
| 52 | - rw [adjoint_comp,comp_apply,adjoint_id,id_apply] at hc | |
| 53 | - intro hz | |
| 54 | - rw [← G.sourceNormal_apply m t,hz,map_zero] at hc | |
| 55 | - exact hm hc.symm | |
| 56 | - | |
| 57 | -variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 58 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 59 | - (S : Set Space) (hS : IsCompact S) | |
| 60 | - | |
| 61 | -def sourceVelocity (η : U) (t : ℝ) : Space := | |
| 62 | - EulerPacketForwardFactorization.uncutVelocity (G.transverseData m hm R S hS) η t 0 | |
| 63 | - | |
| 64 | -omit [CompleteSpace U] in | |
| 65 | -theorem source_normal_eq (t : Icc (0 : ℝ) G.T) : | |
| 66 | - (G.transverseData m hm R S hS).normal.field t 0 = G.sourceNormal m t := by | |
| 67 | - rw [G.sourceNormal_apply] | |
| 68 | - rfl | |
| 69 | - | |
| 70 | -omit [CompleteSpace U] in | |
| 71 | -theorem source_strain_eq (t : Icc (0 : ℝ) G.T) : | |
| 72 | - (G.transverseData m hm R S hS).M.field t 0 = G.centerStrain t := by | |
| 73 | - simp only [centerStrain,extendPath,projIcc_of_mem G.T_pos.le t.property] | |
| 74 | - rfl | |
| 75 | - | |
| 76 | -theorem sourceVelocity_equation (η : U) (t : Icc (0 : ℝ) G.T) : | |
| 77 | - HasDerivWithinAt (G.sourceVelocity m hm R S hS η) | |
| 78 | - (-(G.centerStrain t) (G.sourceVelocity m hm R S hS η t)+ | |
| 79 | - (2*⟪G.sourceNormal m t,(G.centerStrain t) (G.sourceVelocity m hm R S hS η t)⟫_ℝ/ | |
| 80 | - ‖G.sourceNormal m t‖^2) • G.sourceNormal m t) (Icc (0 : ℝ) G.T) t := by | |
| 81 | - have h := EulerPacketForwardFactorization.uncutVelocity_equation | |
| 82 | - (G.transverseData m hm R S hS) η t 0 | |
| 83 | - erw [EulerPacketPrimaryFactorization.physicalGenerator_apply, | |
| 84 | - G.source_normal_eq m hm R S hS,G.source_strain_eq m hm R S hS] at h | |
| 85 | - exact h | |
| 86 | - | |
| 87 | -theorem sourceVelocity_ne_zero (η : U) (hη : η ≠ 0) (t : Icc (0 : ℝ) G.T) : | |
| 88 | - G.sourceVelocity m hm R S hS η t ≠ 0 := | |
| 89 | - EulerPacketForwardFactorization.uncutVelocity_ne_zero (G.transverseData m hm R S hS) η hη t 0 | |
| 90 | - | |
| 91 | -theorem sourceVelocity_tangent (η : U) (t : Icc (0 : ℝ) G.T) : | |
| 92 | - ⟪G.sourceNormal m t,G.sourceVelocity m hm R S hS η t⟫_ℝ = 0 := by | |
| 93 | - rw [← G.source_normal_eq m hm R S hS] | |
| 94 | - exact EulerPacketForwardFactorization.uncutVelocity_tangent (G.transverseData m hm R S hS) η t 0 | |
| 95 | - | |
| 96 | -/-- Both primary branches are the same actual homogeneous propagator | |
| 97 | -after inserting their constructed initial coordinate. -/ | |
| 98 | -theorem joined_sourceVelocity (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 99 | - (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) (ξ : U) (t : ℝ) : | |
| 100 | - G.sourceVelocity m hm R S hS (B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩) t = | |
| 101 | - EulerPacketPrimaryFactorization.uncutVelocity s hs hsT B ξ t 0 := rfl | |
| 102 | - | |
| 103 | -theorem joined_initialCoordinate_ne_zero (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 104 | - (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) (ξ : U) (hξ : ξ ≠ 0) : | |
| 105 | - B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩ ≠ 0 := by | |
| 106 | - intro hz | |
| 107 | - have hn := EulerPacketPrimaryFactorization.uncutVelocity_ne_zero s hs hsT B ξ hξ | |
| 108 | - ⟨0,le_rfl,G.T_pos.le⟩ 0 | |
| 109 | - have hv := G.joined_sourceVelocity m hm R S hS s hs hsT B ξ 0 | |
| 110 | - rw [hz] at hv | |
| 111 | - have hv0 : G.sourceVelocity m hm R S hS 0 0 = 0 := by | |
| 112 | - unfold sourceVelocity | |
| 113 | - rw [EulerPacketForwardFactorization.uncutVelocity_initial,map_zero] | |
| 114 | - exact hn (hv.symm.trans hv0) | |
| 115 | - | |
| 116 | -variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 117 | - (D : Data V) (hTime : D.T = G.T) (τ : ℝ) (hτ : 0 ≤ τ) | |
| 118 | - | |
| 119 | -/-- The only error input is the literal center derivative estimate for | |
| 120 | -the already constructed perturbation. No ray, velocity or matrix ODE | |
| 121 | -is supplied as a hypothesis. -/ | |
| 122 | -def geometryFrameOfCenterExpansion (η : U) (hη : η ≠ 0) | |
| 123 | - (w : ℝ → Space → Space) (c CM CH K error : ℝ) | |
| 124 | - (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 125 | - (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 126 | - (hM : ∀ t ∈ Icc τ D.T, ‖G.centerStrain t‖ ≤ CM) | |
| 127 | - (hH : ∀ t ∈ Icc τ D.T, ‖G.centerCurvature t‖ ≤ CH) | |
| 128 | - (hupdate : ∀ t : Icc (0 : ℝ) D.T, | |
| 129 | - D.M.field t 0 = G.centerStrain t+fderiv ℝ (w t) 0) | |
| 130 | - (hpacket : ∀ t ∈ Icc τ D.T, | |
| 131 | - ‖fderiv ℝ (w t) 0-c • rankOne ℝ (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t)‖ ≤ error) : | |
| 132 | - ParentFrame D τ where | |
| 133 | - B := G.centerStrain | |
| 134 | - B₁ := G.centerStrainDerivative | |
| 135 | - m := G.sourceNormal m | |
| 136 | - v := G.sourceVelocity m hm R S hS η | |
| 137 | - c := c | |
| 138 | - G := K | |
| 139 | - error := error | |
| 140 | - G_lower := hK | |
| 141 | - error_nonneg := he | |
| 142 | - B_derivative t ht := by | |
| 143 | - rw [hTime] at ht ⊢ | |
| 144 | - exact G.centerStrain_derivative τ hτ t ht | |
| 145 | - ray_equation t ht := by | |
| 146 | - have ht0 : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 147 | - exact (G.sourceNormal_equation m ⟨t,ht0⟩).mono | |
| 148 | - (fun r hr => ⟨hτ.trans hr.1,by simpa only [hTime] using hr.2⟩) | |
| 149 | - velocity_equation t ht := by | |
| 150 | - have ht0 : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 151 | - exact (G.sourceVelocity_equation m hm R S hS η ⟨t,ht0⟩).mono | |
| 152 | - (fun r hr => ⟨hτ.trans hr.1,by simpa only [hTime] using hr.2⟩) | |
| 153 | - ray_nonzero t ht := by | |
| 154 | - have hm0 : m ≠ 0 := by intro h; simp [h] at hm | |
| 155 | - exact G.sourceNormal_ne_zero m hm0 ⟨t,hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 156 | - velocity_nonzero t ht := | |
| 157 | - G.sourceVelocity_ne_zero m hm R S hS η hη ⟨t,hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 158 | - tangent t ht := | |
| 159 | - G.sourceVelocity_tangent m hm R S hS η ⟨t,hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 160 | - B_bound t ht := (hM t ht).trans hMK | |
| 161 | - B₁_bound t ht := by | |
| 162 | - rw [hTime] at hM hH ht | |
| 163 | - exact G.centerStrainDerivative_bound τ CM CH K hτ hCM hM hH hHK t ht | |
| 164 | - remainder_bound t ht := by | |
| 165 | - have htD : t ∈ Icc (0 : ℝ) D.T := ⟨hτ.trans ht.1,ht.2⟩ | |
| 166 | - have htG : t ∈ Icc (0 : ℝ) G.T := by simpa only [hTime] using htD | |
| 167 | - have hm0 : m ≠ 0 := by intro h; simp [h] at hm | |
| 168 | - have hn := G.sourceNormal_ne_zero m hm0 ⟨t,htG⟩ | |
| 169 | - have hv := G.sourceVelocity_ne_zero m hm R S hS η hη ⟨t,htG⟩ | |
| 170 | - have hc := rankOne_normalized c (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t) hv hn | |
| 171 | - have hu := hupdate ⟨t,htD⟩ | |
| 172 | - rw [show D.clamp t = ⟨t,htD⟩ from Data.clamp_coe D ⟨t,htD⟩,hu, | |
| 173 | - add_sub_cancel_left,primaryShear,← hc] | |
| 174 | - exact hpacket t ht | |
| 175 | - | |
| 176 | -end Parent | |
| 177 | -end EulerParentPacketFrames | |
+0 −34 Euler/ParentPacketGeometryInput.lean deleted
| @@ -1,34 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketJoinedInput | |
| 2 | -import Euler.PacketGeometryJoinedBudget | |
| 3 | - | |
| 4 | -/-! The actual activation geometry fills the remaining propagator input | |
| 5 | -in the parent-to-packet constructor. All three source budgets share one | |
| 6 | -radius and retain the growth profile derived from that geometry. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentPacketFrames.LabelData | |
| 11 | - | |
| 12 | -open Set EulerSmoothLimit EulerTransversePacketProvider EulerPacketSourceGeometry | |
| 13 | - | |
| 14 | -variable {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 15 | - {G : Parent} (L : LabelData G) (H : LowBounds G) | |
| 16 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) | |
| 17 | - (S : Set Space) (hS : IsCompact S) (τ : ℝ) (hτ : 0 < τ) (hτT : τ < G.T) | |
| 18 | - (P : ParentFrame (G.transverseData m hm R S hS) τ) | |
| 19 | - (J : Guards hτ hτT P (G.historyOn H m hm R S hS τ hτ hτT)) | |
| 20 | - (hball : (1/2 : ℝ) ≤ J.radius) | |
| 21 | - (Ti TiTotal : ℝ) (hτ1 : τ ≤ 1) (hTi : τ⁻¹ ≤ Ti) | |
| 22 | - (hT1 : G.T ≤ 1) (hTiTotal : G.T⁻¹ ≤ TiTotal) | |
| 23 | - (Ω : Set Space) (hΩ : MeasurableSet Ω) (hΩo : IsOpen Ω) | |
| 24 | - (hsub : S ⊆ Ω) (hΩball : ∀ x ∈ Ω, ‖x‖ ≤ (1/2 : ℝ)) | |
| 25 | - | |
| 26 | -def geometryInputs : | |
| 27 | - JoinedInputs (G.meanData H) (G.transverseData m hm R S hS) τ hτ hτT | |
| 28 | - (G.historyOn H m hm R S hS τ hτ hτT) := | |
| 29 | - L.joinedInputs H m hm R S hS τ hτ hτT Ti (560*P.horizon^10/P.epsilon) | |
| 30 | - hτ1 hTi J.growth_constant_pos.le (J.sourceGrowthProfile hball) | |
| 31 | - (J.sourceGrowthProfile_positive hball) (J.sourceGrowthProfile_initial hball) | |
| 32 | - Ω hΩ hΩo hsub hΩball (J.sourceGrowthProfile_propagator hball) TiTotal hT1 hTiTotal | |
| 33 | - | |
| 34 | -end EulerParentPacketFrames.LabelData | |
+88 −1 Euler/ParentPacketHistoryPolynomial.lean View file
| @@ -1,10 +1,97 @@ | ||
| 1 | 1 | import Euler.ParentPacketHistoryNeighbor |
| 2 | -import Euler.ParentHistoryCostPolynomial | |
| 2 | +import Euler.TransverseHistoryParentCost | |
| 3 | +import Euler.PolynomialCostMajorant | |
| 4 | +import Euler.PacketParentLabelCoefficients | |
| 3 | 5 | |
| 4 | 6 | /-! The actual restricted history sensitivity has a single fixed |
| 5 | 7 | polynomial dependence on the parent label constant and reciprocal |
| 6 | 8 | history length. The small physical scale remains a multiplicative factor. -/ |
| 7 | 9 | |
| 10 | +/-! ## From `Euler/ParentHistoryCostPolynomial.lean` | |
| 11 | + | |
| 12 | +The text of `Euler/ParentHistoryCostPolynomial.lean`, folded into this file, which was its only importer. -/ | |
| 13 | + | |
| 14 | +section | |
| 15 | + | |
| 16 | +/-! One fixed polynomial controls the complete history sensitivity | |
| 17 | +envelope for all parent label constants and reciprocal time bounds. -/ | |
| 18 | + | |
| 19 | +noncomputable section | |
| 20 | + | |
| 21 | +namespace EulerParentHistoryCost | |
| 22 | + | |
| 23 | +open EulerPacketParentLabelBounds EulerPacketParentMeanCoercivity | |
| 24 | + EulerTransverseHistoryBounds EulerTransverseEndpointDifference EulerPolynomialCost | |
| 25 | + | |
| 26 | +def labelHistoryEnvelope (K Ti : ℝ) : ℝ := | |
| 27 | + parentDifferenceEnvelope Ti (frameAmplitude K) (gradientAmplitude K) | |
| 28 | + (27*(frameAmplitude K)^2*gradientAmplitude K) (coefficientRadius K) | |
| 29 | + | |
| 30 | +def labelHistoryPolynomial : Polynomial ℝ := | |
| 31 | + let X : Polynomial ℝ := Polynomial.X | |
| 32 | + let v := Polynomial.C embeddingCost*X^2 | |
| 33 | + let f := 1+v | |
| 34 | + let h := 27*f^2*v | |
| 35 | + let R := 1024+4*X | |
| 36 | + let ci := (3*f^2+1)^2 | |
| 37 | + let r := 1+(2*ci^2*f^2*v+ci*v)+ci*f | |
| 38 | + let d := v+f | |
| 39 | + let a := 1+h | |
| 40 | + let x := f*R | |
| 41 | + let y := v*R | |
| 42 | + let z := h*R | |
| 43 | + let s := r*(1+d^2*(2*r^2)*a)*(2*X*d) | |
| 44 | + let e := (1+3*d^2*(2*r^2)*a+2*d^4*(2*r^2)^2*a^2)*(y+x)+ | |
| 45 | + (d^3*(2*r^2)+d^5*(2*r^2)^2*a)*z | |
| 46 | + let sd := r*(2*X*e+(y+x)*s) | |
| 47 | + let g := (4*ci^2*f^2*v+2*ci*v)*x+2*ci*f*y | |
| 48 | + x*(2*(X+4*ci*f*v))*s+f*(4*g*s+(2*(X+4*ci*f*v))*sd) | |
| 49 | + | |
| 50 | +theorem labelHistoryPolynomial_eval (P : ℝ) : | |
| 51 | + labelHistoryPolynomial.eval P = | |
| 52 | + parentDifferenceEnvelope P (frameAmplitude P) (gradientAmplitude P) | |
| 53 | + (27*(frameAmplitude P)^2*gradientAmplitude P) (1024+4*P) := by | |
| 54 | + simp [labelHistoryPolynomial,parentDifferenceEnvelope,differenceEnvelope, | |
| 55 | + slopeDifferenceEnvelope,slopeEnvelope,generatorDifferenceEnvelope,endpointDifferenceCost, | |
| 56 | + gramInverseEnvelope,transportEnvelope,frameAmplitude,gradientAmplitude] | |
| 57 | + | |
| 58 | +def labelHistoryConstant : ℝ := coefficientCost labelHistoryPolynomial | |
| 59 | +def labelHistoryPower : ℕ := labelHistoryPolynomial.natDegree | |
| 60 | + | |
| 61 | +theorem labelHistoryConstant_pos : 0 < labelHistoryConstant := coefficientCost_pos _ | |
| 62 | + | |
| 63 | +theorem labelHistoryEnvelope_power (K Ti : ℝ) (hK : 0 ≤ K) (hTi : 0 ≤ Ti) : | |
| 64 | + labelHistoryEnvelope K Ti ≤ labelHistoryConstant*(1+K+Ti)^labelHistoryPower := by | |
| 65 | + let P := 1+K+Ti | |
| 66 | + have hP : 1 ≤ P := by dsimp [P]; linarith | |
| 67 | + have hP0 : 0 ≤ P := zero_le_one.trans hP | |
| 68 | + have hKP : K ≤ P := by dsimp [P]; linarith | |
| 69 | + have hTiP : Ti ≤ P := by dsimp [P]; linarith | |
| 70 | + have hE := embeddingCost_nonneg | |
| 71 | + have hF0 := frameAmplitude_nonneg K | |
| 72 | + have hV0 := gradientAmplitude_nonneg K | |
| 73 | + have hV : gradientAmplitude K ≤ gradientAmplitude P := by | |
| 74 | + unfold gradientAmplitude | |
| 75 | + gcongr | |
| 76 | + have hF : frameAmplitude K ≤ frameAmplitude P := add_le_add (le_refl (1 : ℝ)) hV | |
| 77 | + have hH : 27*(frameAmplitude K)^2*gradientAmplitude K ≤ | |
| 78 | + 27*(frameAmplitude P)^2*gradientAmplitude P := by gcongr | |
| 79 | + have hR : coefficientRadius K ≤ 1024+4*P := by | |
| 80 | + unfold coefficientRadius | |
| 81 | + apply max_le | |
| 82 | + · linarith | |
| 83 | + · linarith | |
| 84 | + have he : labelHistoryEnvelope K Ti ≤ labelHistoryPolynomial.eval P := by | |
| 85 | + rw [labelHistoryPolynomial_eval] | |
| 86 | + exact parentDifferenceEnvelope_mono hTi hF0 hV0 (by positivity) | |
| 87 | + (coefficientRadius_nonneg K) hTiP hF hV hH hR | |
| 88 | + exact he.trans ((le_abs_self _).trans (eval_bound labelHistoryPolynomial P hP)) | |
| 89 | + | |
| 90 | +end EulerParentHistoryCost | |
| 91 | +end | |
| 92 | + | |
| 93 | +end | |
| 94 | + | |
| 8 | 95 | noncomputable section |
| 9 | 96 | |
| 10 | 97 | namespace EulerMeanCoefficients.SmoothCoefficientPath |
+0 −119 Euler/ParentPacketInitialLowBounds.lean deleted
| @@ -1,119 +0,0 @@ | ||
| 1 | -import Euler.PacketForwardChildLowBounds | |
| 2 | -import Euler.ParentEulerLowBounds | |
| 3 | - | |
| 4 | -/-! The actual initialized packet changes the initial velocity gradient | |
| 5 | -by the exponentially small early/history size plus its correction error. | |
| 6 | -These are the costs needed to preserve the localized source guards. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerPacketPhysicalLowBounds | |
| 11 | - | |
| 12 | -open EulerSmoothLimit EulerPeriodicProfile | |
| 13 | - | |
| 14 | -theorem norm_le_of_shear_error (V : Matrix) (amp δ θ ev size : ℝ) (r w : Space) | |
| 15 | - (hamp : 0 ≤ amp) (hδ : 0 < δ) (hδ1 : δ ≤ 1) | |
| 16 | - (hsize : amp*(‖r‖*‖w‖) ≤ δ*size) | |
| 17 | - (herr : ‖V-shearTerm amp (deriv (profile δ) θ) r w‖ ≤ ev) : ‖V‖ ≤ size+ev := by | |
| 18 | - have hshear : ‖shearTerm amp (deriv (profile δ) θ) r w‖ ≤ size := | |
| 19 | - (shearTerm_norm_le amp _ δ r w hamp (profile_deriv_abs δ hδ hδ1 θ)).trans | |
| 20 | - ((div_le_iff₀ hδ).2 (by linarith only [hsize])) | |
| 21 | - have h := norm_of_remainder V 0 (shearTerm amp (deriv (profile δ) θ) r w) ev | |
| 22 | - (by simpa only [sub_zero] using herr) | |
| 23 | - simp only [norm_zero,zero_add] at h | |
| 24 | - exact h.trans (add_le_add hshear le_rfl) | |
| 25 | - | |
| 26 | -end EulerPacketPhysicalLowBounds | |
| 27 | - | |
| 28 | -namespace EulerParentPacketFrames.Evolution | |
| 29 | - | |
| 30 | -open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit | |
| 31 | - EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 32 | - EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 33 | - EulerPacketSourceGeometry EulerPacketMovingFrame EulerPacketGeometryLowBounds | |
| 34 | - EulerPacketPhysicalLowBounds EulerPacketPrimaryFactorization EulerPeriodicProfile | |
| 35 | - EulerSpatialCutoffs EulerPacketTerminalDatum | |
| 36 | -open scoped ContDiff | |
| 37 | - | |
| 38 | -variable {A : Parent} (E : Evolution A) | |
| 39 | - | |
| 40 | -variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 41 | - (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 42 | - (support : Set Space) (hSupport : IsCompact support) | |
| 43 | - {κ : ℝ} {hκ : |κ| ≤ 1} {Z R : FieldTower period A.T} | |
| 44 | - (B : Budget period A.T_pos (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 45 | - (residual : ApproximationResidual period A.T_pos | |
| 46 | - (correctionData (A.transverseData m hm J support hSupport) period κ hκ Z R)) | |
| 47 | - (k : ℝ) (hk : k*κ=1) | |
| 48 | - | |
| 49 | -section Joined | |
| 50 | - | |
| 51 | -variable {τ : ℝ} {hτ : 0 < τ} {hτT : τ < A.T} | |
| 52 | - {F : ParentFrame (A.transverseData m hm J support hSupport) τ} | |
| 53 | - {H : HistoryData ((A.transverseData m hm J support hSupport).initial τ hτ hτT.le)} | |
| 54 | - (G : Guards hτ hτT F H) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 55 | - (hs : tsupport innerCutoff ⊆ support) (hδ : 0 < G.δ) (hδ1 : G.δ ≤ 1) | |
| 56 | - | |
| 57 | -include hk hδ hδ1 in | |
| 58 | -theorem exactPacket_bad_gradient_increment | |
| 59 | - (ev ep : ℝ) (herr : E.SourceErrors m hm J support hSupport B residual k G hball hs ev ep) | |
| 60 | - (t : Icc (0 : ℝ) A.T) (ht : scaledTime τ F.a F.epsilon t ≤ 1) (x : Space) : | |
| 61 | - ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (t,y)) x- | |
| 62 | - fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ G.hchild*G.badRatio+ev := by | |
| 63 | - rw [(E.exactPacket_derivative_split m hm J support hSupport B residual k hk t x).1,add_sub_cancel_left] | |
| 64 | - apply norm_le_of_shear_error _ (G.primaryAmplitude hball) G.δ | |
| 65 | - (k*⟪m,E.inverse.normalized t (A.ell⁻¹ • x)⟫_ℝ) ev (G.hchild*G.badRatio) | |
| 66 | - ((A.transverseData m hm J support hSupport).normal.field t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 67 | - (canonicalVelocity τ hτ hτT H G.terminal hs t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 68 | - (G.primaryAmplitude_nonneg hball) hδ hδ1 | |
| 69 | - · simpa only [mul_assoc] using G.bad_primary_size hball t ht (E.inverse.normalized t (A.ell⁻¹ • x)) hs | |
| 70 | - · exact (herr t (A.ell⁻¹ • x)).1 | |
| 71 | - | |
| 72 | -include hk hδ hδ1 in | |
| 73 | -theorem exactPacket_initial_gradient_increment | |
| 74 | - (ev ep : ℝ) (herr : E.SourceErrors m hm J support hSupport B residual k G hball hs ev ep) | |
| 75 | - (x : Space) : | |
| 76 | - ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (0,y)) x- | |
| 77 | - fderiv ℝ (fun y => E.velocity (0,y)) x‖ ≤ G.hchild*G.badRatio+ev := by | |
| 78 | - apply E.exactPacket_bad_gradient_increment m hm J support hSupport B residual k hk G hball hs hδ hδ1 ev ep herr A.zeroTime _ x | |
| 79 | - change (F.a/F.epsilon)*(0-τ) ≤ 1 | |
| 80 | - have h : (F.a/F.epsilon)*(0-τ) ≤ 0 := | |
| 81 | - mul_nonpos_of_nonneg_of_nonpos (div_nonneg G.a_pos.le G.epsilon_pos.le) (by linarith only [hτ]) | |
| 82 | - linarith only [h] | |
| 83 | - | |
| 84 | -end Joined | |
| 85 | - | |
| 86 | -section Forward | |
| 87 | - | |
| 88 | -variable {F : ParentFrame (A.transverseData m hm J support hSupport) 0} | |
| 89 | - (G : ForwardGuards F) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 90 | - (hδ : 0 < G.δ) (hδ1 : G.δ ≤ 1) | |
| 91 | - | |
| 92 | -include hk hδ hδ1 in | |
| 93 | -theorem exactForwardPacket_early_gradient_increment | |
| 94 | - (ev ep : ℝ) (herr : E.ForwardSourceErrors m hm J support hSupport B residual k G hball ev ep) | |
| 95 | - (t : Icc (0 : ℝ) A.T) (ht : scaledTime 0 F.a F.epsilon t ≤ 1) (x : Space) : | |
| 96 | - ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (t,y)) x- | |
| 97 | - fderiv ℝ (fun y => E.velocity (t,y)) x‖ ≤ G.hchild*G.earlyRatio+ev := by | |
| 98 | - rw [(E.exactPacket_derivative_split m hm J support hSupport B residual k hk t x).1,add_sub_cancel_left] | |
| 99 | - apply norm_le_of_shear_error _ (G.primaryAmplitude hball) G.δ | |
| 100 | - (k*⟪m,E.inverse.normalized t (A.ell⁻¹ • x)⟫_ℝ) ev (G.hchild*G.earlyRatio) | |
| 101 | - ((A.transverseData m hm J support hSupport).normal.field t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 102 | - (EulerPacketForwardFactorization.canonicalVelocity (A.transverseData m hm J support hSupport) G.initialCoordinate t (E.inverse.normalized t (A.ell⁻¹ • x))) | |
| 103 | - (G.primaryAmplitude_nonneg hball) hδ hδ1 | |
| 104 | - · simpa only [mul_assoc] using G.early_primary_size hball t ht (E.inverse.normalized t (A.ell⁻¹ • x)) | |
| 105 | - · exact (herr t (A.ell⁻¹ • x)).1 | |
| 106 | - | |
| 107 | -include hk hδ hδ1 in | |
| 108 | -theorem exactForwardPacket_initial_gradient_increment | |
| 109 | - (ev ep : ℝ) (herr : E.ForwardSourceErrors m hm J support hSupport B residual k G hball ev ep) | |
| 110 | - (x : Space) : | |
| 111 | - ‖fderiv ℝ (fun y => A.exactPacketVelocity m hm J support hSupport B residual k E.inverse.field E.velocity (0,y)) x- | |
| 112 | - fderiv ℝ (fun y => E.velocity (0,y)) x‖ ≤ G.hchild*G.earlyRatio+ev := by | |
| 113 | - apply E.exactForwardPacket_early_gradient_increment m hm J support hSupport B residual k hk G hball hδ hδ1 ev ep herr A.zeroTime _ x | |
| 114 | - change (F.a/F.epsilon)*(0-0) ≤ 1 | |
| 115 | - norm_num | |
| 116 | - | |
| 117 | -end Forward | |
| 118 | - | |
| 119 | -end EulerParentPacketFrames.Evolution | |
+0 −93 Euler/ParentPacketNeighborScaleGuard.lean deleted
| @@ -1,93 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketNeighborPolynomial | |
| 2 | -import Euler.PacketSourceScaleActual | |
| 3 | - | |
| 4 | -/-! The computed neighboring-label cost fits the source's monomial | |
| 5 | -majorant under fixed degree and constant guards. Thus the small support | |
| 6 | -scale discharges the literal neighbor comparison in the geometry step. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentNeighborCost | |
| 11 | - | |
| 12 | -theorem polynomial_le_monomial (A K Ti H k h : ℝ) (n q c : ℕ) | |
| 13 | - (hA : 0 ≤ A) (hK : 0 ≤ K) (hTi : 0 ≤ Ti) (hH : 0 ≤ H) | |
| 14 | - (hk : 1 ≤ k) (hh : 1 ≤ h) (hKk : K ≤ k^q) (hTik : Ti ≤ k^q) (hHh : H ≤ h) | |
| 15 | - (hcost : A*4^n ≤ k) (hc : q*n+1 ≤ c) (hn : n ≤ c) : | |
| 16 | - A*(1+K+Ti+H)^n ≤ k^c*h^c := by | |
| 17 | - have hk0 : 0 ≤ k := zero_le_one.trans hk | |
| 18 | - have hh0 : 0 ≤ h := zero_le_one.trans hh | |
| 19 | - have hkq : 1 ≤ k^q := one_le_pow₀ hk | |
| 20 | - have hkq0 : 0 ≤ k^q := zero_le_one.trans hkq | |
| 21 | - have hkh : 1 ≤ k^q*h := one_le_mul_of_one_le_of_one_le hkq hh | |
| 22 | - have hkk : k^q ≤ k^q*h := le_mul_of_one_le_right hkq0 hh | |
| 23 | - have hhh : h ≤ k^q*h := le_mul_of_one_le_left hh0 hkq | |
| 24 | - have hb : 1+K+Ti+H ≤ 4*k^q*h := by | |
| 25 | - linarith only [hkh,hKk.trans hkk,hTik.trans hkk,hHh.trans hhh] | |
| 26 | - calc | |
| 27 | - _ ≤ A*(4*k^q*h)^n := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hb n) hA | |
| 28 | - _ = (A*4^n)*(k^(q*n)*h^n) := by simp only [mul_pow]; ring | |
| 29 | - _ ≤ k*(k^(q*n)*h^n) := mul_le_mul_of_nonneg_right hcost (by positivity) | |
| 30 | - _ = k^(q*n+1)*h^n := by rw [pow_succ]; ring | |
| 31 | - _ ≤ k^c*h^c := mul_le_mul (pow_le_pow_right₀ hk hc) (pow_le_pow_right₀ hh hn) | |
| 32 | - (pow_nonneg hh0 n) (pow_nonneg hk0 c) | |
| 33 | - | |
| 34 | -end EulerParentNeighborCost | |
| 35 | - | |
| 36 | -namespace EulerParentPacketFrames.LabelData | |
| 37 | - | |
| 38 | -open Set EulerSmoothLimit EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 39 | - EulerPacketSourceGeometry EulerParentNeighborCost EulerPacketSourceScaleSequence | |
| 40 | - EulerPacketSourceScaleActual | |
| 41 | - | |
| 42 | -variable {G : Parent} (L : LabelData G) | |
| 43 | - {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 44 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 45 | - (S : Set Space) (hS : IsCompact S) (H : LowBounds G) | |
| 46 | - (τ : ℝ) (hτ : 0 < τ) (hτT : τ < G.T) | |
| 47 | - (P : ParentFrame (G.transverseData m hm R S hS) τ) | |
| 48 | - (Ti CM CH : ℝ) (hτ1 : τ ≤ 1) (hTi : τ⁻¹ ≤ Ti) | |
| 49 | - (hCM : 0 ≤ CM) (hCH : 0 ≤ CH) (ha : 1/2 ≤ P.a) (hH : 1 ≤ P.shear) | |
| 50 | - | |
| 51 | -include hτ1 hTi hCM hCH ha hH in | |
| 52 | -theorem neighborScaleCost_monomial (k : ℝ) (q c : ℕ) | |
| 53 | - (hk : 1 ≤ k) (hKk : L.K ≤ k^q) (hTik : Ti ≤ k^q) | |
| 54 | - (hcost : (EulerParentNeighborCost.constant*(2*(1+CM+CH))^degree)*4^degree ≤ k) | |
| 55 | - (hc : q*degree+1 ≤ c) (hn : degree ≤ c) : | |
| 56 | - L.neighborScaleCost m hm R S hS H τ hτ hτT P CM CH ≤ k^c*P.shear^c := by | |
| 57 | - have hconst := EulerParentNeighborCost.constant_pos | |
| 58 | - exact (L.neighborScaleCost_low_polynomial m hm R S hS H τ hτ hτT P Ti CM CH | |
| 59 | - hτ1 hTi hCM hCH ha hH).trans | |
| 60 | - (polynomial_le_monomial | |
| 61 | - (EulerParentNeighborCost.constant*(2*(1+CM+CH))^degree) | |
| 62 | - L.K Ti P.shear k P.shear degree q c (by positivity) | |
| 63 | - (zero_le_one.trans L.K_one) ((inv_pos.mpr hτ).le.trans hTi) | |
| 64 | - (zero_le_one.trans hH) hk hH hKk hTik le_rfl hcost hc hn) | |
| 65 | - | |
| 66 | -include hτ1 hTi hCM hCH ha hH in | |
| 67 | -theorem neighbor_error_of_source_scales (J D : ℕ) (X ρ : ℝ) (j q c : ℕ) | |
| 68 | - (hρ : 0 ≤ ρ) (hρ1 : ρ ≤ 1) | |
| 69 | - (hshear : P.shear=previousShear J X j) | |
| 70 | - (hk : 1 ≤ previousFrequency J D X j) | |
| 71 | - (hKk : L.K ≤ previousFrequency J D X j^q) (hTik : Ti ≤ previousFrequency J D X j^q) | |
| 72 | - (hcost : (EulerParentNeighborCost.constant*(2*(1+CM+CH))^degree)*4^degree ≤ | |
| 73 | - previousFrequency J D X j) | |
| 74 | - (hc : q*degree+1 ≤ c) (hn : degree ≤ c) | |
| 75 | - (hscale : G.ell ≤ supportScale J X j) : | |
| 76 | - L.neighborScaleCost m hm R S hS H τ hτ hτT P CM CH*G.ell*ρ ≤ | |
| 77 | - neighborError J D X (c : ℝ) j := by | |
| 78 | - have hbound := L.neighborScaleCost_monomial m hm R S hS H τ hτ hτT P Ti CM CH | |
| 79 | - hτ1 hTi hCM hCH ha hH (previousFrequency J D X j) q c hk hKk hTik hcost hc hn | |
| 80 | - have hmono : 0 ≤ previousFrequency J D X j^c*P.shear^c := | |
| 81 | - mul_nonneg (pow_nonneg (zero_le_one.trans hk) c) (pow_nonneg (zero_le_one.trans hH) c) | |
| 82 | - calc | |
| 83 | - _ ≤ (previousFrequency J D X j^c*P.shear^c)*G.ell*ρ := | |
| 84 | - mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hbound G.ell_pos.le) hρ | |
| 85 | - _ ≤ (previousFrequency J D X j^c*P.shear^c)*G.ell := by | |
| 86 | - simpa only [mul_one] using mul_le_mul_of_nonneg_left hρ1 (mul_nonneg hmono G.ell_pos.le) | |
| 87 | - _ ≤ (previousFrequency J D X j^c*P.shear^c)*supportScale J X j := | |
| 88 | - mul_le_mul_of_nonneg_left hscale hmono | |
| 89 | - _ = neighborError J D X (c : ℝ) j := by | |
| 90 | - simp only [neighborError,Real.rpow_natCast,hshear] | |
| 91 | - ring | |
| 92 | - | |
| 93 | -end EulerParentPacketFrames.LabelData | |
+0 −88 Euler/ParentPacketParameterCaps.lean deleted
| @@ -1,88 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketNeighborPolynomial | |
| 2 | -import Euler.PacketParameterEnvelope | |
| 3 | - | |
| 4 | -/-! Actual selected terminal coordinates and the canonical boundary | |
| 5 | -parameter have fixed polynomial caps. They are inputs to the uniform | |
| 6 | -normal-stage source envelope. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentPacketParameterCaps | |
| 11 | - | |
| 12 | -open Real EulerPacketParentLabelBounds EulerTransverseActivationSelection EulerMeanHarmonic | |
| 13 | - | |
| 14 | -def terminalConstant (CM CH : ℝ) : ℝ := | |
| 15 | - 8*(activationConstant CM CH+1)*(1+3*(1+embeddingCost)^2) | |
| 16 | - | |
| 17 | -theorem terminalConstant_nonneg (CM CH : ℝ) (hCH : 0 ≤ CH) : | |
| 18 | - 0 ≤ terminalConstant CM CH := by | |
| 19 | - unfold terminalConstant activationConstant | |
| 20 | - positivity | |
| 21 | - | |
| 22 | -def boundaryConstant (CM : ℝ) : ℝ := boundaryLocalizationC1*(CM+2)+1 | |
| 23 | - | |
| 24 | -theorem boundaryConstant_pos (CM : ℝ) (hCM : 0 ≤ CM) : 0 < boundaryConstant CM := by | |
| 25 | - unfold boundaryConstant | |
| 26 | - positivity [boundaryLocalizationC1_nonneg] | |
| 27 | - | |
| 28 | -theorem boundary_parameter_bound (CM Bc L X : ℝ) (hX : 1 ≤ X) | |
| 29 | - (hBc : Bc ≤ CM*X^1000+2) (hL : L=boundaryLocalizationC1*Bc+1) : | |
| 30 | - L ≤ boundaryConstant CM*X^1000 := by | |
| 31 | - have hp : 1 ≤ X^1000 := one_le_pow₀ hX | |
| 32 | - have hb : Bc ≤ (CM+2)*X^1000 := by linarith only [hBc,hp] | |
| 33 | - have h := mul_le_mul_of_nonneg_left hb boundaryLocalizationC1_nonneg | |
| 34 | - rw [hL] | |
| 35 | - unfold boundaryConstant | |
| 36 | - linarith only [h,hp] | |
| 37 | - | |
| 38 | -end EulerParentPacketParameterCaps | |
| 39 | - | |
| 40 | -namespace EulerParentPacketFrames.LabelData | |
| 41 | - | |
| 42 | -open Set EulerSmoothLimit EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 43 | - EulerPacketSourceGeometry EulerPacketParentLabelBounds EulerGevrey | |
| 44 | - EulerParentPacketParameterCaps EulerTransverseActivationSelection | |
| 45 | - | |
| 46 | -variable {A : Parent} (L : LabelData A) | |
| 47 | - {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 48 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 49 | - (support : Set Space) (hsupport : IsCompact support) | |
| 50 | - {τ : ℝ} {hτ : 0 < τ} {hτT : τ < A.T} | |
| 51 | - {P : ParentFrame (A.transverseData m hm R support hsupport) τ} | |
| 52 | - {H : HistoryData ((A.transverseData m hm R support hsupport).initial τ hτ hτT.le)} | |
| 53 | - (G : Guards hτ hτT P H) | |
| 54 | - | |
| 55 | -theorem selected_terminal_bound (hH : 1 ≤ P.shear) : | |
| 56 | - ‖G.terminal‖ ≤ terminalConstant G.CM G.CH*L.K^4 := by | |
| 57 | - let D := A.transverseData m hm R support hsupport | |
| 58 | - have hK0 := zero_le_one.trans L.K_one | |
| 59 | - have hF : ∀ t x, ‖D.F.field t x‖ ≤ frameAmplitude L.K := by | |
| 60 | - intro t x | |
| 61 | - change ‖A.frame.field t x‖ ≤ frameAmplitude L.K | |
| 62 | - have h := L.frame_scaled_bound 0 t x | |
| 63 | - simpa only [norm_iteratedFDeriv_zero,majorant,Nat.zero_add,Nat.factorial_zero, | |
| 64 | - Nat.cast_one,pow_zero,mul_one,one_pow] using h | |
| 65 | - have hInv := D.inverseBound_le_of_frame (frameAmplitude L.K) | |
| 66 | - (frameAmplitude_nonneg L.K) A.frame_det hF | |
| 67 | - have hK2 : 1 ≤ L.K^2 := one_le_pow₀ L.K_one | |
| 68 | - have hK4 : 1 ≤ L.K^4 := one_le_pow₀ L.K_one | |
| 69 | - have hEmb := embeddingCost_nonneg | |
| 70 | - have hFcap : frameAmplitude L.K ≤ (1+embeddingCost)*L.K^2 := by | |
| 71 | - unfold frameAmplitude gradientAmplitude | |
| 72 | - linarith only [hK2] | |
| 73 | - have hFsquare := pow_le_pow_left₀ (frameAmplitude_nonneg L.K) hFcap 2 | |
| 74 | - have hIcap : D.inverseBound ≤ (1+3*(1+embeddingCost)^2)*L.K^4 := by | |
| 75 | - linarith only [hInv,hFsquare,hK4] | |
| 76 | - have hAct : 0 ≤ 8*(activationConstant G.CM G.CH+1) := by | |
| 77 | - unfold activationConstant | |
| 78 | - positivity [G.CH_nonneg] | |
| 79 | - calc | |
| 80 | - _ ≤ P.terminalBound G.CM G.CH := G.terminal_properties.2.2.2.1 | |
| 81 | - _ ≤ 8*(activationConstant G.CM G.CH+1)*D.inverseBound := by | |
| 82 | - unfold ParentFrame.terminalBound | |
| 83 | - exact div_le_self (mul_nonneg hAct D.inverseBound_pos.le) hH | |
| 84 | - _ ≤ 8*(activationConstant G.CM G.CH+1)*((1+3*(1+embeddingCost)^2)*L.K^4) := | |
| 85 | - mul_le_mul_of_nonneg_left hIcap hAct | |
| 86 | - _ = _ := by unfold terminalConstant; ring | |
| 87 | - | |
| 88 | -end EulerParentPacketFrames.LabelData | |
+0 −85 Euler/ParentPacketPhysicalFrame.lean deleted
| @@ -1,85 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketGeometryFrame | |
| 2 | - | |
| 3 | -/-! The next source's center expansion follows from the actual physical | |
| 4 | -velocity update. Odd particle displacements fix the origin, and the two | |
| 5 | -literal velocity laws identify the source matrices there. -/ | |
| 6 | - | |
| 7 | -noncomputable section | |
| 8 | - | |
| 9 | -namespace EulerParentPacketFrames | |
| 10 | - | |
| 11 | -open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficients | |
| 12 | - EulerTransversePacketProvider EulerTransverseFrameCoordinates EulerVolterraConvolution | |
| 13 | - EulerPacketSourceGeometry | |
| 14 | -open scoped ContDiff | |
| 15 | - | |
| 16 | -namespace Parent | |
| 17 | - | |
| 18 | -variable (G : Parent) | |
| 19 | - | |
| 20 | -theorem position_zero_of_odd | |
| 21 | - (hodd : ∀ t, Function.Odd (G.displacement.field t : Space → Space)) | |
| 22 | - (t : Icc (0 : ℝ) G.T) : G.position t 0=0 := by | |
| 23 | - have hz : G.displacement.field t 0 = 0 := by | |
| 24 | - ext i | |
| 25 | - have h := congrArg (fun v : Space => v i) (hodd t 0) | |
| 26 | - simp only [neg_zero] at h | |
| 27 | - change (G.displacement.field t 0) i = -(G.displacement.field t 0) i at h | |
| 28 | - change (G.displacement.field t 0) i = 0 | |
| 29 | - linarith | |
| 30 | - simp only [position,hz,zero_add] | |
| 31 | - | |
| 32 | -variable (N : Parent) (hTime : N.T=G.T) | |
| 33 | - (u w : ℝ → Space → Space) | |
| 34 | - (hu : ∀ (t : Icc (0 : ℝ) G.T) x, DifferentiableAt ℝ (u t) x) | |
| 35 | - (hw : ∀ (t : Icc (0 : ℝ) N.T) x, DifferentiableAt ℝ (w t) x) | |
| 36 | - (hGvelocity : ∀ t x, G.velocity.field t x=u t (G.position t x)) | |
| 37 | - (hNvelocity : ∀ t x, N.velocity.field t x=u t (N.position t x)+w t (N.position t x)) | |
| 38 | - (hGodd : ∀ t, Function.Odd (G.displacement.field t : Space → Space)) | |
| 39 | - (hNodd : ∀ t, Function.Odd (N.displacement.field t : Space → Space)) | |
| 40 | - | |
| 41 | -include hTime hu hw hGvelocity hNvelocity hGodd hNodd | |
| 42 | - | |
| 43 | -theorem center_update_of_odd (t : Icc (0 : ℝ) N.T) : | |
| 44 | - N.strain.field t 0 = G.centerStrain t+fderiv ℝ (w t) 0 := by | |
| 45 | - let tg : Icc (0 : ℝ) G.T := ⟨t,by simpa only [hTime] using t.property⟩ | |
| 46 | - have hsum : ∀ (s : Icc (0 : ℝ) N.T) x, DifferentiableAt ℝ (fun y => u s y+w s y) x := by | |
| 47 | - intro s x | |
| 48 | - exact (hu ⟨s,by simpa only [hTime] using s.property⟩ x).add (hw s x) | |
| 49 | - have hn := N.strain_physical (fun s y => u s y+w s y) hsum hNvelocity t 0 | |
| 50 | - rw [smul_zero,N.position_zero_of_odd hNodd] at hn | |
| 51 | - have hg := G.strain_physical (fun s => u s) hu hGvelocity tg 0 | |
| 52 | - rw [smul_zero,G.position_zero_of_odd hGodd] at hg | |
| 53 | - have hb : G.centerStrain t=G.strain.field tg 0 := by | |
| 54 | - change G.strain.realField G.T G.T_pos.le (tg : ℝ) 0 = G.strain.field tg 0 | |
| 55 | - exact G.strain.realField_apply G.T G.T_pos.le tg 0 | |
| 56 | - rw [hn,hb,hg] | |
| 57 | - exact fderiv_fun_add (hu tg 0) (hw t 0) | |
| 58 | - | |
| 59 | -variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 60 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 61 | - (S : Set Space) (hS : IsCompact S) | |
| 62 | - {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 63 | - (mNew : Space) (hmNew : ‖mNew‖=1) (RNew : V ≃ₗᵢ[ℝ] referencePlane mNew) | |
| 64 | - (SNew : Set Space) (hSNew : IsCompact SNew) | |
| 65 | - | |
| 66 | -/-- Concrete old/new-parent factory. The source matrix split is derived | |
| 67 | -from the two physical velocity identities. The remaining quantitative | |
| 68 | -inputs are the preceding packet's center shear error and parent low | |
| 69 | -norm bounds, as used by the geometric induction. -/ | |
| 70 | -def geometryFrameOfPhysicalUpdate (τ : ℝ) (hτ : 0 ≤ τ) | |
| 71 | - (η : U) (hη : η ≠ 0) (c CM CH K error : ℝ) | |
| 72 | - (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 73 | - (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 74 | - (hM : ∀ t ∈ Icc τ N.T, ‖G.centerStrain t‖ ≤ CM) | |
| 75 | - (hH : ∀ t ∈ Icc τ N.T, ‖G.centerCurvature t‖ ≤ CH) | |
| 76 | - (hpacket : ∀ t ∈ Icc τ N.T, | |
| 77 | - ‖fderiv ℝ (w t) 0-c • rankOne ℝ (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t)‖ ≤ error) : | |
| 78 | - ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ := | |
| 79 | - G.geometryFrameOfCenterExpansion m hm R S hS | |
| 80 | - (N.transverseData mNew hmNew RNew SNew hSNew) hTime τ hτ η hη w c CM CH K error | |
| 81 | - hCM hK he hMK hHK hM hH | |
| 82 | - (G.center_update_of_odd N hTime u w hu hw hGvelocity hNvelocity hGodd hNodd) hpacket | |
| 83 | - | |
| 84 | -end Parent | |
| 85 | -end EulerParentPacketFrames | |
+0 −111 Euler/ParentPacketPrimaryCenter.lean deleted
| @@ -1,111 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketPhysicalFrame | |
| 2 | - | |
| 3 | -/-! The literal primary terms in source (20) initialize the next geometric | |
| 4 | -parent frame. The forward coordinate is prescribed; the joined coordinate | |
| 5 | -is the genuine stationary history trace and is proved nonzero. -/ | |
| 6 | - | |
| 7 | -noncomputable section | |
| 8 | - | |
| 9 | -namespace EulerParentPacketFrames | |
| 10 | - | |
| 11 | -open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerSpatialCutoffs | |
| 12 | - EulerTransversePacketProvider EulerTransverseFrameCoordinates EulerPacketSourceGeometry | |
| 13 | - EulerPeriodicProfile | |
| 14 | -open scoped ContDiff | |
| 15 | - | |
| 16 | -namespace Parent | |
| 17 | - | |
| 18 | -variable (G : Parent) | |
| 19 | - {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 20 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 21 | - (S : Set Space) (hS : IsCompact S) | |
| 22 | - | |
| 23 | -theorem forward_primary_center_term (η : U) (δ : ℝ) (hδ : 0 < δ) (α k : ℝ) | |
| 24 | - (t : Icc (0 : ℝ) G.T) (Y : Space → Space) (hY : Y 0=0) : | |
| 25 | - (α*deriv (profile δ) (k*⟪m,Y 0⟫_ℝ)) • | |
| 26 | - rankOne ℝ (EulerPacketForwardFactorization.canonicalVelocity | |
| 27 | - (G.transverseData m hm R S hS) η t (Y 0)) | |
| 28 | - ((G.transverseData m hm R S hS).normal.field t (Y 0)) = | |
| 29 | - (α/δ) • rankOne ℝ (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t) := by | |
| 30 | - rw [hY] | |
| 31 | - simp only [inner_zero_right,mul_zero,profile_deriv_zero δ hδ, | |
| 32 | - EulerPacketForwardFactorization.canonicalVelocity,innerCutoff_zero,one_smul,div_eq_mul_inv] | |
| 33 | - rw [G.source_normal_eq m hm R S hS] | |
| 34 | - rfl | |
| 35 | - | |
| 36 | -theorem joined_primary_center_term | |
| 37 | - (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 38 | - (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) | |
| 39 | - (ξ : U) (hcut : tsupport innerCutoff ⊆ S) | |
| 40 | - (δ : ℝ) (hδ : 0 < δ) (α k : ℝ) | |
| 41 | - (t : Icc (0 : ℝ) G.T) (Y : Space → Space) (hY : Y 0=0) : | |
| 42 | - (α*deriv (profile δ) (k*⟪m,Y 0⟫_ℝ)) • | |
| 43 | - rankOne ℝ (EulerPacketPrimaryFactorization.canonicalVelocity s hs hsT B ξ hcut t (Y 0)) | |
| 44 | - ((G.transverseData m hm R S hS).normal.field t (Y 0)) = | |
| 45 | - (α/δ) • rankOne ℝ | |
| 46 | - (G.sourceVelocity m hm R S hS (B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩) t) | |
| 47 | - (G.sourceNormal m t) := by | |
| 48 | - rw [hY] | |
| 49 | - simp only [inner_zero_right,mul_zero,profile_deriv_zero δ hδ,div_eq_mul_inv] | |
| 50 | - erw [EulerPacketPrimaryFactorization.canonicalVelocity_eq_cutoff_uncut, | |
| 51 | - innerCutoff_zero,one_smul,G.source_normal_eq m hm R S hS, | |
| 52 | - G.joined_sourceVelocity m hm R S hS] | |
| 53 | - | |
| 54 | -variable (N : Parent) (hTime : N.T=G.T) | |
| 55 | - (u w : ℝ → Space → Space) | |
| 56 | - (hu : ∀ (t : Icc (0 : ℝ) G.T) x, DifferentiableAt ℝ (u t) x) | |
| 57 | - (hw : ∀ (t : Icc (0 : ℝ) N.T) x, DifferentiableAt ℝ (w t) x) | |
| 58 | - (hGvelocity : ∀ t x, G.velocity.field t x=u t (G.position t x)) | |
| 59 | - (hNvelocity : ∀ t x, N.velocity.field t x=u t (N.position t x)+w t (N.position t x)) | |
| 60 | - (hGodd : ∀ t, Function.Odd (G.displacement.field t : Space → Space)) | |
| 61 | - (hNodd : ∀ t, Function.Odd (N.displacement.field t : Space → Space)) | |
| 62 | - {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 63 | - (mNew : Space) (hmNew : ‖mNew‖=1) (RNew : V ≃ₗᵢ[ℝ] referencePlane mNew) | |
| 64 | - (SNew : Set Space) (hSNew : IsCompact SNew) | |
| 65 | - (τ : ℝ) (hτ : 0 ≤ τ) | |
| 66 | - (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 67 | - (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 68 | - (hM : ∀ t ∈ Icc τ N.T, ‖G.centerStrain t‖ ≤ CM) | |
| 69 | - (hH : ∀ t ∈ Icc τ N.T, ‖G.centerCurvature t‖ ≤ CH) | |
| 70 | - (Y : Icc (0 : ℝ) G.T → Space → Space) (hY : ∀ t, Y t 0=0) | |
| 71 | - (δ : ℝ) (hδ : 0 < δ) (α k : ℝ) | |
| 72 | - | |
| 73 | -def forwardGeometryFrame (η : U) (hη : η ≠ 0) | |
| 74 | - (hsource20 : ∀ t : Icc (0 : ℝ) G.T, τ ≤ (t : ℝ) → | |
| 75 | - ‖fderiv ℝ (w t) 0-(α*deriv (profile δ) (k*⟪m,Y t 0⟫_ℝ)) • | |
| 76 | - rankOne ℝ (EulerPacketForwardFactorization.canonicalVelocity | |
| 77 | - (G.transverseData m hm R S hS) η t (Y t 0)) | |
| 78 | - ((G.transverseData m hm R S hS).normal.field t (Y t 0))‖ ≤ error) : | |
| 79 | - ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ := by | |
| 80 | - apply G.geometryFrameOfPhysicalUpdate N hTime u w hu hw hGvelocity hNvelocity hGodd hNodd | |
| 81 | - m hm R S hS mNew hmNew RNew SNew hSNew τ hτ η hη (α/δ) CM CH K error | |
| 82 | - hCM hK he hMK hHK hM hH | |
| 83 | - intro t ht | |
| 84 | - have htG : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 85 | - have h := hsource20 ⟨t,htG⟩ ht.1 | |
| 86 | - rw [G.forward_primary_center_term m hm R S hS η δ hδ α k ⟨t,htG⟩ (Y ⟨t,htG⟩) (hY _)] at h | |
| 87 | - exact h | |
| 88 | - | |
| 89 | -def joinedGeometryFrame | |
| 90 | - (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 91 | - (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) | |
| 92 | - (ξ : U) (hξ : ξ ≠ 0) (hcut : tsupport innerCutoff ⊆ S) | |
| 93 | - (hsource20 : ∀ t : Icc (0 : ℝ) G.T, τ ≤ (t : ℝ) → | |
| 94 | - ‖fderiv ℝ (w t) 0-(α*deriv (profile δ) (k*⟪m,Y t 0⟫_ℝ)) • | |
| 95 | - rankOne ℝ (EulerPacketPrimaryFactorization.canonicalVelocity s hs hsT B ξ hcut t (Y t 0)) | |
| 96 | - ((G.transverseData m hm R S hS).normal.field t (Y t 0))‖ ≤ error) : | |
| 97 | - ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ := by | |
| 98 | - apply G.geometryFrameOfPhysicalUpdate N hTime u w hu hw hGvelocity hNvelocity hGodd hNodd | |
| 99 | - m hm R S hS mNew hmNew RNew SNew hSNew τ hτ | |
| 100 | - (B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩) | |
| 101 | - (G.joined_initialCoordinate_ne_zero m hm R S hS s hs hsT B ξ hξ) (α/δ) CM CH K error | |
| 102 | - hCM hK he hMK hHK hM hH | |
| 103 | - intro t ht | |
| 104 | - have htG : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 105 | - have h := hsource20 ⟨t,htG⟩ ht.1 | |
| 106 | - rw [G.joined_primary_center_term m hm R S hS s hs hsT B ξ hcut δ hδ α k | |
| 107 | - ⟨t,htG⟩ (Y ⟨t,htG⟩) (hY _)] at h | |
| 108 | - exact h | |
| 109 | - | |
| 110 | -end Parent | |
| 111 | -end EulerParentPacketFrames | |
+0 −88 Euler/ParentPacketSobolevFields.lean deleted
| @@ -1,88 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketScaledBounds | |
| 2 | -import Euler.ParentParticleInverse | |
| 3 | -import Euler.PacketEulerianRegularity | |
| 4 | -import Euler.SmoothL2ScalingContinuity | |
| 5 | - | |
| 6 | -/-! Actual physical L² fields of a packet over a parent. The genuine | |
| 7 | -inverse and the proved parent label bound supply all reconstruction | |
| 8 | -regularity, and the physical spatial scale is retained exactly. -/ | |
| 9 | - | |
| 10 | -noncomputable section | |
| 11 | - | |
| 12 | -namespace EulerParentPacketFrames | |
| 13 | - | |
| 14 | -open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field | |
| 15 | - EulerPacketPhysicalField EulerAllOrderCorrectionData EulerPacketParentLabelBounds | |
| 16 | - EulerTransverseFrameCoordinates EulerGraphPressurePotential | |
| 17 | - | |
| 18 | -namespace ParticleInverse | |
| 19 | - | |
| 20 | -variable {A : Parent} (I : ParticleInverse A) | |
| 21 | - | |
| 22 | -theorem normalized_scaled (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 23 | - I.normalized t (A.ell⁻¹ • x)=A.ell⁻¹ • I.field t x := by | |
| 24 | - simp only [normalized,Parent.packetInverse,projIcc_of_mem A.T_pos.le t.property, | |
| 25 | - smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul] | |
| 26 | - | |
| 27 | -end ParticleInverse | |
| 28 | - | |
| 29 | -namespace LabelData | |
| 30 | - | |
| 31 | -variable {A : Parent} (L : LabelData A) (I : ParticleInverse A) | |
| 32 | - {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 33 | - (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 34 | - (support : Set Space) (hSupport : IsCompact support) | |
| 35 | - (P : ℝ) [Fact (0 < P)] (κ : ℝ) (Z : FieldTower P A.T) (k : ℝ) | |
| 36 | - | |
| 37 | -def packetVelocityField (t : Icc (0 : ℝ) A.T) : SmoothL2Field Space := | |
| 38 | - scaleField A.ell A.ell_pos | |
| 39 | - (eulerianSmoothField (A.transverseData m hm J support hSupport) P κ Z k | |
| 40 | - (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 41 | - I.normalized_left I.normalized_right I.normalized_continuous | |
| 42 | - L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 43 | - A.frame_det L.frame_scaled_bound t) | |
| 44 | - | |
| 45 | -def packetForceField (t : Icc (0 : ℝ) A.T) : SmoothL2Field Space := | |
| 46 | - scaleField A.ell A.ell_pos | |
| 47 | - (pressureForceSmoothField (A.transverseData m hm J support hSupport) P κ Z k | |
| 48 | - (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 49 | - I.normalized_left I.normalized_right I.normalized_continuous | |
| 50 | - L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 51 | - A.frame_det L.frame_scaled_bound t) | |
| 52 | - | |
| 53 | -theorem packetVelocityField_apply (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 54 | - (L.packetVelocityField I m hm J support hSupport P κ Z k t).field x = | |
| 55 | - A.ell • (κ • A.frame.field t (A.ell⁻¹ • I.field t x) | |
| 56 | - (Z.pointField t (cylinderGraph P k m (A.ell⁻¹ • I.field t x)))) := by | |
| 57 | - rw [packetVelocityField,scaleField_apply] | |
| 58 | - erw [eulerianSmoothField_apply,I.normalized_scaled] | |
| 59 | - rfl | |
| 60 | - | |
| 61 | -theorem packetForceField_apply (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 62 | - (L.packetForceField I m hm J support hSupport P κ Z k t).field x = | |
| 63 | - A.ell • (κ • (A.inverse.field t (A.ell⁻¹ • I.field t x)).adjoint | |
| 64 | - (Z.pointField t (cylinderGraph P k m (A.ell⁻¹ • I.field t x)))) := by | |
| 65 | - rw [packetForceField,scaleField_apply] | |
| 66 | - erw [pressureForceSmoothField_apply,I.normalized_scaled] | |
| 67 | - rfl | |
| 68 | - | |
| 69 | -theorem packetVelocityField_continuous (n : ℕ) : | |
| 70 | - Continuous (fun t => (L.packetVelocityField I m hm J support hSupport P κ Z k t).jetLp n) := | |
| 71 | - continuous_jetLp_scaleField A.ell A.ell_pos A.ell_le_one _ | |
| 72 | - (eulerianSmoothField_jetLp_continuous (A.transverseData m hm J support hSupport) P κ Z k | |
| 73 | - (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 74 | - I.normalized_left I.normalized_right I.normalized_continuous | |
| 75 | - L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 76 | - A.frame_det L.frame_scaled_bound) n | |
| 77 | - | |
| 78 | -theorem packetForceField_continuous (n : ℕ) : | |
| 79 | - Continuous (fun t => (L.packetForceField I m hm J support hSupport P κ Z k t).jetLp n) := | |
| 80 | - continuous_jetLp_scaleField A.ell A.ell_pos A.ell_le_one _ | |
| 81 | - (pressureForceSmoothField_jetLp_continuous (A.transverseData m hm J support hSupport) P κ Z k | |
| 82 | - (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 83 | - I.normalized_left I.normalized_right I.normalized_continuous | |
| 84 | - L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 85 | - A.frame_det L.frame_scaled_bound) n | |
| 86 | - | |
| 87 | -end LabelData | |
| 88 | -end EulerParentPacketFrames | |
+0 −36 Euler/ParentParticleRegularity.lean deleted
| @@ -1,36 +0,0 @@ | ||
| 1 | -import Euler.ParentParticleInverse | |
| 2 | -import Euler.ContinuousInverseDerivative | |
| 3 | -import Euler.GevreyInverseMap | |
| 4 | - | |
| 5 | -/-! Spatial smoothness of the actual physical particle inverse follows | |
| 6 | -from its inverse identities and the genuine determinant-one Jacobian. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentPacketFrames.ParticleInverse | |
| 11 | - | |
| 12 | -open Set EulerSmoothLimit EulerContinuousInverseDerivative EulerGevreyComposition | |
| 13 | -open scoped ContDiff | |
| 14 | - | |
| 15 | -variable {A : Parent} (I : ParticleInverse A) | |
| 16 | - | |
| 17 | -theorem hasFDerivAt (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 18 | - HasFDerivAt (I.field t) | |
| 19 | - (A.inverse.field t (A.ell⁻¹ • I.field t x)) x := by | |
| 20 | - apply hasFDerivAt_inverse (A.position t) (I.field t) x | |
| 21 | - (A.frame.field t (A.ell⁻¹ • I.field t x)) | |
| 22 | - (A.inverse.field t (A.ell⁻¹ • I.field t x)) | |
| 23 | - (I.continuous.uncurry_left t).continuousAt | |
| 24 | - · simpa only [smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul] using | |
| 25 | - A.position_frame t (A.ell⁻¹ • I.field t x) | |
| 26 | - · exact Filter.Eventually.of_forall (I.right_inverse t) | |
| 27 | - · exact A.inverse_left t (A.ell⁻¹ • I.field t x) | |
| 28 | - | |
| 29 | -theorem smooth (t : Icc (0 : ℝ) A.T) : ContDiff ℝ ∞ (I.field t) := by | |
| 30 | - apply contDiff_of_fderiv_eq_comp (I.field t) | |
| 31 | - (fun y => A.inverse.field t (A.ell⁻¹ • y)) | |
| 32 | - (fun x => (I.hasFDerivAt t x).differentiableAt) | |
| 33 | - · exact (A.inverse.smooth t).comp (contDiff_id.const_smul A.ell⁻¹) | |
| 34 | - · exact fun x => (I.hasFDerivAt t x).fderiv | |
| 35 | - | |
| 36 | -end EulerParentPacketFrames.ParticleInverse | |
+289 −4 Euler/ParentState.lean View file
| @@ -1,12 +1,297 @@ | ||
| 1 | -import Euler.ParentEulerSobolevChild | |
| 2 | -import Euler.ParentEulerParity | |
| 3 | -import Euler.ParentEulerEndpoints | |
| 4 | -import Euler.ParentPacketCorrectionParity | |
| 1 | +import Euler.ParentEulerChild | |
| 2 | +import Euler.ParentEulerSobolev | |
| 3 | +import Euler.ParentPacketScaledBounds | |
| 4 | +import Euler.ParentParticleInverse | |
| 5 | +import Euler.PacketEulerianRegularity | |
| 6 | +import Euler.SmoothL2ScalingContinuity | |
| 7 | +import Euler.ParentEulerState | |
| 8 | +import Euler.ParentPacketParity | |
| 9 | +import Euler.ParentPacketJoinedInput | |
| 10 | +import Euler.PacketLiftedParity | |
| 11 | +import Euler.PacketForwardInitializedCorrectionParity | |
| 5 | 12 | |
| 6 | 13 | /-! The recursive physical state consists of the actual Euler solution, |
| 7 | 14 | its all-order Sobolev fields, its particle-label bounds, and its symmetry. |
| 8 | 15 | Restriction and the exact packet construction preserve these data. -/ |
| 9 | 16 | |
| 17 | +/-! ## From `Euler/ParentPacketSobolevFields.lean` | |
| 18 | + | |
| 19 | +The text of `Euler/ParentPacketSobolevFields.lean`, folded into this file, which was its only importer. -/ | |
| 20 | + | |
| 21 | +section | |
| 22 | + | |
| 23 | +/-! Actual physical L² fields of a packet over a parent. The genuine | |
| 24 | +inverse and the proved parent label bound supply all reconstruction | |
| 25 | +regularity, and the physical spatial scale is retained exactly. -/ | |
| 26 | + | |
| 27 | +noncomputable section | |
| 28 | + | |
| 29 | +namespace EulerParentPacketFrames | |
| 30 | + | |
| 31 | +open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field | |
| 32 | + EulerPacketPhysicalField EulerAllOrderCorrectionData EulerPacketParentLabelBounds | |
| 33 | + EulerTransverseFrameCoordinates EulerGraphPressurePotential | |
| 34 | + | |
| 35 | +namespace ParticleInverse | |
| 36 | + | |
| 37 | +variable {A : Parent} (I : ParticleInverse A) | |
| 38 | + | |
| 39 | +theorem normalized_scaled (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 40 | + I.normalized t (A.ell⁻¹ • x)=A.ell⁻¹ • I.field t x := by | |
| 41 | + simp only [normalized,Parent.packetInverse,projIcc_of_mem A.T_pos.le t.property, | |
| 42 | + smul_smul,mul_inv_cancel₀ A.ell_pos.ne',one_smul] | |
| 43 | + | |
| 44 | +end ParticleInverse | |
| 45 | + | |
| 46 | +namespace LabelData | |
| 47 | + | |
| 48 | +variable {A : Parent} (L : LabelData A) (I : ParticleInverse A) | |
| 49 | + {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 50 | + (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 51 | + (support : Set Space) (hSupport : IsCompact support) | |
| 52 | + (P : ℝ) [Fact (0 < P)] (κ : ℝ) (Z : FieldTower P A.T) (k : ℝ) | |
| 53 | + | |
| 54 | +def packetVelocityField (t : Icc (0 : ℝ) A.T) : SmoothL2Field Space := | |
| 55 | + scaleField A.ell A.ell_pos | |
| 56 | + (eulerianSmoothField (A.transverseData m hm J support hSupport) P κ Z k | |
| 57 | + (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 58 | + I.normalized_left I.normalized_right I.normalized_continuous | |
| 59 | + L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 60 | + A.frame_det L.frame_scaled_bound t) | |
| 61 | + | |
| 62 | +def packetForceField (t : Icc (0 : ℝ) A.T) : SmoothL2Field Space := | |
| 63 | + scaleField A.ell A.ell_pos | |
| 64 | + (pressureForceSmoothField (A.transverseData m hm J support hSupport) P κ Z k | |
| 65 | + (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 66 | + I.normalized_left I.normalized_right I.normalized_continuous | |
| 67 | + L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 68 | + A.frame_det L.frame_scaled_bound t) | |
| 69 | + | |
| 70 | +theorem packetVelocityField_apply (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 71 | + (L.packetVelocityField I m hm J support hSupport P κ Z k t).field x = | |
| 72 | + A.ell • (κ • A.frame.field t (A.ell⁻¹ • I.field t x) | |
| 73 | + (Z.pointField t (cylinderGraph P k m (A.ell⁻¹ • I.field t x)))) := by | |
| 74 | + rw [packetVelocityField,scaleField_apply] | |
| 75 | + erw [eulerianSmoothField_apply,I.normalized_scaled] | |
| 76 | + rfl | |
| 77 | + | |
| 78 | +theorem packetForceField_apply (t : Icc (0 : ℝ) A.T) (x : Space) : | |
| 79 | + (L.packetForceField I m hm J support hSupport P κ Z k t).field x = | |
| 80 | + A.ell • (κ • (A.inverse.field t (A.ell⁻¹ • I.field t x)).adjoint | |
| 81 | + (Z.pointField t (cylinderGraph P k m (A.ell⁻¹ • I.field t x)))) := by | |
| 82 | + rw [packetForceField,scaleField_apply] | |
| 83 | + erw [pressureForceSmoothField_apply,I.normalized_scaled] | |
| 84 | + rfl | |
| 85 | + | |
| 86 | +theorem packetVelocityField_continuous (n : ℕ) : | |
| 87 | + Continuous (fun t => (L.packetVelocityField I m hm J support hSupport P κ Z k t).jetLp n) := | |
| 88 | + continuous_jetLp_scaleField A.ell A.ell_pos A.ell_le_one _ | |
| 89 | + (eulerianSmoothField_jetLp_continuous (A.transverseData m hm J support hSupport) P κ Z k | |
| 90 | + (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 91 | + I.normalized_left I.normalized_right I.normalized_continuous | |
| 92 | + L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 93 | + A.frame_det L.frame_scaled_bound) n | |
| 94 | + | |
| 95 | +theorem packetForceField_continuous (n : ℕ) : | |
| 96 | + Continuous (fun t => (L.packetForceField I m hm J support hSupport P κ Z k t).jetLp n) := | |
| 97 | + continuous_jetLp_scaleField A.ell A.ell_pos A.ell_le_one _ | |
| 98 | + (pressureForceSmoothField_jetLp_continuous (A.transverseData m hm J support hSupport) P κ Z k | |
| 99 | + (fun s x => A.packetPosition (s,x)) I.normalized A.packetPosition_spatial | |
| 100 | + I.normalized_left I.normalized_right I.normalized_continuous | |
| 101 | + L.scaledRadius (frameAmplitude L.K) L.scaledRadius_nonneg (frameAmplitude_nonneg L.K) | |
| 102 | + A.frame_det L.frame_scaled_bound) n | |
| 103 | + | |
| 104 | +end LabelData | |
| 105 | +end EulerParentPacketFrames | |
| 106 | +end | |
| 107 | + | |
| 108 | +end | |
| 109 | + | |
| 110 | +/-! ## From `Euler/ParentPacketCorrectionParity.lean` | |
| 111 | + | |
| 112 | +The text of `Euler/ParentPacketCorrectionParity.lean`, folded into this file, which was its only importer. -/ | |
| 113 | + | |
| 114 | +section | |
| 115 | + | |
| 116 | +/-! Actual odd parent fields supply the parity data for both initialized | |
| 117 | +packet branches. The resulting corrected coefficient, and hence the | |
| 118 | +actual next particle map, retain oddness without a new symmetry premise. -/ | |
| 119 | + | |
| 120 | +noncomputable section | |
| 121 | + | |
| 122 | +namespace EulerParentPacketFrames.OddData | |
| 123 | + | |
| 124 | +open Set EulerSmoothLimit EulerSpatialCutoffs EulerPacketTerminalDatum | |
| 125 | + EulerPacketCylinderField EulerPacketProfileRecursion EulerCorrectionAssembly | |
| 126 | + EulerTimeIntervalRestriction EulerGraphInvariantFlow EulerAllOrderCorrectionData | |
| 127 | + EulerAllOrderDriftCorrection | |
| 128 | + | |
| 129 | +variable {A : Parent} (O : OddData A) (H : LowBounds A) | |
| 130 | + {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 131 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) | |
| 132 | + (S : Set Space) (hS : IsCompact S) (hSym : ∀ x, -x ∈ S ↔ x ∈ S) | |
| 133 | + (δ : ℝ) (hδ : 0 < δ) (ξ : U) (hs : tsupport innerCutoff ⊆ S) (α : ℝ) | |
| 134 | + | |
| 135 | +include O hSym | |
| 136 | + | |
| 137 | +theorem forwardCorrectionParity (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : | |
| 138 | + ParityData period | |
| 139 | + (forwardInitializedCorrectionData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 140 | + δ hδ ξ hs α (A.sourceAgreement m hm R S hS H) N hN k hk) := | |
| 141 | + forwardInitializedCorrectionParityData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 142 | + δ hδ ξ hs α (O.meanEvenData H) hSym O.frame_even O.strain_even | |
| 143 | + (A.sourceAgreement m hm R S hS H) N hN k hk | |
| 144 | + | |
| 145 | +theorem joinedCorrectionParity (τ : ℝ) (hτ : 0 < τ) (hτT : τ < A.T) | |
| 146 | + (N : ℕ) (hN : 1 ≤ N) (k : ℝ) (hk : 4 ≤ k) : | |
| 147 | + ParityData period | |
| 148 | + (initializedCorrectionData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 149 | + τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α | |
| 150 | + (A.sourceAgreement m hm R S hS H) N hN k hk) := by | |
| 151 | + apply initializedCorrectionParityData (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 152 | + τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α | |
| 153 | + (O.meanEvenData H) hSym O.frame_even O.strain_even | |
| 154 | + _ (A.sourceAgreement m hm R S hS H) N hN k hk | |
| 155 | + intro t x | |
| 156 | + exact O.curvature_even (initialInclusion A.T τ hτT.le t) x | |
| 157 | + | |
| 158 | +omit hSym [CompleteSpace U] in | |
| 159 | +theorem childOfPacket {P : ℝ} [Fact (0 < P)] {C : EulerAllOrderCorrectionData.Data P A.T} | |
| 160 | + (B : Budget P A.T_pos C) (E : ParityData P C) | |
| 161 | + {raw : VectorField} (V : Field P A.T raw) (hV : C.approximation=V.toFieldTower) | |
| 162 | + (G : EulerPhysicalGraphFlowBounds.Data P A.T) (hG : G.A=B.liftedPacketCoefficient P V) | |
| 163 | + (k : ℝ) (hgraph : ∀ t z, graphConstraint k C.direction (G.A.field t z)=0) | |
| 164 | + (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) : | |
| 165 | + OddData (A.child G k C.direction hgraph nextEll hnext hnext1) := by | |
| 166 | + apply O.child G _ k C.direction hgraph nextEll hnext hnext1 | |
| 167 | + intro t | |
| 168 | + rw [hG] | |
| 169 | + exact B.liftedPacketCoefficient_odd P V hV E t | |
| 170 | + | |
| 171 | +end EulerParentPacketFrames.OddData | |
| 172 | +end | |
| 173 | + | |
| 174 | +end | |
| 175 | + | |
| 176 | +/-! ## From `Euler/ParentEulerSobolevChild.lean` | |
| 177 | + | |
| 178 | +The text of `Euler/ParentEulerSobolevChild.lean`, folded into this file, which was its only importer. -/ | |
| 179 | + | |
| 180 | +section | |
| 181 | + | |
| 182 | +/-! The constructed child Euler evolution remains in the actual | |
| 183 | +all-order spatial Sobolev class. Its fields are the parent fields plus | |
| 184 | +the very same exact packet used in the particle-map construction. -/ | |
| 185 | + | |
| 186 | +noncomputable section | |
| 187 | + | |
| 188 | +namespace EulerParentPacketFrames.SobolevData | |
| 189 | + | |
| 190 | +open Set EulerSmoothLimit EulerTransverseFrameCoordinates | |
| 191 | + EulerAllOrderCorrectionData EulerAllOrderDriftCorrection EulerPacketCorrectionCoefficients | |
| 192 | + EulerGraphInvariantFlow EulerLpTranslation EulerLpTranslation.SmoothL2Field | |
| 193 | + | |
| 194 | +variable {A : Parent} {E : Evolution A} (F : SobolevData E) (L : LabelData A) | |
| 195 | + {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] | |
| 196 | + (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 197 | + (support : Set Space) (hSupport : IsCompact support) | |
| 198 | + {P : ℝ} [Fact (0 < P)] {κ : ℝ} {hκ : |κ| ≤ 1} | |
| 199 | + {Z R : FieldTower P A.T} | |
| 200 | + (B : Budget P A.T_pos (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 201 | + (residual : ApproximationResidual P A.T_pos | |
| 202 | + (correctionData (A.transverseData m hm J support hSupport) P κ hκ Z R)) | |
| 203 | + {raw : EulerPacketProfileRecursion.VectorField} | |
| 204 | + (V : EulerPacketCylinderField.Field P A.T raw) (hV : Z=V.toFieldTower) | |
| 205 | + (G : EulerPhysicalGraphFlowBounds.Data P A.T) (hG : G.A=B.liftedPacketCoefficient P V) | |
| 206 | + (k : ℝ) (hk : k*κ=1) (hgraph : ∀ t q, graphConstraint k m (G.A.field t q)=0) | |
| 207 | + (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 208 | + | |
| 209 | +def child : SobolevData | |
| 210 | + (E.child m hm J support hSupport B residual V hV G hG k hk hgraph nextEll hnext hnext1) where | |
| 211 | + velocity t := addField (F.velocity t) | |
| 212 | + (L.packetVelocityField E.inverse m hm J support hSupport P κ | |
| 213 | + (exactPacketOfResidual P B residual).velocity k t) | |
| 214 | + force t := addField (F.force t) | |
| 215 | + (L.packetForceField E.inverse m hm J support hSupport P κ | |
| 216 | + (exactPacketOfResidual P B residual).pressure k t) | |
| 217 | + velocity_match t x := by | |
| 218 | + erw [Evolution.child_velocity,A.exactPacketVelocity_eq_corrected] | |
| 219 | + erw [addField_field,L.packetVelocityField_apply] | |
| 220 | + change E.velocity (t,x)+_=(F.velocity t).field x+_ | |
| 221 | + erw [F.velocity_match] | |
| 222 | + rfl | |
| 223 | + force_match t x := by | |
| 224 | + erw [Evolution.child_force] | |
| 225 | + erw [Parent.exactPacketForce,addField_field,F.force_match,L.packetForceField_apply] | |
| 226 | + simp only [ExactLiftedPacket.graphPressure,map_smul] | |
| 227 | + rfl | |
| 228 | + velocity_continuous := continuous_jetLp_addField _ _ F.velocity_continuous | |
| 229 | + (L.packetVelocityField_continuous E.inverse m hm J support hSupport P κ | |
| 230 | + (exactPacketOfResidual P B residual).velocity k) | |
| 231 | + force_continuous := continuous_jetLp_addField _ _ F.force_continuous | |
| 232 | + (L.packetForceField_continuous E.inverse m hm J support hSupport P κ | |
| 233 | + (exactPacketOfResidual P B residual).pressure k) | |
| 234 | + | |
| 235 | +end EulerParentPacketFrames.SobolevData | |
| 236 | +end | |
| 237 | + | |
| 238 | +end | |
| 239 | + | |
| 240 | +/-! ## From `Euler/ParentEulerParity.lean` | |
| 241 | + | |
| 242 | +The text of `Euler/ParentEulerParity.lean`, folded into this file, which was its only importer. -/ | |
| 243 | + | |
| 244 | +section | |
| 245 | + | |
| 246 | +/-! The physical velocity and pressure force inherit the genuine | |
| 247 | +particle symmetry, so their values vanish at the fixed origin. -/ | |
| 248 | + | |
| 249 | +noncomputable section | |
| 250 | + | |
| 251 | +namespace EulerParentPacketFrames.Evolution | |
| 252 | + | |
| 253 | +open Set EulerSmoothLimit | |
| 254 | + | |
| 255 | +variable {A : Parent} (E : Evolution A) (O : OddData A) | |
| 256 | + | |
| 257 | +include O | |
| 258 | + | |
| 259 | +theorem strain_origin (t : Icc (0 : ℝ) A.T) : | |
| 260 | + A.strain.field t 0=fderiv ℝ (fun y => E.velocity (t,y)) 0 := by | |
| 261 | + rw [E.strain_eq,smul_zero,O.position_zero] | |
| 262 | + | |
| 263 | +end EulerParentPacketFrames.Evolution | |
| 264 | +end | |
| 265 | + | |
| 266 | +end | |
| 267 | + | |
| 268 | +/-! ## From `Euler/ParentEulerEndpoints.lean` | |
| 269 | + | |
| 270 | +The text of `Euler/ParentEulerEndpoints.lean`, folded into this file, which was its only importer. -/ | |
| 271 | + | |
| 272 | +section | |
| 273 | + | |
| 274 | +/-! The physical gradient is continuous up to the endpoints in the | |
| 275 | +actual Sobolev class. Incompressibility therefore holds at time zero | |
| 276 | +and the final time as well as in the open Euler interval. -/ | |
| 277 | + | |
| 278 | +noncomputable section | |
| 279 | + | |
| 280 | +namespace EulerParentPacketFrames.SobolevData | |
| 281 | + | |
| 282 | +open Set EulerSmoothLimit EulerLpTranslation EulerLpTranslation.SmoothL2Field | |
| 283 | + EulerMeanSobolevBoundedField EulerMeanCoefficients | |
| 284 | +open scoped Topology | |
| 285 | + | |
| 286 | +variable {A : Parent} {E : Evolution A} (S : SobolevData E) | |
| 287 | + | |
| 288 | +include S | |
| 289 | + | |
| 290 | +end EulerParentPacketFrames.SobolevData | |
| 291 | +end | |
| 292 | + | |
| 293 | +end | |
| 294 | + | |
| 10 | 295 | noncomputable section |
| 11 | 296 | |
| 12 | 297 | namespace EulerParentPacketFrames |
+398 −1 Euler/ParentStateGeometry.lean View file
| @@ -1,10 +1,407 @@ | ||
| 1 | 1 | import Euler.ParentState |
| 2 | -import Euler.ParentPacketPrimaryCenter | |
| 2 | +import Euler.ParentPacketStrainEvolution | |
| 3 | +import Euler.ParentPacketHessianSymmetry | |
| 4 | +import Euler.PacketSourceGeometryData | |
| 5 | +import Euler.PacketForwardFactorization | |
| 3 | 6 | |
| 4 | 7 | /-! Geometric renewal between two actual Euler states. Their spatial |
| 5 | 8 | regularity, particle velocity laws and fixed origin are supplied by the |
| 6 | 9 | states themselves; only the quantitative packet expansion is an input. -/ |
| 7 | 10 | |
| 11 | +/-! ## From `Euler/ParentPacketGeometryFrame.lean` | |
| 12 | + | |
| 13 | +The text of `Euler/ParentPacketGeometryFrame.lean`, folded into this file, which was its only importer. -/ | |
| 14 | + | |
| 15 | +section | |
| 16 | + | |
| 17 | +/-! Actual parent source trajectories supply the older geometric frame. | |
| 18 | +Its matrix derivative is derived from the parent curvature, and its ray | |
| 19 | +and primary velocity are the constructed source trajectories. -/ | |
| 20 | + | |
| 21 | +noncomputable section | |
| 22 | + | |
| 23 | +namespace EulerParentPacketFrames | |
| 24 | + | |
| 25 | +open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficients | |
| 26 | + EulerTransversePacketProvider EulerTransverseFrameCoordinates EulerVolterraConvolution | |
| 27 | + EulerPacketSourceGeometry EulerPacketNormalizedPrimary EulerPacketMovingFrame | |
| 28 | + EulerPacketPrimaryShear EulerPacketRay | |
| 29 | +open scoped ContDiff | |
| 30 | + | |
| 31 | +namespace Parent | |
| 32 | + | |
| 33 | +variable (G : Parent) | |
| 34 | + | |
| 35 | +def sourceNormal (m : Space) (t : ℝ) : Space := | |
| 36 | + (G.inverse.realField G.T G.T_pos.le t 0).adjoint m | |
| 37 | + | |
| 38 | +theorem sourceNormal_apply (m : Space) (t : Icc (0 : ℝ) G.T) : | |
| 39 | + G.sourceNormal m t = (G.inverse.field t 0).adjoint m := by | |
| 40 | + simp only [sourceNormal,SmoothTimeField.realField_apply] | |
| 41 | + | |
| 42 | +theorem sourceNormal_equation (m : Space) (t : Icc (0 : ℝ) G.T) : | |
| 43 | + HasDerivWithinAt (G.sourceNormal m) | |
| 44 | + (-(G.centerStrain t).adjoint (G.sourceNormal m t)) (Icc (0 : ℝ) G.T) t := by | |
| 45 | + have h := (EulerTransverseBoundedFrame.normalMap m).hasFDerivAt.comp_hasDerivWithinAt | |
| 46 | + (t : ℝ) (G.inverse_time t 0) | |
| 47 | + change HasDerivWithinAt (G.sourceNormal m) ((G.inverseDerivative.field t 0).adjoint m) | |
| 48 | + (Icc (0 : ℝ) G.T) t at h | |
| 49 | + apply h.congr_deriv | |
| 50 | + rw [G.inverseDerivative_apply,G.sourceNormal_apply] | |
| 51 | + have hb : G.centerStrain t = G.strain.field t 0 := by | |
| 52 | + simp only [centerStrain,extendPath,projIcc_of_mem G.T_pos.le t.property] | |
| 53 | + rw [hb,G.strain_apply] | |
| 54 | + simp only [map_neg,adjoint_comp,neg_apply,comp_apply] | |
| 55 | + | |
| 56 | +theorem sourceNormal_ne_zero (m : Space) (hm : m ≠ 0) (t : Icc (0 : ℝ) G.T) : | |
| 57 | + G.sourceNormal m t ≠ 0 := by | |
| 58 | + have hi : (G.inverse.field t 0).comp (G.frame.field t 0) = ContinuousLinearMap.id ℝ Space := by | |
| 59 | + apply ContinuousLinearMap.ext | |
| 60 | + intro v | |
| 61 | + exact G.inverse_left t 0 v | |
| 62 | + have hc := congrArg (fun A : Space →L[ℝ] Space => A.adjoint m) hi | |
| 63 | + rw [adjoint_comp,comp_apply,adjoint_id,id_apply] at hc | |
| 64 | + intro hz | |
| 65 | + rw [← G.sourceNormal_apply m t,hz,map_zero] at hc | |
| 66 | + exact hm hc.symm | |
| 67 | + | |
| 68 | +variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 69 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 70 | + (S : Set Space) (hS : IsCompact S) | |
| 71 | + | |
| 72 | +def sourceVelocity (η : U) (t : ℝ) : Space := | |
| 73 | + EulerPacketForwardFactorization.uncutVelocity (G.transverseData m hm R S hS) η t 0 | |
| 74 | + | |
| 75 | +omit [CompleteSpace U] in | |
| 76 | +theorem source_normal_eq (t : Icc (0 : ℝ) G.T) : | |
| 77 | + (G.transverseData m hm R S hS).normal.field t 0 = G.sourceNormal m t := by | |
| 78 | + rw [G.sourceNormal_apply] | |
| 79 | + rfl | |
| 80 | + | |
| 81 | +omit [CompleteSpace U] in | |
| 82 | +theorem source_strain_eq (t : Icc (0 : ℝ) G.T) : | |
| 83 | + (G.transverseData m hm R S hS).M.field t 0 = G.centerStrain t := by | |
| 84 | + simp only [centerStrain,extendPath,projIcc_of_mem G.T_pos.le t.property] | |
| 85 | + rfl | |
| 86 | + | |
| 87 | +theorem sourceVelocity_equation (η : U) (t : Icc (0 : ℝ) G.T) : | |
| 88 | + HasDerivWithinAt (G.sourceVelocity m hm R S hS η) | |
| 89 | + (-(G.centerStrain t) (G.sourceVelocity m hm R S hS η t)+ | |
| 90 | + (2*⟪G.sourceNormal m t,(G.centerStrain t) (G.sourceVelocity m hm R S hS η t)⟫_ℝ/ | |
| 91 | + ‖G.sourceNormal m t‖^2) • G.sourceNormal m t) (Icc (0 : ℝ) G.T) t := by | |
| 92 | + have h := EulerPacketForwardFactorization.uncutVelocity_equation | |
| 93 | + (G.transverseData m hm R S hS) η t 0 | |
| 94 | + erw [EulerPacketPrimaryFactorization.physicalGenerator_apply, | |
| 95 | + G.source_normal_eq m hm R S hS,G.source_strain_eq m hm R S hS] at h | |
| 96 | + exact h | |
| 97 | + | |
| 98 | +theorem sourceVelocity_ne_zero (η : U) (hη : η ≠ 0) (t : Icc (0 : ℝ) G.T) : | |
| 99 | + G.sourceVelocity m hm R S hS η t ≠ 0 := | |
| 100 | + EulerPacketForwardFactorization.uncutVelocity_ne_zero (G.transverseData m hm R S hS) η hη t 0 | |
| 101 | + | |
| 102 | +theorem sourceVelocity_tangent (η : U) (t : Icc (0 : ℝ) G.T) : | |
| 103 | + ⟪G.sourceNormal m t,G.sourceVelocity m hm R S hS η t⟫_ℝ = 0 := by | |
| 104 | + rw [← G.source_normal_eq m hm R S hS] | |
| 105 | + exact EulerPacketForwardFactorization.uncutVelocity_tangent (G.transverseData m hm R S hS) η t 0 | |
| 106 | + | |
| 107 | +/-- Both primary branches are the same actual homogeneous propagator | |
| 108 | +after inserting their constructed initial coordinate. -/ | |
| 109 | +theorem joined_sourceVelocity (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 110 | + (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) (ξ : U) (t : ℝ) : | |
| 111 | + G.sourceVelocity m hm R S hS (B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩) t = | |
| 112 | + EulerPacketPrimaryFactorization.uncutVelocity s hs hsT B ξ t 0 := rfl | |
| 113 | + | |
| 114 | +theorem joined_initialCoordinate_ne_zero (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 115 | + (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) (ξ : U) (hξ : ξ ≠ 0) : | |
| 116 | + B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩ ≠ 0 := by | |
| 117 | + intro hz | |
| 118 | + have hn := EulerPacketPrimaryFactorization.uncutVelocity_ne_zero s hs hsT B ξ hξ | |
| 119 | + ⟨0,le_rfl,G.T_pos.le⟩ 0 | |
| 120 | + have hv := G.joined_sourceVelocity m hm R S hS s hs hsT B ξ 0 | |
| 121 | + rw [hz] at hv | |
| 122 | + have hv0 : G.sourceVelocity m hm R S hS 0 0 = 0 := by | |
| 123 | + unfold sourceVelocity | |
| 124 | + rw [EulerPacketForwardFactorization.uncutVelocity_initial,map_zero] | |
| 125 | + exact hn (hv.symm.trans hv0) | |
| 126 | + | |
| 127 | +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 128 | + (D : Data V) (hTime : D.T = G.T) (τ : ℝ) (hτ : 0 ≤ τ) | |
| 129 | + | |
| 130 | +/-- The only error input is the literal center derivative estimate for | |
| 131 | +the already constructed perturbation. No ray, velocity or matrix ODE | |
| 132 | +is supplied as a hypothesis. -/ | |
| 133 | +def geometryFrameOfCenterExpansion (η : U) (hη : η ≠ 0) | |
| 134 | + (w : ℝ → Space → Space) (c CM CH K error : ℝ) | |
| 135 | + (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 136 | + (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 137 | + (hM : ∀ t ∈ Icc τ D.T, ‖G.centerStrain t‖ ≤ CM) | |
| 138 | + (hH : ∀ t ∈ Icc τ D.T, ‖G.centerCurvature t‖ ≤ CH) | |
| 139 | + (hupdate : ∀ t : Icc (0 : ℝ) D.T, | |
| 140 | + D.M.field t 0 = G.centerStrain t+fderiv ℝ (w t) 0) | |
| 141 | + (hpacket : ∀ t ∈ Icc τ D.T, | |
| 142 | + ‖fderiv ℝ (w t) 0-c • rankOne ℝ (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t)‖ ≤ error) : | |
| 143 | + ParentFrame D τ where | |
| 144 | + B := G.centerStrain | |
| 145 | + B₁ := G.centerStrainDerivative | |
| 146 | + m := G.sourceNormal m | |
| 147 | + v := G.sourceVelocity m hm R S hS η | |
| 148 | + c := c | |
| 149 | + G := K | |
| 150 | + error := error | |
| 151 | + G_lower := hK | |
| 152 | + error_nonneg := he | |
| 153 | + B_derivative t ht := by | |
| 154 | + rw [hTime] at ht ⊢ | |
| 155 | + exact G.centerStrain_derivative τ hτ t ht | |
| 156 | + ray_equation t ht := by | |
| 157 | + have ht0 : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 158 | + exact (G.sourceNormal_equation m ⟨t,ht0⟩).mono | |
| 159 | + (fun r hr => ⟨hτ.trans hr.1,by simpa only [hTime] using hr.2⟩) | |
| 160 | + velocity_equation t ht := by | |
| 161 | + have ht0 : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 162 | + exact (G.sourceVelocity_equation m hm R S hS η ⟨t,ht0⟩).mono | |
| 163 | + (fun r hr => ⟨hτ.trans hr.1,by simpa only [hTime] using hr.2⟩) | |
| 164 | + ray_nonzero t ht := by | |
| 165 | + have hm0 : m ≠ 0 := by intro h; simp [h] at hm | |
| 166 | + exact G.sourceNormal_ne_zero m hm0 ⟨t,hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 167 | + velocity_nonzero t ht := | |
| 168 | + G.sourceVelocity_ne_zero m hm R S hS η hη ⟨t,hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 169 | + tangent t ht := | |
| 170 | + G.sourceVelocity_tangent m hm R S hS η ⟨t,hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 171 | + B_bound t ht := (hM t ht).trans hMK | |
| 172 | + B₁_bound t ht := by | |
| 173 | + rw [hTime] at hM hH ht | |
| 174 | + exact G.centerStrainDerivative_bound τ CM CH K hτ hCM hM hH hHK t ht | |
| 175 | + remainder_bound t ht := by | |
| 176 | + have htD : t ∈ Icc (0 : ℝ) D.T := ⟨hτ.trans ht.1,ht.2⟩ | |
| 177 | + have htG : t ∈ Icc (0 : ℝ) G.T := by simpa only [hTime] using htD | |
| 178 | + have hm0 : m ≠ 0 := by intro h; simp [h] at hm | |
| 179 | + have hn := G.sourceNormal_ne_zero m hm0 ⟨t,htG⟩ | |
| 180 | + have hv := G.sourceVelocity_ne_zero m hm R S hS η hη ⟨t,htG⟩ | |
| 181 | + have hc := rankOne_normalized c (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t) hv hn | |
| 182 | + have hu := hupdate ⟨t,htD⟩ | |
| 183 | + rw [show D.clamp t = ⟨t,htD⟩ from Data.clamp_coe D ⟨t,htD⟩,hu, | |
| 184 | + add_sub_cancel_left,primaryShear,← hc] | |
| 185 | + exact hpacket t ht | |
| 186 | + | |
| 187 | +end Parent | |
| 188 | +end EulerParentPacketFrames | |
| 189 | +end | |
| 190 | + | |
| 191 | +end | |
| 192 | + | |
| 193 | +/-! ## From `Euler/ParentPacketPhysicalFrame.lean` | |
| 194 | + | |
| 195 | +The text of `Euler/ParentPacketPhysicalFrame.lean`, folded into this file, which was its only importer. -/ | |
| 196 | + | |
| 197 | +section | |
| 198 | + | |
| 199 | +/-! The next source's center expansion follows from the actual physical | |
| 200 | +velocity update. Odd particle displacements fix the origin, and the two | |
| 201 | +literal velocity laws identify the source matrices there. -/ | |
| 202 | + | |
| 203 | +noncomputable section | |
| 204 | + | |
| 205 | +namespace EulerParentPacketFrames | |
| 206 | + | |
| 207 | +open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerMeanCoefficients | |
| 208 | + EulerTransversePacketProvider EulerTransverseFrameCoordinates EulerVolterraConvolution | |
| 209 | + EulerPacketSourceGeometry | |
| 210 | +open scoped ContDiff | |
| 211 | + | |
| 212 | +namespace Parent | |
| 213 | + | |
| 214 | +variable (G : Parent) | |
| 215 | + | |
| 216 | +theorem position_zero_of_odd | |
| 217 | + (hodd : ∀ t, Function.Odd (G.displacement.field t : Space → Space)) | |
| 218 | + (t : Icc (0 : ℝ) G.T) : G.position t 0=0 := by | |
| 219 | + have hz : G.displacement.field t 0 = 0 := by | |
| 220 | + ext i | |
| 221 | + have h := congrArg (fun v : Space => v i) (hodd t 0) | |
| 222 | + simp only [neg_zero] at h | |
| 223 | + change (G.displacement.field t 0) i = -(G.displacement.field t 0) i at h | |
| 224 | + change (G.displacement.field t 0) i = 0 | |
| 225 | + linarith | |
| 226 | + simp only [position,hz,zero_add] | |
| 227 | + | |
| 228 | +variable (N : Parent) (hTime : N.T=G.T) | |
| 229 | + (u w : ℝ → Space → Space) | |
| 230 | + (hu : ∀ (t : Icc (0 : ℝ) G.T) x, DifferentiableAt ℝ (u t) x) | |
| 231 | + (hw : ∀ (t : Icc (0 : ℝ) N.T) x, DifferentiableAt ℝ (w t) x) | |
| 232 | + (hGvelocity : ∀ t x, G.velocity.field t x=u t (G.position t x)) | |
| 233 | + (hNvelocity : ∀ t x, N.velocity.field t x=u t (N.position t x)+w t (N.position t x)) | |
| 234 | + (hGodd : ∀ t, Function.Odd (G.displacement.field t : Space → Space)) | |
| 235 | + (hNodd : ∀ t, Function.Odd (N.displacement.field t : Space → Space)) | |
| 236 | + | |
| 237 | +include hTime hu hw hGvelocity hNvelocity hGodd hNodd | |
| 238 | + | |
| 239 | +theorem center_update_of_odd (t : Icc (0 : ℝ) N.T) : | |
| 240 | + N.strain.field t 0 = G.centerStrain t+fderiv ℝ (w t) 0 := by | |
| 241 | + let tg : Icc (0 : ℝ) G.T := ⟨t,by simpa only [hTime] using t.property⟩ | |
| 242 | + have hsum : ∀ (s : Icc (0 : ℝ) N.T) x, DifferentiableAt ℝ (fun y => u s y+w s y) x := by | |
| 243 | + intro s x | |
| 244 | + exact (hu ⟨s,by simpa only [hTime] using s.property⟩ x).add (hw s x) | |
| 245 | + have hn := N.strain_physical (fun s y => u s y+w s y) hsum hNvelocity t 0 | |
| 246 | + rw [smul_zero,N.position_zero_of_odd hNodd] at hn | |
| 247 | + have hg := G.strain_physical (fun s => u s) hu hGvelocity tg 0 | |
| 248 | + rw [smul_zero,G.position_zero_of_odd hGodd] at hg | |
| 249 | + have hb : G.centerStrain t=G.strain.field tg 0 := by | |
| 250 | + change G.strain.realField G.T G.T_pos.le (tg : ℝ) 0 = G.strain.field tg 0 | |
| 251 | + exact G.strain.realField_apply G.T G.T_pos.le tg 0 | |
| 252 | + rw [hn,hb,hg] | |
| 253 | + exact fderiv_fun_add (hu tg 0) (hw t 0) | |
| 254 | + | |
| 255 | +variable {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 256 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 257 | + (S : Set Space) (hS : IsCompact S) | |
| 258 | + {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 259 | + (mNew : Space) (hmNew : ‖mNew‖=1) (RNew : V ≃ₗᵢ[ℝ] referencePlane mNew) | |
| 260 | + (SNew : Set Space) (hSNew : IsCompact SNew) | |
| 261 | + | |
| 262 | +/-- Concrete old/new-parent factory. The source matrix split is derived | |
| 263 | +from the two physical velocity identities. The remaining quantitative | |
| 264 | +inputs are the preceding packet's center shear error and parent low | |
| 265 | +norm bounds, as used by the geometric induction. -/ | |
| 266 | +def geometryFrameOfPhysicalUpdate (τ : ℝ) (hτ : 0 ≤ τ) | |
| 267 | + (η : U) (hη : η ≠ 0) (c CM CH K error : ℝ) | |
| 268 | + (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 269 | + (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 270 | + (hM : ∀ t ∈ Icc τ N.T, ‖G.centerStrain t‖ ≤ CM) | |
| 271 | + (hH : ∀ t ∈ Icc τ N.T, ‖G.centerCurvature t‖ ≤ CH) | |
| 272 | + (hpacket : ∀ t ∈ Icc τ N.T, | |
| 273 | + ‖fderiv ℝ (w t) 0-c • rankOne ℝ (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t)‖ ≤ error) : | |
| 274 | + ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ := | |
| 275 | + G.geometryFrameOfCenterExpansion m hm R S hS | |
| 276 | + (N.transverseData mNew hmNew RNew SNew hSNew) hTime τ hτ η hη w c CM CH K error | |
| 277 | + hCM hK he hMK hHK hM hH | |
| 278 | + (G.center_update_of_odd N hTime u w hu hw hGvelocity hNvelocity hGodd hNodd) hpacket | |
| 279 | + | |
| 280 | +end Parent | |
| 281 | +end EulerParentPacketFrames | |
| 282 | +end | |
| 283 | + | |
| 284 | +end | |
| 285 | + | |
| 286 | +/-! ## From `Euler/ParentPacketPrimaryCenter.lean` | |
| 287 | + | |
| 288 | +The text of `Euler/ParentPacketPrimaryCenter.lean`, folded into this file, which was its only importer. -/ | |
| 289 | + | |
| 290 | +section | |
| 291 | + | |
| 292 | +/-! The literal primary terms in source (20) initialize the next geometric | |
| 293 | +parent frame. The forward coordinate is prescribed; the joined coordinate | |
| 294 | +is the genuine stationary history trace and is proved nonzero. -/ | |
| 295 | + | |
| 296 | +noncomputable section | |
| 297 | + | |
| 298 | +namespace EulerParentPacketFrames | |
| 299 | + | |
| 300 | +open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit EulerSpatialCutoffs | |
| 301 | + EulerTransversePacketProvider EulerTransverseFrameCoordinates EulerPacketSourceGeometry | |
| 302 | + EulerPeriodicProfile | |
| 303 | +open scoped ContDiff | |
| 304 | + | |
| 305 | +namespace Parent | |
| 306 | + | |
| 307 | +variable (G : Parent) | |
| 308 | + {U : Type*} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 309 | + (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 310 | + (S : Set Space) (hS : IsCompact S) | |
| 311 | + | |
| 312 | +theorem forward_primary_center_term (η : U) (δ : ℝ) (hδ : 0 < δ) (α k : ℝ) | |
| 313 | + (t : Icc (0 : ℝ) G.T) (Y : Space → Space) (hY : Y 0=0) : | |
| 314 | + (α*deriv (profile δ) (k*⟪m,Y 0⟫_ℝ)) • | |
| 315 | + rankOne ℝ (EulerPacketForwardFactorization.canonicalVelocity | |
| 316 | + (G.transverseData m hm R S hS) η t (Y 0)) | |
| 317 | + ((G.transverseData m hm R S hS).normal.field t (Y 0)) = | |
| 318 | + (α/δ) • rankOne ℝ (G.sourceVelocity m hm R S hS η t) (G.sourceNormal m t) := by | |
| 319 | + rw [hY] | |
| 320 | + simp only [inner_zero_right,mul_zero,profile_deriv_zero δ hδ, | |
| 321 | + EulerPacketForwardFactorization.canonicalVelocity,innerCutoff_zero,one_smul,div_eq_mul_inv] | |
| 322 | + rw [G.source_normal_eq m hm R S hS] | |
| 323 | + rfl | |
| 324 | + | |
| 325 | +theorem joined_primary_center_term | |
| 326 | + (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 327 | + (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) | |
| 328 | + (ξ : U) (hcut : tsupport innerCutoff ⊆ S) | |
| 329 | + (δ : ℝ) (hδ : 0 < δ) (α k : ℝ) | |
| 330 | + (t : Icc (0 : ℝ) G.T) (Y : Space → Space) (hY : Y 0=0) : | |
| 331 | + (α*deriv (profile δ) (k*⟪m,Y 0⟫_ℝ)) • | |
| 332 | + rankOne ℝ (EulerPacketPrimaryFactorization.canonicalVelocity s hs hsT B ξ hcut t (Y 0)) | |
| 333 | + ((G.transverseData m hm R S hS).normal.field t (Y 0)) = | |
| 334 | + (α/δ) • rankOne ℝ | |
| 335 | + (G.sourceVelocity m hm R S hS (B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩) t) | |
| 336 | + (G.sourceNormal m t) := by | |
| 337 | + rw [hY] | |
| 338 | + simp only [inner_zero_right,mul_zero,profile_deriv_zero δ hδ,div_eq_mul_inv] | |
| 339 | + erw [EulerPacketPrimaryFactorization.canonicalVelocity_eq_cutoff_uncut, | |
| 340 | + innerCutoff_zero,one_smul,G.source_normal_eq m hm R S hS, | |
| 341 | + G.joined_sourceVelocity m hm R S hS] | |
| 342 | + | |
| 343 | +variable (N : Parent) (hTime : N.T=G.T) | |
| 344 | + (u w : ℝ → Space → Space) | |
| 345 | + (hu : ∀ (t : Icc (0 : ℝ) G.T) x, DifferentiableAt ℝ (u t) x) | |
| 346 | + (hw : ∀ (t : Icc (0 : ℝ) N.T) x, DifferentiableAt ℝ (w t) x) | |
| 347 | + (hGvelocity : ∀ t x, G.velocity.field t x=u t (G.position t x)) | |
| 348 | + (hNvelocity : ∀ t x, N.velocity.field t x=u t (N.position t x)+w t (N.position t x)) | |
| 349 | + (hGodd : ∀ t, Function.Odd (G.displacement.field t : Space → Space)) | |
| 350 | + (hNodd : ∀ t, Function.Odd (N.displacement.field t : Space → Space)) | |
| 351 | + {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 352 | + (mNew : Space) (hmNew : ‖mNew‖=1) (RNew : V ≃ₗᵢ[ℝ] referencePlane mNew) | |
| 353 | + (SNew : Set Space) (hSNew : IsCompact SNew) | |
| 354 | + (τ : ℝ) (hτ : 0 ≤ τ) | |
| 355 | + (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 356 | + (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 357 | + (hM : ∀ t ∈ Icc τ N.T, ‖G.centerStrain t‖ ≤ CM) | |
| 358 | + (hH : ∀ t ∈ Icc τ N.T, ‖G.centerCurvature t‖ ≤ CH) | |
| 359 | + (Y : Icc (0 : ℝ) G.T → Space → Space) (hY : ∀ t, Y t 0=0) | |
| 360 | + (δ : ℝ) (hδ : 0 < δ) (α k : ℝ) | |
| 361 | + | |
| 362 | +def forwardGeometryFrame (η : U) (hη : η ≠ 0) | |
| 363 | + (hsource20 : ∀ t : Icc (0 : ℝ) G.T, τ ≤ (t : ℝ) → | |
| 364 | + ‖fderiv ℝ (w t) 0-(α*deriv (profile δ) (k*⟪m,Y t 0⟫_ℝ)) • | |
| 365 | + rankOne ℝ (EulerPacketForwardFactorization.canonicalVelocity | |
| 366 | + (G.transverseData m hm R S hS) η t (Y t 0)) | |
| 367 | + ((G.transverseData m hm R S hS).normal.field t (Y t 0))‖ ≤ error) : | |
| 368 | + ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ := by | |
| 369 | + apply G.geometryFrameOfPhysicalUpdate N hTime u w hu hw hGvelocity hNvelocity hGodd hNodd | |
| 370 | + m hm R S hS mNew hmNew RNew SNew hSNew τ hτ η hη (α/δ) CM CH K error | |
| 371 | + hCM hK he hMK hHK hM hH | |
| 372 | + intro t ht | |
| 373 | + have htG : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 374 | + have h := hsource20 ⟨t,htG⟩ ht.1 | |
| 375 | + rw [G.forward_primary_center_term m hm R S hS η δ hδ α k ⟨t,htG⟩ (Y ⟨t,htG⟩) (hY _)] at h | |
| 376 | + exact h | |
| 377 | + | |
| 378 | +def joinedGeometryFrame | |
| 379 | + (s : ℝ) (hs : 0 < s) (hsT : s < G.T) | |
| 380 | + (B : HistoryData ((G.transverseData m hm R S hS).initial s hs hsT.le)) | |
| 381 | + (ξ : U) (hξ : ξ ≠ 0) (hcut : tsupport innerCutoff ⊆ S) | |
| 382 | + (hsource20 : ∀ t : Icc (0 : ℝ) G.T, τ ≤ (t : ℝ) → | |
| 383 | + ‖fderiv ℝ (w t) 0-(α*deriv (profile δ) (k*⟪m,Y t 0⟫_ℝ)) • | |
| 384 | + rankOne ℝ (EulerPacketPrimaryFactorization.canonicalVelocity s hs hsT B ξ hcut t (Y t 0)) | |
| 385 | + ((G.transverseData m hm R S hS).normal.field t (Y t 0))‖ ≤ error) : | |
| 386 | + ParentFrame (N.transverseData mNew hmNew RNew SNew hSNew) τ := by | |
| 387 | + apply G.geometryFrameOfPhysicalUpdate N hTime u w hu hw hGvelocity hNvelocity hGodd hNodd | |
| 388 | + m hm R S hS mNew hmNew RNew SNew hSNew τ hτ | |
| 389 | + (B.coefficients.labelCoordinate 0 ξ ⟨0,le_rfl,hs.le⟩) | |
| 390 | + (G.joined_initialCoordinate_ne_zero m hm R S hS s hs hsT B ξ hξ) (α/δ) CM CH K error | |
| 391 | + hCM hK he hMK hHK hM hH | |
| 392 | + intro t ht | |
| 393 | + have htG : t ∈ Icc (0 : ℝ) G.T := ⟨hτ.trans ht.1,by simpa only [hTime] using ht.2⟩ | |
| 394 | + have h := hsource20 ⟨t,htG⟩ ht.1 | |
| 395 | + rw [G.joined_primary_center_term m hm R S hS s hs hsT B ξ hcut δ hδ α k | |
| 396 | + ⟨t,htG⟩ (Y ⟨t,htG⟩) (hY _)] at h | |
| 397 | + exact h | |
| 398 | + | |
| 399 | +end Parent | |
| 400 | +end EulerParentPacketFrames | |
| 401 | +end | |
| 402 | + | |
| 403 | +end | |
| 404 | + | |
| 8 | 405 | noncomputable section |
| 9 | 406 | |
| 10 | 407 | namespace EulerParentPacketFrames.SmoothState |
+0 −130 Euler/ParentTargetRenewal.lean deleted
| @@ -1,130 +0,0 @@ | ||
| 1 | -import Euler.ParentRenewalParameters | |
| 2 | -import Euler.PacketForwardGeometryLowBounds | |
| 3 | - | |
| 4 | -/-! The geometric target of the actual forward or joined primary is the | |
| 5 | -activation time of the next parent frame. These factories are the checked | |
| 6 | -`SmoothState` renewals with the source-selected amplitude and primary; | |
| 7 | -all target matching is proved from their definitions. -/ | |
| 8 | - | |
| 9 | -noncomputable section | |
| 10 | - | |
| 11 | -namespace EulerParentPacketFrames.SmoothState | |
| 12 | - | |
| 13 | -open Set InnerProductSpace ContinuousLinearMap EulerSmoothLimit | |
| 14 | - EulerTransverseFrameCoordinates EulerTransversePacketProvider | |
| 15 | - EulerPacketSourceGeometry EulerSpatialCutoffs EulerPeriodicProfile | |
| 16 | - EulerPacketMovingFrame EulerPacketNormalizedPrimary | |
| 17 | - | |
| 18 | -variable {A N : Parent} (S : SmoothState A) (T : SmoothState N) (hTime : N.T=A.T) | |
| 19 | - {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 20 | - (m : Space) (hm : ‖m‖=1) (J : U ≃ₗᵢ[ℝ] referencePlane m) | |
| 21 | - (support : Set Space) (hSupport : IsCompact support) | |
| 22 | - {V : Type} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | |
| 23 | - (mNext : Space) (hmNext : ‖mNext‖=1) (JNext : V ≃ₗᵢ[ℝ] referencePlane mNext) | |
| 24 | - (supportNext : Set Space) (hSupportNext : IsCompact supportNext) | |
| 25 | - | |
| 26 | -local notation "D" => A.transverseData m hm J support hSupport | |
| 27 | -local notation "DNext" => N.transverseData mNext hmNext JNext supportNext hSupportNext | |
| 28 | - | |
| 29 | -section Forward | |
| 30 | - | |
| 31 | -variable {P : ParentFrame (A.transverseData m hm J support hSupport) 0} (G : ForwardGuards P) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 32 | - | |
| 33 | -local notation "Geo" => ForwardGuards.lowGeometry G hball | |
| 34 | -local notation "tNext" => PhysicalGeometryData.targetTime (ForwardGuards.lowGeometry G hball) | |
| 35 | - | |
| 36 | -variable (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 37 | - (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 38 | - (hM : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerStrain t‖ ≤ CM) | |
| 39 | - (hH : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerCurvature t‖ ≤ CH) | |
| 40 | - (hδ : 0 < G.δ) (k : ℝ) | |
| 41 | - (hsource : ∀ t : Icc (0 : ℝ) A.T, (G.lowGeometry hball).targetTime ≤ (t : ℝ) → | |
| 42 | - ‖fderiv ℝ (S.velocityIncrement T t) 0- | |
| 43 | - (G.primaryAmplitude hball*deriv (profile G.δ) | |
| 44 | - (k*⟪m,S.evolution.inverse.normalized t 0⟫_ℝ)) • | |
| 45 | - rankOne ℝ (EulerPacketForwardFactorization.canonicalVelocity | |
| 46 | - (A.transverseData m hm J support hSupport) G.initialCoordinate t (S.evolution.inverse.normalized t 0)) | |
| 47 | - ((A.transverseData m hm J support hSupport).normal.field t (S.evolution.inverse.normalized t 0))‖ ≤ error) | |
| 48 | - | |
| 49 | -/-- The next actual frame, using exactly the forward source primary and | |
| 50 | -its target-normalized amplitude. -/ | |
| 51 | -def forwardTargetRenewal : ParentFrame DNext tNext := | |
| 52 | - S.forwardRenewal T hTime m hm J support hSupport | |
| 53 | - mNext hmNext JNext supportNext hSupportNext | |
| 54 | - tNext ((G.lowGeometry hball).target_time_mem).1 CM CH K error | |
| 55 | - hCM hK he hMK hHK hM hH G.δ hδ (G.primaryAmplitude hball) k | |
| 56 | - G.initialCoordinate G.initialCoordinate_ne_zero hsource | |
| 57 | - | |
| 58 | -local notation "Q" => forwardTargetRenewal S T hTime m hm J support hSupport | |
| 59 | - mNext hmNext JNext supportNext hSupportNext G hball CM CH K error | |
| 60 | - hCM hK he hMK hHK hM hH hδ k hsource | |
| 61 | - | |
| 62 | -/-- In particular, the new ray and primary are the old source's actual | |
| 63 | -physical ray and primary at the target, not freely chosen frame vectors. -/ | |
| 64 | -theorem forwardTargetRenewal_matches : RenewalAtTarget Geo Q := by | |
| 65 | - let t : Icc (0 : ℝ) A.T := ⟨tNext,(G.lowGeometry hball).target_time_mem⟩ | |
| 66 | - constructor | |
| 67 | - · change A.centerStrain t = (D).M.field ((D).clamp (t : ℝ)) 0 | |
| 68 | - rw [Data.clamp_coe D t] | |
| 69 | - exact (A.source_strain_eq m hm J support hSupport t).symm | |
| 70 | - · change A.sourceNormal m t = (D).normal.field ((D).clamp (t : ℝ)) 0 | |
| 71 | - rw [Data.clamp_coe D t] | |
| 72 | - exact (A.source_normal_eq m hm J support hSupport t).symm | |
| 73 | - · rfl | |
| 74 | - · rfl | |
| 75 | - | |
| 76 | -end Forward | |
| 77 | - | |
| 78 | -section Joined | |
| 79 | - | |
| 80 | -variable (s : ℝ) (hs : 0 < s) (hsT : s < A.T) | |
| 81 | - (H : HistoryData ((A.transverseData m hm J support hSupport).initial s hs hsT.le)) | |
| 82 | - {P : ParentFrame (A.transverseData m hm J support hSupport) s} | |
| 83 | - (G : Guards hs hsT P H) (hball : (1/2 : ℝ) ≤ G.radius) | |
| 84 | - (hcut : tsupport innerCutoff ⊆ support) | |
| 85 | - | |
| 86 | -local notation "Geo" => Guards.lowGeometry G hball | |
| 87 | -local notation "tNext" => PhysicalGeometryData.targetTime (Guards.lowGeometry G hball) | |
| 88 | - | |
| 89 | -variable (CM CH K error : ℝ) (hCM : 0 ≤ CM) (hK : 1 ≤ K) (he : 0 ≤ error) | |
| 90 | - (hMK : CM ≤ K) (hHK : CM^2+CH ≤ K^2) | |
| 91 | - (hM : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerStrain t‖ ≤ CM) | |
| 92 | - (hH : ∀ t ∈ Icc (G.lowGeometry hball).targetTime N.T, ‖A.centerCurvature t‖ ≤ CH) | |
| 93 | - (hδ : 0 < G.δ) (k : ℝ) | |
| 94 | - (hsource : ∀ t : Icc (0 : ℝ) A.T, (G.lowGeometry hball).targetTime ≤ (t : ℝ) → | |
| 95 | - ‖fderiv ℝ (S.velocityIncrement T t) 0- | |
| 96 | - (G.primaryAmplitude hball*deriv (profile G.δ) | |
| 97 | - (k*⟪m,S.evolution.inverse.normalized t 0⟫_ℝ)) • | |
| 98 | - rankOne ℝ (EulerPacketPrimaryFactorization.canonicalVelocity | |
| 99 | - s hs hsT H G.terminal hcut t (S.evolution.inverse.normalized t 0)) | |
| 100 | - ((A.transverseData m hm J support hSupport).normal.field t (S.evolution.inverse.normalized t 0))‖ ≤ error) | |
| 101 | - | |
| 102 | -/-- The joined renewal retains the activation-selected endpoint and | |
| 103 | -its actual stationary-history initial trace. -/ | |
| 104 | -def joinedTargetRenewal : ParentFrame DNext tNext := | |
| 105 | - S.joinedRenewal T hTime m hm J support hSupport | |
| 106 | - mNext hmNext JNext supportNext hSupportNext | |
| 107 | - tNext (hs.le.trans ((G.lowGeometry hball).target_time_mem).1) CM CH K error | |
| 108 | - hCM hK he hMK hHK hM hH G.δ hδ (G.primaryAmplitude hball) k | |
| 109 | - s hs hsT H G.terminal G.terminal_properties.1 hcut hsource | |
| 110 | - | |
| 111 | -local notation "Q" => joinedTargetRenewal S T hTime m hm J support hSupport | |
| 112 | - mNext hmNext JNext supportNext hSupportNext s hs hsT H G hball hcut CM CH K error | |
| 113 | - hCM hK he hMK hHK hM hH hδ k hsource | |
| 114 | - | |
| 115 | -theorem joinedTargetRenewal_matches : RenewalAtTarget Geo Q := by | |
| 116 | - let t : Icc (0 : ℝ) A.T := | |
| 117 | - ⟨tNext,hs.le.trans ((G.lowGeometry hball).target_time_mem).1, | |
| 118 | - ((G.lowGeometry hball).target_time_mem).2⟩ | |
| 119 | - constructor | |
| 120 | - · change A.centerStrain t = (D).M.field ((D).clamp (t : ℝ)) 0 | |
| 121 | - rw [Data.clamp_coe D t] | |
| 122 | - exact (A.source_strain_eq m hm J support hSupport t).symm | |
| 123 | - · change A.sourceNormal m t = (D).normal.field ((D).clamp (t : ℝ)) 0 | |
| 124 | - rw [Data.clamp_coe D t] | |
| 125 | - exact (A.source_normal_eq m hm J support hSupport t).symm | |
| 126 | - · rfl | |
| 127 | - · rfl | |
| 128 | - | |
| 129 | -end Joined | |
| 130 | -end EulerParentPacketFrames.SmoothState | |
+0 −88 Euler/ParentUniformJoinedChild.lean deleted
| @@ -1,88 +0,0 @@ | ||
| 1 | -import Euler.ParentPacketChildChoice | |
| 2 | -import Euler.PacketInitializedUniformChild | |
| 3 | -import Euler.PacketUniversalFrequency | |
| 4 | - | |
| 5 | -/-! The positive-history packet at the fixed frequency constructs the | |
| 6 | -actual next parent, with the same errors and the k^80 label bound. -/ | |
| 7 | - | |
| 8 | -noncomputable section | |
| 9 | - | |
| 10 | -namespace EulerParentPacketFrames.LabelData | |
| 11 | - | |
| 12 | -open Set InnerProductSpace EulerSmoothLimit EulerSpatialCutoffs | |
| 13 | - EulerTransversePacketProvider EulerPacketCylinderField EulerPacketProfileRecursion | |
| 14 | - EulerPacketSourceFrequency EulerAllOrderDriftCorrection EulerGraphInvariantFlow | |
| 15 | - EulerPacketPrimaryFactorization EulerPeriodicProfile EulerPacketTerminalDatum | |
| 16 | - | |
| 17 | -variable {A : Parent} (L : LabelData A) (I : ParticleInverse A) (H : LowBounds A) | |
| 18 | - {U : Type} [NormedAddCommGroup U] [InnerProductSpace ℝ U] [CompleteSpace U] | |
| 19 | - (m : Space) (hm : ‖m‖=1) (R : U ≃ₗᵢ[ℝ] EulerTransverseFrameCoordinates.referencePlane m) | |
| 20 | - (S : Set Space) (hS : IsCompact S) | |
| 21 | - (τ : ℝ) (hτ : 0 < τ) (hτT : τ < A.T) | |
| 22 | - (J : JoinedInputs (A.meanData H) (A.transverseData m hm R S hS) τ hτ hτT | |
| 23 | - (A.historyOn H m hm R S hS τ hτ hτT)) | |
| 24 | - (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (ξ : U) | |
| 25 | - (hs : tsupport innerCutoff ⊆ S) (α : ℝ) (hα : 0 < α) | |
| 26 | - (W : ℝ) | |
| 27 | - (hW : EulerPacketRadiusPolynomial.RadiusPrimitives J.mean J.linear J.normal | |
| 28 | - (joinedCoefficientBudget period (A.meanData H) (A.transverseData m hm R S hS) | |
| 29 | - rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) J.normal) δ ξ W) | |
| 30 | - (hprofile : ∀ t, α*J.linear.fullProfile t ≤ W) | |
| 31 | - (k : ℝ) (hk : UniversalFrequency k) | |
| 32 | - (hfrequency : EulerPacketInitializedOutputCost.uniformConstant* | |
| 33 | - W^EulerPacketInitializedOutputCost.uniformPower ≤ smallPower k) | |
| 34 | - (hKk : L.K ≤ k) (hinv : A.ell⁻¹ ≤ k^(3/4 : ℝ)) | |
| 35 | - (nextEll : ℝ) (hnext : 0 < nextEll) (hnext1 : nextEll ≤ 1) | |
| 36 | - | |
| 37 | -include hδ1 hα J hW hprofile hfrequency hKk hinv in | |
| 38 | -theorem joined_uniform_child : | |
| 39 | - ∃ (hn : 1 ≤ truncation k) | |
| 40 | - (Q : Budget period A.T_pos | |
| 41 | - (initializedCorrectionData (A.meanData H) (A.transverseData m hm R S hS) | |
| 42 | - rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α | |
| 43 | - (A.sourceAgreement m hm R S hS H) (truncation k) hn k hk.four)) | |
| 44 | - (G : EulerPhysicalGraphFlowBounds.Data period A.T) | |
| 45 | - (hgraph : ∀ t z, graphConstraint k m (G.A.field t z)=0), | |
| 46 | - G.A=Q.liftedPacketCoefficient period | |
| 47 | - (initializedNormalizedField (A.meanData H) (A.transverseData m hm R S hS) | |
| 48 | - rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) δ hδ ξ hs α (truncation k) k) ∧ | |
| 49 | - (∀ (t : Icc (0 : ℝ) A.T) (x : Space), | |
| 50 | - ‖fderiv ℝ (initializedExactPhysicalVelocity (A.meanData H) | |
| 51 | - (A.transverseData m hm R S hS) rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 52 | - δ hδ ξ hs α (A.sourceAgreement m hm R S hS H) | |
| 53 | - (truncation k) hn k hk.four Q t (I.normalized t)) x- | |
| 54 | - (α*deriv (profile δ) (k*⟪m,I.normalized t x⟫_ℝ)) • | |
| 55 | - rankOne ℝ (canonicalVelocity τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 56 | - ξ hs t (I.normalized t x)) | |
| 57 | - ((A.transverseData m hm R S hS).normal.field t (I.normalized t x))‖ ≤ k^(-(1/4 : ℝ)) ∧ | |
| 58 | - ‖fderiv ℝ (gradient (initializedExactPhysicalPressure (A.meanData H) | |
| 59 | - (A.transverseData m hm R S hS) rfl τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 60 | - δ hδ ξ hs α (A.sourceAgreement m hm R S hS H) | |
| 61 | - (truncation k) hn k hk.four Q t (I.normalized t))) x- | |
| 62 | - (EulerPacketPrimaryPressure.coefficient τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 63 | - ξ hs α t (I.normalized t x)*deriv (profile δ) (k*⟪m,I.normalized t x⟫_ℝ)) • | |
| 64 | - rankOne ℝ ((A.transverseData m hm R S hS).normal.field t (I.normalized t x)) | |
| 65 | - ((A.transverseData m hm R S hS).normal.field t (I.normalized t x))‖ ≤ k^(-(1/4 : ℝ))) ∧ | |
| 66 | - (∀ (t : Icc (0 : ℝ) A.T) (x : Space), | |
| 67 | - ‖(G.displacementField k m A.ell A.ell_pos t).field x‖ ≤ k^(-(1/4 : ℝ))) ∧ | |
| 68 | - ∃ LC : LabelData (A.child G k m hgraph nextEll hnext hnext1), LC.K=k^80 := by | |
| 69 | - obtain ⟨hn,Q,G,E,_,_,hG,_,hgraph,_,herror,hmatch,hlabel,hdisplacement⟩ := | |
| 70 | - initialized_uniform_child_label_bounds (A.meanData H) (A.transverseData m hm R S hS) rfl | |
| 71 | - τ hτ hτT (A.historyOn H m hm R S hS τ hτ hτT) | |
| 72 | - δ hδ hδ1 ξ hs α hα J.linear J.normal (JoinedInputs.mean (U := U) J) | |
| 73 | - (A.sourceAgreement m hm R S hS H) W hW hprofile k hk.four hk.expansion_bound hk.log_bound | |
| 74 | - hfrequency hk.delta_bound hk.root_bound hk.trace_bound | |
| 75 | - (fun t x => A.packetPosition (t,x)) I.normalized | |
| 76 | - A.packetPosition_contDiff (fun t x => (A.packetPosition_spatial t x).fderiv) | |
| 77 | - I.normalized_right I.normalized_continuous A.frame_det | |
| 78 | - A.ell A.ell_pos A.ell_le_one L.displacement L.velocity L.acceleration L.K L.K_one | |
| 79 | - L.displacement_bound L.velocity_bound L.acceleration_bound 6 | |
| 80 | - hk.child_bound hKk hk.embedding_bound hk.derivative_bound hinv | |
| 81 | - let LC := L.child G k m hgraph nextEll hnext hnext1 E | |
| 82 | - (fun t => (hmatch t).1) (fun t => (hmatch t).2.1) (fun t => (hmatch t).2.2.1) | |
| 83 | - (fun t => (hmatch t).2.2.2.1) (fun t => (hmatch t).2.2.2.2.1) | |
| 84 | - (fun t => (hmatch t).2.2.2.2.2.1) | |
| 85 | - (k^80) (one_le_pow₀ hk.one_le) hlabel | |
| 86 | - exact ⟨hn,Q,G,hgraph,hG,herror,hdisplacement,LC,rfl⟩ | |
| 87 | - | |
| 88 | -end EulerParentPacketFrames.LabelData | |
+75 −0 docs/s5-folding/ContentTail.lean added View file
| @@ -0,0 +1,75 @@ | ||
| 1 | + | |
| 2 | +-- Every named constant of the two libraries with a hash of its type (and of its value when it is a definition) in which | |
| 3 | +-- an auxiliary constant counts by what it is, not by what it is called: private declarations, nested-proof lemmas, | |
| 4 | +-- matchers and automatically named local instances get their names from the module and from the order of elaboration, | |
| 5 | +-- and a fold changes both. A theorem met inside a term counts by its statement alone. | |
| 6 | +open Lean | |
| 7 | + | |
| 8 | +namespace FoldCheck | |
| 9 | + | |
| 10 | +def isAux (n : Name) : Bool := | |
| 11 | + n.components.any fun c => match c with | |
| 12 | + | .str _ s => s.startsWith "_" || (s.startsWith "match_" && (s.drop 6).all Char.isDigit) || (s.startsWith "proof_" && (s.drop 6).all Char.isDigit) | |
| 13 | + | .num _ _ => true | |
| 14 | + | .anonymous => false | |
| 15 | + | |
| 16 | +def userName (n : Name) : Name := | |
| 17 | + if isPrivateName n then ((n.components.dropWhile fun c => !c.isNum).drop 1).foldl (· ++ ·) `_private else n | |
| 18 | + | |
| 19 | +abbrev M := StateM (Std.HashMap Name UInt64 × Std.HashSet Name) | |
| 20 | + | |
| 21 | +mutual | |
| 22 | + partial def constHash (env : Environment) (n : Name) : M UInt64 := do | |
| 23 | + if let some h := (← get).1[n]? then return h | |
| 24 | + if (← get).2.contains n then return hash (userName n) | |
| 25 | + let some ci := env.find? n | return hash (userName n) | |
| 26 | + modify fun (m, v) => (m, v.insert n) | |
| 27 | + let th ← exprHash env ci.type | |
| 28 | + let (k, vh) ← match ci with | |
| 29 | + | .thmInfo _ => pure ((1 : UInt64), (0 : UInt64)) | |
| 30 | + | .defnInfo d => do pure (2, ← exprHash env d.value) | |
| 31 | + | .opaqueInfo d => do pure (3, ← exprHash env d.value) | |
| 32 | + | .ctorInfo c => pure (4, c.cidx.toUInt64) | |
| 33 | + | .inductInfo _ => pure (5, 0) | |
| 34 | + | .recInfo _ => pure (6, 0) | |
| 35 | + | _ => pure (7, 0) | |
| 36 | + let h := mixHash k (mixHash th vh) | |
| 37 | + modify fun (m, v) => (m.insert n h, v.erase n) | |
| 38 | + return h | |
| 39 | + partial def exprHash (env : Environment) (e : Expr) : M UInt64 := do | |
| 40 | + for u in e.getUsedConstants do | |
| 41 | + if isAux u then discard <| constHash env u | |
| 42 | + let memo := (← get).1 | |
| 43 | + let e' := e.replace fun | |
| 44 | + | .const n ls => if isAux n then some (.const (Name.mkNum `_h (memo.getD n 0).toNat) ls) else none | |
| 45 | + | _ => none | |
| 46 | + return e'.hash | |
| 47 | +end | |
| 48 | + | |
| 49 | +end FoldCheck | |
| 50 | + | |
| 51 | +open FoldCheck in | |
| 52 | +#eval show CoreM Unit from do | |
| 53 | + let env ← getEnv | |
| 54 | + let mods := env.header.moduleNames | |
| 55 | + let proj (m : Name) : Bool := m.getRoot == `NavierStokes || m.getRoot == `Euler | |
| 56 | + let h ← IO.FS.Handle.mk "/out/content.tsv" IO.FS.Mode.write | |
| 57 | + let mut st : Std.HashMap Name UInt64 × Std.HashSet Name := ({}, {}) | |
| 58 | + let mut n := 0 | |
| 59 | + for (c, ci) in env.constants.map₁.toList do | |
| 60 | + let some idx := env.getModuleIdxFor? c | continue | |
| 61 | + unless proj mods[idx.toNat]! do continue | |
| 62 | + if isAux c then continue | |
| 63 | + let (th, st1) := (exprHash env ci.type).run st | |
| 64 | + st := st1 | |
| 65 | + let mut v := "-" | |
| 66 | + match ci with | |
| 67 | + | .defnInfo d => let (vh, st2) := (exprHash env d.value).run st; st := st2; v := toString vh | |
| 68 | + | .opaqueInfo d => let (vh, st2) := (exprHash env d.value).run st; st := st2; v := toString vh | |
| 69 | + | _ => pure () | |
| 70 | + let kind := match ci with | |
| 71 | + | .thmInfo _ => "theorem" | .defnInfo _ => "def" | .axiomInfo _ => "axiom" | .opaqueInfo _ => "opaque" | |
| 72 | + | .inductInfo _ => "inductive" | .ctorInfo _ => "ctor" | .recInfo _ => "rec" | .quotInfo _ => "quot" | |
| 73 | + h.putStrLn s!"{c}\t{kind}\t{th}\t{v}" | |
| 74 | + n := n + 1 | |
| 75 | + IO.println s!"{n} named constants written" | |
+12 −0 docs/s5-folding/README.md View file
| @@ -101,3 +101,15 @@ Each pull request of the series keeps its plan in its route notes (`routes/<bran | ||
| 101 | 101 | ## What this does not show |
| 102 | 102 | |
| 103 | 103 | The wall-clock time of a build on your machine; that every file is now in its best shape for reading (P-8 splits the large ones; nothing here grows past 600 lines). |
| 104 | + | |
| 105 | +## Statements, and the series as it was opened | |
| 106 | + | |
| 107 | +The first pull request of the series was cut from a plan of 582 folds. Before the others were opened, main and the folded tree were both built and every named constant of the two libraries was listed with a hash of its type and, for a definition, of its value (`ContentTail.lean`, after one `import` line a module). In that listing an auxiliary constant inside a term (a private declaration, a nested-proof lemma, an automatically named local instance) counts by what it is, not by its name, and a theorem by its statement: a fold changes the names of such constants and nothing else about them. | |
| 108 | + | |
| 109 | +The first plan did not pass. Of 53,802 named constants, 12 differed. In one, `Euler.ComparatorBridge.compactSolenoidalTests_representation`, the word `divergence` resolved to `Euler.divergence` in the folded file and to `EulerSmoothLimit.divergence` on main: once folded, the text saw more names. The build passed all the same. In the others an instance was found by another path (`NormedCommRing ℂ` through the C⋆-algebra instances, `DistribSMul ℝ` through the semiring), or a proof inside the statement differed. | |
| 110 | + | |
| 111 | +Two changes followed. `fold.py` now puts a folded module's imports where its import line stood, so that every other module is loaded in the order it was loaded before (a plan file says which way it was cut, and `check` follows it, so the first pull request still checks). And five files keep their modules: `Euler/CompactProjectedEulerLaw.lean`, `Euler/CylinderJetLpAlgebra.lean`, `Euler/MeanCutoffDifferenceBound.lean`, `NavierStokes/R3/CompactEnergy.lean`, `NavierStokes/R3/PressureRecovery.lean`. | |
| 112 | + | |
| 113 | +The series as opened is 575 folds into 338 files. On it the two listings are equal: 53,802 named constants, none missing, none with another type or value; the first pull request's twelve folds were checked alone and are equal too. The whole tree goes from 54.73 T instructions over 2,587 files to 50.97 T over 2,012 (−6.9%), in place of the figures at the top of this page. | |
| 114 | + | |
| 115 | +What the listing does not show: that two terms with different hashes mean different things (the twelve were read one by one), or anything about proofs, which are not listed. | |
+30 −11 docs/s5-folding/fold.py View file
| @@ -111,11 +111,21 @@ def plan(src, small, cap, skip=()): | ||
| 111 | 111 | return {a: p for a, p in parts.items() if len(p) > 1} |
| 112 | 112 | |
| 113 | 113 | |
| 114 | -def folded(src, host, parts): | |
| 115 | - """the host's new text""" | |
| 114 | +def folded(src, host, parts, inplace=False): | |
| 115 | + """the host's new text. `inplace`: a folded module's import line is replaced, where it stood, by that module's own | |
| 116 | + imports, so that every other module is loaded in the order it was loaded before (Lean breaks ties between instances | |
| 117 | + by that order); otherwise the folded modules' imports come after the host's own.""" | |
| 116 | 118 | head, mods, body = split(src[host]) |
| 117 | - inside = {module(p) for p in parts} | |
| 118 | - new = [m for m in mods if m not in inside] | |
| 119 | + inside = {module(p): p for p in parts[:-1]} | |
| 120 | + if inplace: | |
| 121 | + new = [] | |
| 122 | + def take(ms): | |
| 123 | + for m in ms: | |
| 124 | + if m in inside: take(split(src[inside[m]])[1]) | |
| 125 | + elif m not in new: new.append(m) | |
| 126 | + take(mods) | |
| 127 | + else: | |
| 128 | + new = [m for m in mods if m not in inside] | |
| 119 | 129 | out_parts = [] |
| 120 | 130 | for p in parts[:-1]: |
| 121 | 131 | h, pm, pb = split(src[p]) |
| @@ -141,10 +151,16 @@ def folded(src, host, parts): | ||
| 141 | 151 | return "\n".join(out + body) |
| 142 | 152 | |
| 143 | 153 | |
| 144 | -def apply(tree, pl): | |
| 154 | +def load(path): | |
| 155 | + """(the folds, whether imports go in place) of a plan file; the first plans were a bare table of folds""" | |
| 156 | + d = json.load(open(path)) | |
| 157 | + return (d["folds"], d.get("imports") == "in place") if "folds" in d else (d, False) | |
| 158 | + | |
| 159 | + | |
| 160 | +def apply(tree, pl, inplace=False): | |
| 145 | 161 | src = read_tree(tree) |
| 146 | 162 | for host, parts in pl.items(): |
| 147 | - text = folded(src, host, parts) | |
| 163 | + text = folded(src, host, parts, inplace) | |
| 148 | 164 | # every line of every folded file and of the host is still there (imports aside) |
| 149 | 165 | want = collections.Counter(l for p in parts for l in (lambda s: s[0] + s[2])(split(src[p])) if l.strip()) |
| 150 | 166 | have = collections.Counter(l for l in text.split("\n") if l.strip() and not IMPORT.match(l)) |
| @@ -153,12 +169,12 @@ def apply(tree, pl): | ||
| 153 | 169 | for p in parts[:-1]: os.remove(os.path.join(tree, p)) |
| 154 | 170 | |
| 155 | 171 | |
| 156 | -def check(repo, pl, rev): | |
| 172 | +def check(repo, pl, rev, inplace=False): | |
| 157 | 173 | """the working tree against what `apply` makes of the revision's text: every changed file, byte for byte""" |
| 158 | 174 | show = lambda f: subprocess.run(["git", "-C", repo, "show", f"{rev}:{f}"], capture_output=True, text=True, check=True).stdout |
| 159 | 175 | bad = [] |
| 160 | 176 | for host, parts in pl.items(): |
| 161 | - want = folded({p: show(p) for p in parts}, host, parts) | |
| 177 | + want = folded({p: show(p) for p in parts}, host, parts, inplace) | |
| 162 | 178 | path = os.path.join(repo, host) |
| 163 | 179 | if not os.path.exists(path) or open(path, encoding="utf-8").read() != want: bad.append(f"{host} is not {rev}'s text folded") |
| 164 | 180 | bad += [f"{p} is still there" for p in parts[:-1] if os.path.exists(os.path.join(repo, p))] |
| @@ -178,6 +194,9 @@ def self_test(): | ||
| 178 | 194 | assert t.startswith("import Mathlib.X\nimport Euler.Bar\nimport Mathlib.Y\n\n/-! # A -/\n"), t |
| 179 | 195 | assert "end Euler.B\nend\n\nend\n" in t and t.index("theorem c") < t.index("theorem b") < t.index("theorem a"), t |
| 180 | 196 | assert unclosed(src["Euler/FooB.lean"].split("\n")) == [("section", ""), ("namespace", "Euler.B")] |
| 197 | + t2 = folded(src, "Euler/FooA.lean", pl["Euler/FooA.lean"], inplace=True) | |
| 198 | + assert t2.startswith("import Mathlib.X\nimport Mathlib.Y\nimport Euler.Bar\n\n/-! # A -/\n"), t2 | |
| 199 | + assert t2.split("\n\n", 1)[1] == t.split("\n\n", 1)[1] | |
| 181 | 200 | assert plan(src, 100, 1000, skip={"Euler/FooB.lean"}) == {} |
| 182 | 201 | assert plan(src, 2, 1000) == {}, plan(src, 2, 1000) |
| 183 | 202 | print("ok") |
| @@ -191,10 +210,10 @@ if __name__ == "__main__": | ||
| 191 | 210 | src = read_tree(a[1]) |
| 192 | 211 | skip = set(open(opt("--skip", "")).read().split()) if "--skip" in a else set() |
| 193 | 212 | pl = plan(src, int(opt("--small", 200)), int(opt("--cap", 600)), skip) |
| 194 | - json.dump(pl, open(a[2], "w"), indent=0) | |
| 213 | + json.dump({"imports": "in place", "folds": pl}, open(a[2], "w"), indent=0) | |
| 195 | 214 | n = sum(len(p) - 1 for p in pl.values()) |
| 196 | 215 | print(f"folds: {n} modules into {len(pl)} files in {len({fam(h) for h in pl})} families; largest file after: {max((sum(src[p].count(chr(10)) for p in ps), h) for h, ps in pl.items()) if pl else None}") |
| 197 | 216 | elif a[0] == "check": |
| 198 | - sys.exit(check(a[1], json.load(open(a[2])), a[3] if len(a) > 3 else "origin/main")) | |
| 217 | + pl, inplace = load(a[2]); sys.exit(check(a[1], pl, a[3] if len(a) > 3 else "origin/main", inplace)) | |
| 199 | 218 | elif a[0] == "apply": |
| 200 | - pl = json.load(open(a[2])); apply(a[1], pl); print("applied", sum(len(p) - 1 for p in pl.values()), "folds") | |
| 219 | + pl, inplace = load(a[2]); apply(a[1], pl, inplace); print("applied", sum(len(p) - 1 for p in pl.values()), "folds") | |
+20 −0 routes/s5-euler-parent-1/README.md added View file
| @@ -0,0 +1,20 @@ | ||
| 1 | +--- | |
| 2 | +issue: 14 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# s5-euler-parent-1 | |
| 6 | + | |
| 7 | +The family `Euler/Parent*`. The unit folds its 22 small modules that had exactly one importer into the 13 files that | |
| 8 | +imported them, text unchanged, under a heading that names the file each came from and in a `section` of its own; each | |
| 9 | +host takes over the imports of the module it takes in, so the import lines of the folded modules go. This is Lean | |
| 10 | +Pool's "fewer modules" (Vasily Ilin's pull requests 405 and 570), computed on this tree from its own import graph. | |
| 11 | +The folds are `plan.json` here; `python3 -I docs/s5-folding/fold.py check . routes/s5-euler-parent-1/plan.json` | |
| 12 | +remakes every changed file from `origin/main`'s text and compares it byte for byte. | |
| 13 | + | |
| 14 | +No file of this family reads worse folded: each folded module's text is short and stands behind its own heading, and | |
| 15 | +the file it joins is what imported it before (`Euler/ParentState.lean` takes in five, `Euler/ParentEulerChild.lean` | |
| 16 | +two, the rest one or two). | |
| 17 | + | |
| 18 | +## Next | |
| 19 | + | |
| 20 | +The pull request is open; the `build` check decides. If it fails, read its log before anything else. | |
+66 −0 routes/s5-euler-parent-1/plan.json added View file
| @@ -0,0 +1,66 @@ | ||
| 1 | +{ | |
| 2 | +"imports": "in place", | |
| 3 | +"folds": { | |
| 4 | +"Euler/ParentEulerChild.lean": [ | |
| 5 | +"Euler/ParentPacketExactDivergence.lean", | |
| 6 | +"Euler/ParentChildEulerMatch.lean", | |
| 7 | +"Euler/ParentEulerChild.lean" | |
| 8 | +], | |
| 9 | +"Euler/ParentEulerState.lean": [ | |
| 10 | +"Euler/ParentParticleRegularity.lean", | |
| 11 | +"Euler/ParentEulerState.lean" | |
| 12 | +], | |
| 13 | +"Euler/ParentGeometryChoiceLow.lean": [ | |
| 14 | +"Euler/ParentPacketInitialLowBounds.lean", | |
| 15 | +"Euler/ParentPacketChildLowGuards.lean", | |
| 16 | +"Euler/ParentGeometryChoiceLow.lean" | |
| 17 | +], | |
| 18 | +"Euler/ParentGeometryChoiceRenewal.lean": [ | |
| 19 | +"Euler/ParentTargetRenewal.lean", | |
| 20 | +"Euler/ParentGeometryChoiceRenewal.lean" | |
| 21 | +], | |
| 22 | +"Euler/ParentGeometryJoinedChoice.lean": [ | |
| 23 | +"Euler/ParentUniformJoinedChild.lean", | |
| 24 | +"Euler/ParentGeometryJoinedChoice.lean" | |
| 25 | +], | |
| 26 | +"Euler/ParentInitializedRadiusPolynomial.lean": [ | |
| 27 | +"Euler/ParentCorrectionCostEnvelope.lean", | |
| 28 | +"Euler/ParentInitializedRadiusPolynomial.lean" | |
| 29 | +], | |
| 30 | +"Euler/ParentInitializedUniformCosts.lean": [ | |
| 31 | +"Euler/ParentPacketGeometryInput.lean", | |
| 32 | +"Euler/ParentInitializedUniformCosts.lean" | |
| 33 | +], | |
| 34 | +"Euler/ParentNeighborThreshold.lean": [ | |
| 35 | +"Euler/ParentHistoryFrequencyGuard.lean", | |
| 36 | +"Euler/ParentPacketNeighborScaleGuard.lean", | |
| 37 | +"Euler/ParentNeighborThreshold.lean" | |
| 38 | +], | |
| 39 | +"Euler/ParentNormalPacketParameters.lean": [ | |
| 40 | +"Euler/ParentPacketParameterCaps.lean", | |
| 41 | +"Euler/ParentNormalPacketParameters.lean" | |
| 42 | +], | |
| 43 | +"Euler/ParentPacketExactEuler.lean": [ | |
| 44 | +"Euler/ParentNormalizedEuler.lean", | |
| 45 | +"Euler/ParentPacketExactEuler.lean" | |
| 46 | +], | |
| 47 | +"Euler/ParentPacketHistoryPolynomial.lean": [ | |
| 48 | +"Euler/ParentHistoryCostPolynomial.lean", | |
| 49 | +"Euler/ParentPacketHistoryPolynomial.lean" | |
| 50 | +], | |
| 51 | +"Euler/ParentState.lean": [ | |
| 52 | +"Euler/ParentPacketSobolevFields.lean", | |
| 53 | +"Euler/ParentPacketCorrectionParity.lean", | |
| 54 | +"Euler/ParentEulerSobolevChild.lean", | |
| 55 | +"Euler/ParentEulerParity.lean", | |
| 56 | +"Euler/ParentEulerEndpoints.lean", | |
| 57 | +"Euler/ParentState.lean" | |
| 58 | +], | |
| 59 | +"Euler/ParentStateGeometry.lean": [ | |
| 60 | +"Euler/ParentPacketGeometryFrame.lean", | |
| 61 | +"Euler/ParentPacketPhysicalFrame.lean", | |
| 62 | +"Euler/ParentPacketPrimaryCenter.lean", | |
| 63 | +"Euler/ParentStateGeometry.lean" | |
| 64 | +] | |
| 65 | +} | |
| 66 | +} | |