I have already have the following definition and notation:
Definition modulo (a b n : Z) : Prop := (n | (a - b)) .
Notation "( a == b [ n ])" := (modulo a b n) .
And following lemmas(all of them are already proved, ends up with Qed .):
Lemma modulo_refl : forall a n : Z, (a == a [ n ]) .
Lemma modulo_symm : forall a b n : Z, (a == b [ n ]) -> (b == a [ n ]) .
Lemma modulo_tran : forall a b c n : Z, (a == b [ n ]) -> (b == c [ n ]) -> (a == c [ n ]) .
Lemma modulo_plus_comm : forall a b n : Z, (a + b == b + a [ n ]) .
Lemma modulo_plus_assoc : forall a b c n : Z, (a + b + c == a + (b + c) [ n ]) .
Lemma modulo_plus_subst : forall a b c n : Z, (a == b [ n ]) -> (a + c == b + c [ n ]) .
Now I want to prove the ChineseRemainderTheorem:
Hypothesis m n : Z .
Hypothesis co_prime : rel_prime m n .
Theorem modulo_inv : forall m n : Z, rel_prime m n -> exists x : Z, (m * x == 1 [ n ]) .
Theorem ChineseRemainderTheorem : forall a b : Z, exists x : Z, (x == a [ m ]) /\ (x == b [ n ]) .
How can I do this?
You already have those definitions in the standard library, file
Require Import ZArith.Znumtheory.. Then we could prove the Chinese remainder theorem like this