File size: 1,112 Bytes
ea76aac | 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 | import Mathlib
import OAI.Computability.MinUncut.Machines.Runtime
import OAI.Computability.MinUncut.Estimates.OutputSize
namespace OAI
section
namespace MinUncut
open Turing MinUncutGames.Foundations.Complexity
lemma Output.vertices_le_bits (G : Output) : G.vertices≤G.bits.length := by
have h:G.vertices≤G.vertices^2:=by
by_cases hz:G.vertices=0
· simp [hz]
· have hp:1≤G.vertices:=Nat.one_le_iff_ne_zero.mpr hz
simpa only [pow_two,Nat.mul_one] using Nat.mul_le_mul_left G.vertices hp
rw [G.bits_length]
omega
lemma graph_size_of_runtime (M : FinTM2) (G : Output)
(input : List (M.Γ M.k₀)) (out : List (M.Γ M.k₁)) (B : ℕ)
(hlen : out.length=G.bits.length)
(hr : TM2OutputsInTime M input (some out) B) :
G.vertices+G.bits.length≤2*(input.length+B*Runtime.programPushBound M) := by
have hb:=Runtime.outputLength_le M input out B hr
rw [hlen] at hb
calc
_ ≤ G.bits.length+G.bits.length := Nat.add_le_add_right G.vertices_le_bits _
_ = 2*G.bits.length := (two_mul _).symm
_ ≤ _ := Nat.mul_le_mul_left 2 hb
end MinUncut
end
end OAI
|