File: Mathlib/Data/Int/ModEq.lean

full_name: Int.ModEq
code: /-- `a ≡ b [ZMOD n]` when `a % n = b % n`. -/
def ModEq (n a b : ℤ) 
goal: Prop

full_name: Int._aux_Mathlib_Data_Int_ModEq___unexpand_Int_ModEq_1
code: @[inherit_doc]
notation:50 a " ≡ " b " [ZMOD " n "]" => ModEq n a b
goal: Lean.PrettyPrinter.Unexpander

full_name: Int.«_aux_Mathlib_Data_Int_ModEq___macroRules_Int_term_≡_[ZMOD_]_1»
code: @[inherit_doc]
notation:50 a " ≡ " b " [ZMOD " n "]" => ModEq n a b
goal: Lean.Macro

full_name: Int.instDecidableModEq
code: instance : Decidable (ModEq n a b) 
goal: Decidable (a ≡ b [ZMOD n])

full_name: Int.ModEq.refl
code: @[refl, simp]
protected theorem refl (a : ℤ) : a ≡ a [ZMOD n] 
goal: a ≡ a [ZMOD n]

full_name: Int.ModEq.rfl
code: protected theorem rfl : a ≡ a [ZMOD n] 
goal: a ≡ a [ZMOD n]

full_name: Int.ModEq.instIsRefl
code: instance : IsRefl _ (ModEq n) 
goal: IsRefl ℤ n.ModEq

full_name: Int.ModEq.symm
code: @[symm]
protected theorem symm : a ≡ b [ZMOD n] → b ≡ a [ZMOD n] 
goal: a ≡ b [ZMOD n] → b ≡ a [ZMOD n]

full_name: Int.ModEq.trans
code: @[trans]
protected theorem trans : a ≡ b [ZMOD n] → b ≡ c [ZMOD n] → a ≡ c [ZMOD n] 
goal: a ≡ b [ZMOD n] → b ≡ c [ZMOD n] → a ≡ c [ZMOD n]

full_name: Int.ModEq.instIsTrans
code: instance : IsTrans ℤ (ModEq n) 
goal: IsTrans ℤ n.ModEq

full_name: Int.ModEq.eq
code: protected theorem eq : a ≡ b [ZMOD n] → a % n = b % n 
goal: a ≡ b [ZMOD n] → a % n = b % n

full_name: Int.modEq_comm
code: theorem modEq_comm : a ≡ b [ZMOD n] ↔ b ≡ a [ZMOD n] 
goal: a ≡ b [ZMOD n] ↔ b ≡ a [ZMOD n]

full_name: Int.natCast_modEq_iff
code: theorem natCast_modEq_iff {a b n : ℕ} : a ≡ b [ZMOD n] ↔ a ≡ b [MOD n] 
goal: ↑a ≡ ↑b [ZMOD ↑n] ↔ a ≡ b [MOD n]

full_name: Int.modEq_zero_iff_dvd
code: theorem modEq_zero_iff_dvd : a ≡ 0 [ZMOD n] ↔ n ∣ a 
goal: a ≡ 0 [ZMOD n] ↔ n ∣ a

full_name: Dvd.dvd.modEq_zero_int
code: theorem _root_.Dvd.dvd.modEq_zero_int (h : n ∣ a) : a ≡ 0 [ZMOD n] 
goal: a ≡ 0 [ZMOD n]

full_name: Dvd.dvd.zero_modEq_int
code: theorem _root_.Dvd.dvd.zero_modEq_int (h : n ∣ a) : 0 ≡ a [ZMOD n] 
goal: 0 ≡ a [ZMOD n]

full_name: Int.modEq_iff_dvd
code: theorem modEq_iff_dvd : a ≡ b [ZMOD n] ↔ n ∣ b - a 
goal: a ≡ b [ZMOD n] ↔ n ∣ b - a

full_name: Int.modEq_iff_add_fac
code: theorem modEq_iff_add_fac {a b n : ℤ} : a ≡ b [ZMOD n] ↔ ∃ t, b = a + n * t 
goal: a ≡ b [ZMOD n] ↔ ∃ t, b = a + n * t

full_name: Int.mod_modEq
code: theorem mod_modEq (a n) : a % n ≡ a [ZMOD n] 
goal: a % n ≡ a [ZMOD n]

full_name: Int.neg_modEq_neg
code: @[simp]
theorem neg_modEq_neg : -a ≡ -b [ZMOD n] ↔ a ≡ b [ZMOD n] 
goal: -a ≡ -b [ZMOD n] ↔ a ≡ b [ZMOD n]

full_name: Int.modEq_neg
code: @[simp]
theorem modEq_neg : a ≡ b [ZMOD -n] ↔ a ≡ b [ZMOD n] 
goal: a ≡ b [ZMOD -n] ↔ a ≡ b [ZMOD n]

full_name: Int.ModEq.of_dvd
code: protected theorem of_dvd (d : m ∣ n) (h : a ≡ b [ZMOD n]) : a ≡ b [ZMOD m] 
goal: a ≡ b [ZMOD m]

full_name: Int.ModEq.mul_left'
code: protected theorem mul_left' (h : a ≡ b [ZMOD n]) : c * a ≡ c * b [ZMOD c * n] 
goal: c * a ≡ c * b [ZMOD c * n]

full_name: Int.ModEq.mul_right'
code: protected theorem mul_right' (h : a ≡ b [ZMOD n]) : a * c ≡ b * c [ZMOD n * c] 
goal: a * c ≡ b * c [ZMOD n * c]

full_name: Int.ModEq.add
code: @[gcongr]
protected theorem add (h₁ : a ≡ b [ZMOD n]) (h₂ : c ≡ d [ZMOD n]) : a + c ≡ b + d [ZMOD n] 
goal: a + c ≡ b + d [ZMOD n]

full_name: Int.ModEq.add_left
code: @[gcongr] protected theorem add_left (c : ℤ) (h : a ≡ b [ZMOD n]) : c + a ≡ c + b [ZMOD n] 
goal: c + a ≡ c + b [ZMOD n]

full_name: Int.ModEq.add_right
code: @[gcongr] protected theorem add_right (c : ℤ) (h : a ≡ b [ZMOD n]) : a + c ≡ b + c [ZMOD n] 
goal: a + c ≡ b + c [ZMOD n]

full_name: Int.ModEq.add_left_cancel
code: protected theorem add_left_cancel (h₁ : a ≡ b [ZMOD n]) (h₂ : a + c ≡ b + d [ZMOD n]) :
    c ≡ d [ZMOD n] 
goal: c ≡ d [ZMOD n]

full_name: Int.ModEq.add_left_cancel'
code: protected theorem add_left_cancel' (c : ℤ) (h : c + a ≡ c + b [ZMOD n]) : a ≡ b [ZMOD n] 
goal: a ≡ b [ZMOD n]

full_name: Int.ModEq.add_right_cancel
code: protected theorem add_right_cancel (h₁ : c ≡ d [ZMOD n]) (h₂ : a + c ≡ b + d [ZMOD n]) :
    a ≡ b [ZMOD n] 
goal: a ≡ b [ZMOD n]

full_name: Int.ModEq.add_right_cancel'
code: protected theorem add_right_cancel' (c : ℤ) (h : a + c ≡ b + c [ZMOD n]) : a ≡ b [ZMOD n] 
goal: a ≡ b [ZMOD n]

full_name: Int.ModEq.neg
code: @[gcongr] protected theorem neg (h : a ≡ b [ZMOD n]) : -a ≡ -b [ZMOD n] 
goal: -a ≡ -b [ZMOD n]

full_name: Int.ModEq.sub
code: @[gcongr]
protected theorem sub (h₁ : a ≡ b [ZMOD n]) (h₂ : c ≡ d [ZMOD n]) : a - c ≡ b - d [ZMOD n] 
goal: a - c ≡ b - d [ZMOD n]

full_name: Int.ModEq.sub_left
code: @[gcongr] protected theorem sub_left (c : ℤ) (h : a ≡ b [ZMOD n]) : c - a ≡ c - b [ZMOD n] 
goal: c - a ≡ c - b [ZMOD n]

full_name: Int.ModEq.sub_right
code: @[gcongr] protected theorem sub_right (c : ℤ) (h : a ≡ b [ZMOD n]) : a - c ≡ b - c [ZMOD n] 
goal: a - c ≡ b - c [ZMOD n]

full_name: Int.ModEq.mul_left
code: @[gcongr] protected theorem mul_left (c : ℤ) (h : a ≡ b [ZMOD n]) : c * a ≡ c * b [ZMOD n] 
goal: c * a ≡ c * b [ZMOD n]

full_name: Int.ModEq.mul_right
code: @[gcongr] protected theorem mul_right (c : ℤ) (h : a ≡ b [ZMOD n]) : a * c ≡ b * c [ZMOD n] 
goal: a * c ≡ b * c [ZMOD n]

full_name: Int.ModEq.mul
code: @[gcongr]
protected theorem mul (h₁ : a ≡ b [ZMOD n]) (h₂ : c ≡ d [ZMOD n]) : a * c ≡ b * d [ZMOD n] 
goal: a * c ≡ b * d [ZMOD n]

full_name: Int.ModEq.pow
code: @[gcongr] protected theorem pow (m : ℕ) (h : a ≡ b [ZMOD n]) : a ^ m ≡ b ^ m [ZMOD n] 
goal: a ^ m ≡ b ^ m [ZMOD n]

full_name: Int.ModEq.of_mul_left
code: lemma of_mul_left (m : ℤ) (h : a ≡ b [ZMOD m * n]) : a ≡ b [ZMOD n] 
goal: a ≡ b [ZMOD n]

full_name: Int.ModEq.of_mul_right
code: lemma of_mul_right (m : ℤ) : a ≡ b [ZMOD n * m] → a ≡ b [ZMOD n] 
goal: a ≡ b [ZMOD n * m] → a ≡ b [ZMOD n]

full_name: Int.ModEq.cancel_right_div_gcd
code: /-- To cancel a common factor `c` from a `ModEq` we must divide the modulus `m` by `gcd m c`. -/
theorem cancel_right_div_gcd (hm : 0 < m) (h : a * c ≡ b * c [ZMOD m]) :
    a ≡ b [ZMOD m / gcd m c] 
goal: a ≡ b [ZMOD m / ↑(m.gcd c)]

full_name: Int.ModEq.cancel_left_div_gcd
code: /-- To cancel a common factor `c` from a `ModEq` we must divide the modulus `m` by `gcd m c`. -/
theorem cancel_left_div_gcd (hm : 0 < m) (h : c * a ≡ c * b [ZMOD m]) : a ≡ b [ZMOD m / gcd m c] 
goal: a ≡ b [ZMOD m / ↑(m.gcd c)]

full_name: Int.ModEq.of_div
code: theorem of_div (h : a / c ≡ b / c [ZMOD m / c]) (ha : c ∣ a) (ha : c ∣ b) (ha : c ∣ m) :
    a ≡ b [ZMOD m] 
goal: c ∣ b → c ∣ m → a ≡ b [ZMOD m]

full_name: Int.modEq_one
code: theorem modEq_one : a ≡ b [ZMOD 1] 
goal: a ≡ b [ZMOD 1]

full_name: Int.modEq_sub
code: theorem modEq_sub (a b : ℤ) : a ≡ b [ZMOD a - b] 
goal: a ≡ b [ZMOD a - b]

full_name: Int.modEq_zero_iff
code: @[simp]
theorem modEq_zero_iff : a ≡ b [ZMOD 0] ↔ a = b 
goal: a ≡ b [ZMOD 0] ↔ a = b

full_name: Int.add_modEq_left
code: @[simp]
theorem add_modEq_left : n + a ≡ a [ZMOD n] 
goal: n + a ≡ a [ZMOD n]

full_name: Int.add_modEq_right
code: @[simp]
theorem add_modEq_right : a + n ≡ a [ZMOD n] 
goal: a + n ≡ a [ZMOD n]

full_name: Int.modEq_and_modEq_iff_modEq_mul
code: theorem modEq_and_modEq_iff_modEq_mul {a b m n : ℤ} (hmn : m.natAbs.Coprime n.natAbs) :
    a ≡ b [ZMOD m] ∧ a ≡ b [ZMOD n] ↔ a ≡ b [ZMOD m * n] 
goal: a ≡ b [ZMOD m] ∧ a ≡ b [ZMOD n] ↔ a ≡ b [ZMOD m * n]

full_name: Int.gcd_a_modEq
code: theorem gcd_a_modEq (a b : ℕ) : (a : ℤ) * Nat.gcdA a b ≡ Nat.gcd a b [ZMOD b] 
goal: ↑a * a.gcdA b ≡ ↑(a.gcd b) [ZMOD ↑b]

full_name: Int.modEq_add_fac
code: theorem modEq_add_fac {a b n : ℤ} (c : ℤ) (ha : a ≡ b [ZMOD n]) : a + n * c ≡ b [ZMOD n] 
goal: a + n * c ≡ b [ZMOD n]

full_name: Int.modEq_sub_fac
code: theorem modEq_sub_fac {a b n : ℤ} (c : ℤ) (ha : a ≡ b [ZMOD n]) : a - n * c ≡ b [ZMOD n] 
goal: a - n * c ≡ b [ZMOD n]

full_name: Int.modEq_add_fac_self
code: theorem modEq_add_fac_self {a t n : ℤ} : a + n * t ≡ a [ZMOD n] 
goal: a + n * t ≡ a [ZMOD n]

full_name: Int.mod_coprime
code: theorem mod_coprime {a b : ℕ} (hab : Nat.Coprime a b) : ∃ y : ℤ, a * y ≡ 1 [ZMOD b] 
goal: ∃ y, ↑a * y ≡ 1 [ZMOD ↑b]

full_name: Int.exists_unique_equiv
code: theorem exists_unique_equiv (a : ℤ) {b : ℤ} (hb : 0 < b) :
    ∃ z : ℤ, 0 ≤ z ∧ z < b ∧ z ≡ a [ZMOD b] 
goal: ∃ z, 0 ≤ z ∧ z < b ∧ z ≡ a [ZMOD b]

full_name: Int.exists_unique_equiv_nat
code: theorem exists_unique_equiv_nat (a : ℤ) {b : ℤ} (hb : 0 < b) : ∃ z : ℕ, ↑z < b ∧ ↑z ≡ a [ZMOD b] 
goal: ∃ z, ↑z < b ∧ ↑z ≡ a [ZMOD b]

full_name: Int.mod_mul_right_mod
code: theorem mod_mul_right_mod (a b c : ℤ) : a % (b * c) % b = a % b 
goal: a % (b * c) % b = a % b

full_name: Int.mod_mul_left_mod
code: theorem mod_mul_left_mod (a b c : ℤ) : a % (b * c) % c = a % c 
goal: a % (b * c) % c = a % c