m n : Nat
⊢ ↑m % ↑(succ n) + -↑(succ n) * -↑(m / succ n) = ↑m
m n : Nat
⊢ ofNat m % -[n+1] + -[n+1] * (ofNat m / -[n+1]) = ofNat m
show (m % succ n + -↑(succ n) * -↑(m / succ n) : Int) = m
m n : Nat
⊢ ↑m % ↑(succ n) + ↑(succ n) * ↑(m / succ n) = ↑m
m n : Nat
⊢ ↑m % ↑(succ n) + -↑(succ n) * -↑(m / succ n) = ↑m
rw [Int.neg_mul_neg]
no goals
m n : Nat
⊢ ↑m % ↑(succ n) + ↑(succ n) * ↑(m / succ n) = ↑m
exact congrArg ofNat <| Nat.mod_add_div ..
a✝ : Nat
⊢ -[a✝+1] + 0 * (-[a✝+1] / 0) = -[a✝+1]
a✝ : Nat
⊢ -[a✝+1] % 0 + 0 * (-[a✝+1] / 0) = -[a✝+1]
rw [emod_zero]
no goals
a✝ : Nat
⊢ -[a✝+1] + 0 * (-[a✝+1] / 0) = -[a✝+1]
rfl
x✝¹ x✝ : Int
m n : Nat
⊢ -(↑(m % n) + ↑n * ↑(m / n) + 1) = -(↑m + 1)
x✝¹ x✝ : Int
m n : Nat
⊢ ↑n - (↑m % ↑n + 1) - (↑n * (↑m / ↑n) + ↑n) = -[m+1]
rw [← ofNat_emod, ← ofNat_ediv, ← Int.sub_sub, negSucc_eq, Int.sub_sub n,
  ← Int.neg_neg (_-_), Int.neg_sub, Int.sub_sub_self, Int.add_right_comm]
no goals
x✝¹ x✝ : Int
m n : Nat
⊢ -(↑(m % n) + ↑n * ↑(m / n) + 1) = -(↑m + 1)
exact congrArg (fun x => -(ofNat x + 1)) (Nat.mod_add_div ..)