use verus_builtin_macros::verus;
#[allow(unused_imports)]
use verus_builtin::*;
#[allow(unused_imports)]
use vstd::prelude::*;
#[allow(unused_imports)]
use crate::model::*;
#[allow(unused_imports)]
use crate::types::{MAX_MAG, Rat};
verus! {
pub proof fn lemma_saturation_is_a_choice()
ensures
!magnitude_fits(2 * max_mag() + 1, 2),
(Rat { num: MAX_MAG, den: 1 }).wf(),
within_error_bound(Rat { num: MAX_MAG, den: 1 }, 2 * max_mag() + 1, 2),
{
let n = 2 * max_mag() + 1;
let r = Rat { num: MAX_MAG, den: 1 };
lemma_max_mag_pow2();
assert(r.n() == max_mag());
assert(r.d() == 1);
assert(gcd_int(r.num as int, r.den as int) == 1) by {
reveal_with_fuel(gcd_nat, 3);
}
assert(!magnitude_fits(n, 2));
assert(r.n() * 2 - n * r.d() == -1);
assert(abs_int(r.n() * 2 - n * r.d()) == 1);
assert(max_int(2, abs_int(n)) == n);
lemma_pow2_pos(62nat);
lemma_pow2_mono(61nat, 62nat);
}
}