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::from_raw_spec(MAX_MAG, 1).wf(),
within_error_bound(Rat::from_raw_spec(MAX_MAG, 1), 2 * max_mag() + 1, 2),
{
let n = 2 * max_mag() + 1;
let r = Rat::from_raw_spec(MAX_MAG, 1);
Rat::lemma_from_raw_spec_components(MAX_MAG, 1);
lemma_max_mag_pow2();
assert(r.n() == max_mag());
assert(r.d() == 1);
assert(gcd_int(r.n(), r.d()) == 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);
}
}