cfahlgren1/math / lean /OAI /Analysis /MatrixSigning /Machines /SignedFloorSize.lean
cfahlgren1's picture
download
raw
1.38 kB
import Mathlib
import OAI.Analysis.MatrixSigning.Machines.SignedFloorModel
namespace OAI
section
namespace KS.W19.SignedFloor
theorem floor_encodeInt_length_le_num (q : Rat) :
(KS.W01.encodeInt ⌊q⌋).length ≤ (KS.W01.encodeInt q.num).length := by
let raw := (DivisionLoop.process (Computability.encodeNat q.den)
(Computability.encodeNat (KS.W01.intPayload q.num)).reverse [] []).1
have hraw : raw.length = (Computability.encodeNat (KS.W01.intPayload q.num)).length := by
simpa only [List.length_nil, List.length_reverse, Nat.zero_add] using
DivisionLoop.process_quotient_length (Computability.encodeNat q.den)
(Computability.encodeNat (KS.W01.intPayload q.num)).reverse [] []
have hcan : (Computability.encodeNat (bitsValue raw)).length ≤ raw.length := by
rw [← trimBits_eq_encodeNat]
exact trimBits_length_le raw
rw [← floor_wire, List.length_cons, KS.W01.length_encodeNat, KS.W01.length_encodeInt]
change (2 * (Computability.encodeNat (bitsValue raw)).length + 1) + 1 ≤
2 * (Computability.encodeNat (KS.W01.intPayload q.num)).length + 2
omega
theorem floor_encodeInt_length_le_input (q : Rat) :
(KS.W01.encodeInt ⌊q⌋).length ≤ (KS.W01.encodeRat q).length := by
have h := floor_encodeInt_length_le_num q
simp only [KS.W01.encodeRat, List.length_append]
omega
end KS.W19.SignedFloor
end
end OAI

Xet Storage Details

Size:
1.38 kB
·
Xet hash:
86a834aa3762b1f6c34dd4d7b9be9d0cd15f565fa235db45663caa507488706c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.