#[allow(unused_imports)]
use super::super::super::prelude::*;
verus! {
pub open spec fn modulus(x: int, y: int) -> int {
x % y
}
proof fn lemma_mod_of_zero_is_zero(m: int)
requires
0 < m,
ensures
0 as int % m == 0 as int,
{
}
#[verifier::nonlinear]
pub proof fn lemma_fundamental_div_mod(x: int, d: int)
requires
d != 0,
ensures
x == d * (x / d) + (x % d),
{
}
proof fn lemma_0_mod_anything()
ensures
forall|m: int| m > 0 ==> #[trigger] modulus(0, m) == 0,
{
}
#[verifier::nonlinear]
pub proof fn lemma_small_mod(x: nat, m: nat)
requires
x < m,
0 < m,
ensures
#[trigger] modulus(x as int, m as int) == x as int,
{
}
#[verifier::nonlinear]
pub proof fn lemma_mod_range(x: int, m: int)
requires
m > 0,
ensures
0 <= #[trigger] modulus(x, m) < m,
{
}
}