This theory translates some results form the Isabelle's IntDiv.thy theory to the notation used by IsarMathLib.
For any integers \(m,n\) , \(n>0\) there are unique integers \(q,p\) such that \(0\leq p < n\) and \(m = n\cdot q + p\). Number \(p\) in this decompsition is usually called \(m\) mod \(n\). Standard Isabelle denotes numbers \(q,p\) as m zdiv n and m zmod n, resp., and we will use the same notation.
The next lemma is sometimes called the "quotient-reminder theorem".
lemma (in int0) IntDiv_ZF_1_L1:
assumes \( m\in \mathbb{Z} \), \( n\in \mathbb{Z} \)
shows \( m = n\cdot (m\text{ zdiv }n) + (m\text{ zmod }n) \) using prems , Int_ZF_1_L2 , raw_zmod_zdiv_equalityIf \(n\) is greater than \(0\) then m zmod n is between \(0\) and \(n-1\).
lemma (in int0) IntDiv_ZF_1_L2:
assumes A1: \( m\in \mathbb{Z} \) and A2: \( 0 \leq n \), \( n\neq 0 \)
shows \( 0 \leq m\text{ zmod }n \), \( m\text{ zmod }n \leq n \), \( m\text{ zmod }n \neq n \), \( m\text{ zmod }n \leq n - 1 \)proof\((m\cdot k)\) div \(k = m\).
lemma (in int0) IntDiv_ZF_1_L3:
assumes \( m\in \mathbb{Z} \), \( k\in \mathbb{Z} \) and \( k\neq 0 \)
shows \( (m\cdot k)\text{ zdiv }k = m \), \( (k\cdot m)\text{ zdiv }k = m \) using prems , zdiv_zmult_self1 , zdiv_zmult_self2 , Int_ZF_1_L8 , Int_ZF_1_L2The next lemma essentially translates zdiv_mono1 from standard Isabelle to our notation.
lemma (in int0) IntDiv_ZF_1_L4:
assumes A1: \( m \leq k \) and A2: \( 0 \leq n \), \( n\neq 0 \)
shows \( m\text{ zdiv }n \leq k\text{ zdiv }n \)proofA quotient-reminder theorem about integers greater than a given product.
lemma (in int0) IntDiv_ZF_1_L5:
assumes A1: \( n \in \mathbb{Z} _+ \) and A2: \( n \leq k \) and A3: \( k\cdot n \leq m \)
shows \( m = n\cdot (m\text{ zdiv }n) + (m\text{ zmod }n) \), \( m = (m\text{ zdiv }n)\cdot n + (m\text{ zmod }n) \), \( (m\text{ zmod }n) \in 0 .\ .\ (n - 1 ) \), \( k \leq (m\text{ zdiv }n) \), \( m\text{ zdiv }n \in \mathbb{Z} _+ \)proof