File size: 2,018 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | import OAI.Combinatorics.EditApproximation.Geometry.PrefixCosts
import OAI.Combinatorics.EditApproximation.Numerics.RationalRefinement
import OAI.Combinatorics.EditApproximation.Definitions
namespace OAI
/-! Rational execution and exact real casts of the finite band predictor. -/
namespace EditApproximation
open Finset
theorem rationalConnectionBudget_cast {n : β} (start finish : β) (states : List (TargetInterval n)) :
(rationalConnectionBudget start states finish : β) = realConnectionBudget start states finish := by
induction states generalizing start with
| nil => simp only [rationalConnectionBudget, realConnectionBudget, Rat.cast_abs, Rat.cast_sub]
| cons state rest ih =>
simp only [rationalConnectionBudget, realConnectionBudget, Rat.cast_add, Rat.cast_abs,
Rat.cast_sub, Rat.cast_natCast, ih]
theorem rationalWidePrefixCost_cast {nx ny M : β} (parent : TargetInterval nx)
(r : TargetInterval ny) (states : Fin M β TargetInterval ny)
(child : Fin M β TargetInterval ny β β) (j : β) (p : β) :
(rationalWidePrefixCost parent r states child j p : β) =
widePrefixCost parent r states (fun i s => (child i s : β)) j p := by
simp only [rationalWidePrefixCost, widePrefixCost, Rat.cast_add, Rat.cast_sum,
rationalConnectionBudget_cast, Rat.cast_natCast]
congr 1
apply sum_congr rfl
intro i hi
split_ifs <;> simp
theorem rationalWidePrefixMinimum_cast {nx ny M : β} (parent : TargetInterval nx)
(r : TargetInterval ny) (actions : List (Fin M β TargetInterval ny)) (hnonempty : actions β [])
(child : Fin M β TargetInterval ny β β) (j : β) (p : β) :
(rationalWidePrefixMinimum parent r actions hnonempty child j p : β) =
widePrefixMinimum parent r actions hnonempty (fun i s => (child i s : β)) j p := by
rw [rationalWidePrefixMinimum, rationalMinimum_cast]
simp only [widePrefixMinimum, rationalWidePrefixCost_cast, List.map_map, Function.comp_def]
end EditApproximation
end OAI
|