If we have three integers a>0, b, ab>=0 such that a*b=ab, then b>=0 and if ab=0 then b=0, if ab>0 then ab>0.
What is the good way to implement this statement as a proof function in ATS?
I guess the proof function must be something like this:
prfn lemma_mul_gez
{a: pos}
{b: int}
{ab: nat}
( pf: MUL(a,b,ab) )
: [b >= 0; (ab == 0 && b == 0) || (ab > 0 && b > 0)] void
= (* ... implementation here ... *)
I was able to write a correct proof function. But my solution is quite long: