F64addb.subv: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64addb.bend as F64addb Lines 39-46 of bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64addb.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/f64addb.bend&start_line=39&end_line=46 import Base import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as C import bend-collections-laws-math@1.0.0.0/spec/math/w64.bend as SW import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as X import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as WU import bend-collections-laws-math@1.0.0.0/proofs/lib/logic.bend as L import bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64add.bend as WA import bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64sh.bend as SH # the value of T - jam(S >> d) as a U64 subtraction def subv(+tw: WU.U64, +sw: WU.U64, +t: Nat, +S: Nat, +d: Nat, +ht: {SW.value(tw) == Nat.double(t) : Nat}, +hs: {SW.value(sw) == S : Nat}, +hle: {Nat.is_le(SW.jam(C.high(d, S), C.low(d, S)), Nat.double(t)) == True{} : Bool}) -> {SW.value(X.sub(tw, X.shr_jam(sw, d))) == Nat.sub(Nat.double(t), SW.jam(C.high(d, S), C.low(d, S))) : Nat}: sj = SH.shr_jam_value(sw, d) +JJ = SW.jam(C.high(d, S), C.low(d, S)) +ej = Equal.trans(Nat, SW.value(X.shr_jam(sw, d)), SW.jam(C.high(d, SW.value(sw)), C.low(d, SW.value(sw))), JJ, sj, Equal.cong(Nat, Nat, z => SW.jam(C.high(d, z), C.low(d, z)), SW.value(sw), S, hs)) +hle2 = L.subst(Nat, z => {Nat.is_le(z, SW.value(tw)) == True{} : Bool}, JJ, SW.value(X.shr_jam(sw, d)), Equal.sym(Nat, SW.value(X.shr_jam(sw, d)), JJ, ej), L.subst(Nat, z => {Nat.is_le(JJ, z) == True{} : Bool}, Nat.double(t), SW.value(tw), Equal.sym(Nat, SW.value(tw), Nat.double(t), ht), hle)) s1 = WA.sub_value(tw, X.shr_jam(sw, d), hle2) Equal.trans(Nat, SW.value(X.sub(tw, X.shr_jam(sw, d))), Nat.sub(SW.value(tw), SW.value(X.shr_jam(sw, d))), Nat.sub(Nat.double(t), JJ), s1, Equal.trans(Nat, Nat.sub(SW.value(tw), SW.value(X.shr_jam(sw, d))), Nat.sub(Nat.double(t), SW.value(X.shr_jam(sw, d))), Nat.sub(Nat.double(t), JJ), Equal.cong(Nat, Nat, z => Nat.sub(z, SW.value(X.shr_jam(sw, d))), SW.value(tw), Nat.double(t), ht), Equal.cong(Nat, Nat, z => Nat.sub(Nat.double(t), z), SW.value(X.shr_jam(sw, d)), JJ, ej))) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.double https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/lib/logic.bend&name=subst https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64add.bend&name=sub_value https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/proofs/math/typed/w64sh.bend&name=shr_jam_value https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/lib/common.bend&name=high https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/lib/common.bend&name=low https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/w64.bend&name=jam https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/w64.bend&name=value https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/u64.bend&name=U64 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/w64.bend&name=shr_jam https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/w64.bend&name=sub