def
definition
foldMinusOneDecodedStep
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.ClassicalBridge.Fluids.Simulation2D on GitHub at line 329.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
formal source
326/-- The corresponding discrete step on **decoded** Galerkin coefficients.
327
328We mimic the VM update on `nuPhi` (via `clampI32`) and then decode a nonnegative magnitude using `decodeMag`. -/
329noncomputable def foldMinusOneDecodedStep {N : ℕ} (u : GalerkinState N) : GalerkinState N :=
330 WithLp.toLp 2 (fun i : ((modes N) × Fin 2) =>
331 let x : ℝ := u i
332 let m : Int := decodeMag (clampI32 (coeffMag x + (-1)))
333 let z : Int := (coeffSign x) * m
334 (z : ℝ))
335
336/-- Decoding after a single `FOLD (-1)` step matches the corresponding decoded discrete step. -/
337lemma decodeCoeff_voxelStep_foldMinusOne_encodeIndex {N : ℕ} (u : GalerkinState N) (i : (modes N) × Fin 2) :
338 decodeCoeff (voxelStep foldMinusOneProgram (encodeIndex u i)) = (foldMinusOneDecodedStep u) i := by
339 classical
340 -- both sides reduce to the same signed-integer expression
341 simp [decodeCoeff, foldMinusOneDecodedStep, decodeMag, voxelStep_foldMinusOneProgram, encodeIndex, -clampI32]
342
343/-- A concrete, proved decay-step simulation instance (after decoding). -/
344noncomputable def DecodedSimulationHypothesis.foldMinusOne (N : ℕ) : DecodedSimulationHypothesis N :=
345 { P := foldMinusOneProgram
346 step := foldMinusOneDecodedStep
347 comm := by
348 intro u
349 classical
350 -- Prove equality of Galerkin states by pointwise equality of coefficients.
351 ext i
352 -- Reduce to the single-voxel lemma `decodeCoeff_voxelStep_foldMinusOne_encodeIndex`.
353 simp [decodeGalerkin2D, LNALSemantics.independent, encodeGalerkin2D,
354 decodeCoeff_voxelStep_foldMinusOne_encodeIndex] }
355
356end Simulation2D
357
358end IndisputableMonolith.ClassicalBridge.Fluids