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 assms, 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 assms, 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} _+ \)proofassumes \( a \in \mathbb{Z} \), \( b \in \mathbb{Z} \)
shows \( a + b = a \ \$ + b \), \( a\cdot b = a \ \$ * b \)assumes \( m \leq n \)
shows \( m \ \$ \leq n \), \( m\in \mathbb{Z} \), \( n\in \mathbb{Z} \)assumes \( i \leq m \) and \( i\neq m \)
shows \( i \ \$ \lt m \)assumes \( m\in \mathbb{Z} \), \( n\in \mathbb{Z} \) and \( m \ \$ \leq n \)
shows \( m \leq n \)assumes \( m\in \mathbb{Z} \), \( n\in \mathbb{Z} \) and \( m \ \$ \lt n \)
shows \( m\leq n \), \( m \neq n \)assumes \( m \leq L \)
shows \( m = L \vee m + 1 \leq L \), \( m = L \vee m \leq L - 1 \)assumes \( m\in \mathbb{Z} \), \( n\in \mathbb{Z} \)
shows \( m = n\cdot (m\text{ zdiv }n) + (m\text{ zmod }n) \)assumes \( x\in \mathbb{Z} \), \( y\in \mathbb{Z} \)
shows \( x + y = y + x \), \( x\cdot y = y\cdot x \)assumes \( m\in \mathbb{Z} \) and \( 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 \)assumes \( m \leq k \) and \( 0 \leq n \), \( n\neq 0 \)
shows \( m\text{ zdiv }n \leq k\text{ zdiv }n \)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 \)assumes \( a \in \mathbb{Z} _+ \) and \( a\leq b \)
shows \( b \in \mathbb{Z} _+ \)