math / data /lean /OAI /LinearAlgebra /MatrixMultiplication /Entropy /ComplexAsymptoticRecurrence.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
1.36 kB
import Mathlib.Basic.Real.Basic
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
namespace OAI
/-! Finite entropy, rate estimates and ordered asymptotic limits. -/
namespace MatrixMultiplication.Foundation
theorem affine_recurrence_shifted (x : β„• β†’ ℝ) (a c : ℝ) (ha : 0 ≀ a)
(hstep : βˆ€ t, x (t + 1) ≀ a * x t + (a - 1) * c) :
βˆ€ t, x t + c ≀ a ^ t * (x 0 + c) := by
intro t
induction t with
| zero => simp
| succ t ih =>
calc
x (t + 1) + c ≀ a * x t + (a - 1) * c + c := add_le_add_left (hstep t) c
_ = a * (x t + c) := by ring
_ ≀ a * (a ^ t * (x 0 + c)) := mul_le_mul_of_nonneg_left ih ha
_ = a ^ (t + 1) * (x 0 + c) := by rw [pow_succ]; ring
theorem affine_recurrence_bound (x : β„• β†’ ℝ) (a b : ℝ) (ha : 1 < a) (hb : 0 ≀ b)
(hstep : βˆ€ t, x (t + 1) ≀ a * x t + b) :
βˆ€ t, x t ≀ a ^ t * (x 0 + b / (a - 1)) := by
have hpos : 0 < a - 1 := sub_pos.mpr ha
have hcancel : (a - 1) * (b / (a - 1)) = b := by
field_simp [ne_of_gt hpos]
have hshift := affine_recurrence_shifted x a (b / (a - 1)) (by linarith)
(fun t => by rw [hcancel]; exact hstep t)
intro t
have hc : 0 ≀ b / (a - 1) := div_nonneg hb hpos.le
exact (le_add_of_nonneg_right hc).trans (hshift t)
end MatrixMultiplication.Foundation
end OAI