mirror of
https://github.com/Kindelia/Kind2.git
synced 2024-09-11 07:15:45 +03:00
proove Nat.mod is small
This commit is contained in:
parent
41a0703a14
commit
fe95f53a7d
@ -1,5 +1,35 @@
|
||||
Nat.mod.small(
|
||||
//Nat.mod.small(
|
||||
// n: Nat
|
||||
// m: Nat
|
||||
// Hyp: Equal<Bool>(Nat.lte(1, m), true)
|
||||
//): Equal<Bool>(Nat.lte(m, Nat.mod(n, m)), false)
|
||||
// ?mod.small.body
|
||||
|
||||
Nat.mod.small.aux(
|
||||
n: Nat
|
||||
m: Nat
|
||||
): ?mod.small.type
|
||||
?mod.small.body
|
||||
d: Nat
|
||||
r: Nat
|
||||
Hyp: Equal<Bool>(Nat.lte(1, n), true)
|
||||
): Equal<Bool>(Nat.lte(n, Pair.snd<Nat, Nat>(Nat.div_mod.go(n, d, r))), false)
|
||||
def cmp = Nat.lte(n, r)
|
||||
let cmp_eq = refl :: cmp == cmp
|
||||
case cmp with cmp_eq : cmp^ == cmp {
|
||||
true:
|
||||
Nat.mod.small.aux(n, Nat.succ(d), Nat.sub(r, n), Hyp)
|
||||
false:
|
||||
cmp_eq
|
||||
}! ::
|
||||
Equal<Bool>(
|
||||
Nat.lte(
|
||||
n
|
||||
Pair.snd(
|
||||
Nat, Nat
|
||||
cmp(
|
||||
() Pair(Nat,Nat)
|
||||
Nat.div_mod.go(n,Nat.succ(d),Nat.sub(r,n))
|
||||
Pair.new(Nat,Nat,d,r)
|
||||
)
|
||||
)
|
||||
)
|
||||
Bool.false
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user