theoremscalingPoint_bound {d : Input} (hd : ValidInput d) {b : Instruction}
(hb : b ∈ d.instructions) {Y : Plane} (hY : Y∈ b.source.carrier) (k : Fin5) :
‖scalingPoint b Y k - b.source.center‖ ≤2*(d.h : ℝ) :=by
proof · 4
lines
obtain ⟨hr,hs,hmul,hdiv⟩ := instruction_offset_bounds hd hb hY
simpa only [scalingPoint, add_sub_cancel_left] using scaling_endpoints_bound
(by exact_mod_cast hd.factor_pos b hb) (by exact_mod_cast hd.h_pos.le)
(Y-b.source.center) hr hs hmul hdiv k
theoremscalingPoint_lipschitz {d : Input} (hd : ValidInput d) {b : Instruction}
(hb : b ∈ d.instructions) (XY : Plane) (k : Fin5) :
‖scalingPoint b X k - scalingPoint b Y k‖ ≤ (d.prefixConstant : ℝ)*‖X-Y‖ :=by
proof · 6
lines
have h := scalingEndpoints_lipschitz (lam := (b.factor : ℝ)) (by exact_mod_cast hd.factor_pos b hb)
(X-b.source.center) (Y-b.source.center) k
havehsub : (X-b.source.center)-(Y-b.source.center) = X-Y:=by abel
simp only [scalingPoint, add_sub_add_left_eq_sub]
rw [hsub] at h
exact h.trans (mul_le_mul_of_nonneg_right (prefixConstant_bound hb) (norm_nonneg _))
havehC : (0 : ℝ) < d.prefixConstant :=by exact_mod_cast
(lt_of_lt_of_le (bynorm_num : (0 : ℚ) < 1) (prefixConstant_ge_one d))
havehdist : ‖scalingPoint b X k - scalingPoint b Y k‖ < (d.horizontalRadius : ℝ) :=
(scalingPoint_lipschitz hd hb XY k).trans_lt
((mul_lt_mul_of_pos_left hXY hC).trans (by exact_mod_cast (tubeRadius_bounds hd).2.2.1))
have hoff := abs_le.mp ((norm_le_pi_norm (scalingPoint b Y k - b.source.center) j).trans
(scalingPoint_bound hd hb hY k))
have hclose := abs_lt.mp ((norm_le_pi_norm (scalingPoint b X k - scalingPoint b Y k) j).trans_lt hdist)
simp only [Pi.sub_apply] at hoff hclose
have hcenter := hd.source_centers b hb j
dsimp [Input.horizontalBox, RationalBox.inflate]
push_cast
constructor <;> linarith [hcenter.1,hcenter.2]
theoremspatialFields_lift_value {d : Input} (hd : ValidInput d)
(i : Fin d.instructions.length) {XY : Plane} (hY : Y∈ (d.sources i).carrier)
(hXY : ‖X-Y‖ < (d.sourceRadius : ℝ)) (z : ℝ) :
d.spatialFields 0 (atHeight X z) = ((d.privateHeight i : ℝ)-d.codingHeight) • basis 2:=by
proof · 2
lines
have hm (j) : d.sourceMask j X = if j = i then1else0:= sourceMask_near_box hd i j hY hXY
simp [Input.spatialFields, sevenFields, transverseSum, selectTwo_apply, atHeight, hm]
have hm (j) : d.targetMask j X = if j = i then1else0:= targetMask_near_box hd i j hY hXY
simp [Input.spatialFields, sevenFields, transverseSum, selectTwo_apply, atHeight, hm]
theoremspatialFields_scaling_value {d : Input} (hd : ValidInput d)
(i : Fin d.instructions.length) (k : Fin4) {U : Plane} {z : ℝ}
(hU : ∀ j, U j ∈Icc (d.horizontalBox.lower j - d.horizontalRadius : ℝ)
(d.horizontalBox.upper j + d.horizontalRadius : ℝ))
(hz : |z - (d.privateHeight i : ℝ)| < (d.heightRadius : ℝ)) :
d.spatialFields (scalingIndex k) (atHeight U z) = scalingVelocity d.instructions[i] U k :=by
proof · 4
lines
have hZ (j) := heightMask_near_privateHeight hd i j hz
have hg (j) := horizontalProfile_eq hd i j (hU j)
fin_cases k <;> simp [Input.spatialFields, sevenFields, scalingIndex, scalingVelocity,
transverseSum, selectTwo_apply, atHeight, hZ, hg, Input.sources]
theoremspatialFields_scaling_partial {d : Input} (hd : ValidInput d)
(i : Fin d.instructions.length) {XY : Plane}
(hY : Y∈ (d.sources i).carrier) (hXY : ‖X-Y‖ < (d.tubeRadius : ℝ))
{z : ℝ} (hz : |z-(d.privateHeight i : ℝ)| < (d.heightRadius : ℝ))
(k : Fin4) (θ : ℝ) :
atHeight (scalingPoint d.instructions[i] X k.castSucc) z + θ •
d.spatialFields (scalingIndex k) (atHeight (scalingPoint d.instructions[i] X k.castSucc) z) =
atHeight (scalingStage d.instructions[i] k θ X) z :=by
proof · 8
lines
have hf := spatialFields_scaling_value hd i k
(scalingPoint_in_plateau hd (b := d.instructions[i]) (List.getElem_mem _) hY hXY k.castSucc) hz
simp only [Fin.getElem_fin] at hf ⊢
rw [hf]
ext m
fin_cases k <;> fin_cases m <;>
simp [scalingVelocity, scalingPoint, scalingStage, partialShear, shearX, shearY,
atHeight, basis, scalingEndpoints] <;> ring