m n r : ℤ
⊢ (∃ a, m + ↑a < n ∧ m + ↑a = r) ↔ m ≤ r ∧ r < n
m n r : ℤ
⊢ r ∈ range m n ↔ m ≤ r ∧ r < n
simp only [range, List.mem_map, List.mem_range, lt_toNat, lt_sub_iff_add_lt, add_comm]
no goals
m n r : ℤ
⊢ (∃ a, m + ↑a < n ∧ m + ↑a = r) ↔ m ≤ r ∧ r < n
exact ⟨fun ⟨a, ha⟩ => ha.2 ▸ ⟨le_add_of_nonneg_right (Int.coe_nat_nonneg _), ha.1⟩,
  fun h => ⟨toNat (r - m), by simp [toNat_of_nonneg (sub_nonneg.2 h.1), h.2] ⟩⟩
no goals
m n r : ℤ
h : m ≤ r ∧ r < n
⊢ m + ↑(toNat (r - m)) < n ∧ m + ↑(toNat (r - m)) = r
simp [toNat_of_nonneg (sub_nonneg.2 h.1), h.2]