l3lab/ntp-mathlib huggingface dataset:
instance instCommRingInt : CommRing ℤ where
  zero_mul := Int.zero_mul
  mul_zero := Int.mul_zero
  mul_comm := Int.mul_comm
  left_distrib := Int.mul_add
  right_distrib := Int.add_mul
  mul_one := Int.mul_one
  one_mul := Int.one_mul
  npow n x := x ^ n
  npow_zero _ := rfl
  npow_succ _ _ := by 

Proof state:
x✝¹ : ℕ
x✝ : ℤ
⊢ (fun n x => x ^ n) (x✝¹ + 1) x✝ = x✝ * (fun n x => x ^ n) x✝¹ x✝

Next tactic:
rw [Int.mul_comm]
instance instCommRingInt : CommRing ℤ where
  zero_mul := Int.zero_mul
  mul_zero := Int.mul_zero
  mul_comm := Int.mul_comm
  left_distrib := Int.mul_add
  right_distrib := Int.add_mul
  mul_one := Int.mul_one
  one_mul := Int.one_mul
  npow n x := x ^ n
  npow_zero _ := rfl
  npow_succ _ _ := by rw [Int.mul_comm]; 

Proof state:
x✝¹ : ℕ
x✝ : ℤ
⊢ (fun n x => x ^ n) (x✝¹ + 1) x✝ = (fun n x => x ^ n) x✝¹ x✝ * x✝

Next tactic:
rfl
instance instCommRingInt : CommRing ℤ where
  zero_mul := Int.zero_mul
  mul_zero := Int.mul_zero
  mul_comm := Int.mul_comm
  left_distrib := Int.mul_add
  right_distrib := Int.add_mul
  mul_one := Int.mul_one
  one_mul := Int.one_mul
  npow n x := x ^ n
  npow_zero _ := rfl
  npow_succ _ _ := by rw [Int.mul_comm]; rfl
  mul_assoc := Int.mul_assoc
  add_comm := Int.add_comm
  add_assoc := Int.add_assoc
  add_zero := Int.add_zero
  zero_add := Int.zero_add
  add_left_neg := Int.add_left_neg
  nsmul := (·*·)
  nsmul_zero := Int.zero_mul
  nsmul_succ n x :=
    show (n + 1 : ℤ) * x = x + n * x
    by rw [Int.add_mul, Int.add_comm, Int.one_mul]
  zsmul := (·*·)
  zsmul_zero' := Int.zero_mul
  zsmul_succ' m n := by
    

Proof state:
m : ℕ
n : ℤ
⊢ (fun x x_1 => x * x_1) (ofNat (succ m)) n = n + (fun x x_1 => x * x_1) (ofNat m) n

Next tactic:
simp only [ofNat_eq_coe, ofNat_succ, Int.add_mul, Int.add_comm, Int.one_mul]
instance instCommRingInt : CommRing ℤ where
  zero_mul := Int.zero_mul
  mul_zero := Int.mul_zero
  mul_comm := Int.mul_comm
  left_distrib := Int.mul_add
  right_distrib := Int.add_mul
  mul_one := Int.mul_one
  one_mul := Int.one_mul
  npow n x := x ^ n
  npow_zero _ := rfl
  npow_succ _ _ := by rw [Int.mul_comm]; rfl
  mul_assoc := Int.mul_assoc
  add_comm := Int.add_comm
  add_assoc := Int.add_assoc
  add_zero := Int.add_zero
  zero_add := Int.zero_add
  add_left_neg := Int.add_left_neg
  nsmul := (·*·)
  nsmul_zero := Int.zero_mul
  nsmul_succ n x :=
    show (n + 1 : ℤ) * x = x + n * x
    by rw [Int.add_mul, Int.add_comm, Int.one_mul]
  zsmul := (·*·)
  zsmul_zero' := Int.zero_mul
  zsmul_succ' m n := by
    simp only [ofNat_eq_coe, ofNat_succ, Int.add_mul, Int.add_comm, Int.one_mul]
  zsmul_neg' m n := by 

Proof state:
m : ℕ
n : ℤ
⊢ (fun x x_1 => x * x_1) -[m+1] n = -(fun x x_1 => x * x_1) (↑(succ m)) n

Next tactic:
simp only [negSucc_coe, ofNat_succ, Int.neg_mul]
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  

Proof state:
α : Type u_1
inst✝ : NonAssocRing α
m : ℤ
⊢ ∀ (n : ℤ), ↑(m * n) = ↑m * ↑n

Next tactic:
obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · 

Proof state:
case intro.inl
α : Type u_1
inst✝ : NonAssocRing α
m : ℕ
⊢ ∀ (n : ℤ), ↑(↑m * n) = ↑↑m * ↑n

Next tactic:
induction m with
    | zero => simp
    | succ m ih => simp_all [add_mul]
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    

Proof state:
case intro.inl.zero
α : Type u_1
inst✝ : NonAssocRing α
⊢ ∀ (n : ℤ), ↑(↑zero * n) = ↑↑zero * ↑n

Next tactic:
| zero => simp
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => 

Proof state:
case intro.inl.zero
α : Type u_1
inst✝ : NonAssocRing α
⊢ ∀ (n : ℤ), ↑(↑zero * n) = ↑↑zero * ↑n

Next tactic:
simp
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => simp
    

Proof state:
case intro.inl.succ
α : Type u_1
inst✝ : NonAssocRing α
m : ℕ
ih : ∀ (n : ℤ), ↑(↑m * n) = ↑↑m * ↑n
⊢ ∀ (n : ℤ), ↑(↑(succ m) * n) = ↑↑(succ m) * ↑n

Next tactic:
| succ m ih => simp_all [add_mul]
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => simp
    | succ m ih => 

Proof state:
case intro.inl.succ
α : Type u_1
inst✝ : NonAssocRing α
m : ℕ
ih : ∀ (n : ℤ), ↑(↑m * n) = ↑↑m * ↑n
⊢ ∀ (n : ℤ), ↑(↑(succ m) * n) = ↑↑(succ m) * ↑n

Next tactic:
simp_all [add_mul]
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => simp
    | succ m ih => simp_all [add_mul]
  · 

Proof state:
case intro.inr
α : Type u_1
inst✝ : NonAssocRing α
m : ℕ
⊢ ∀ (n : ℤ), ↑(-↑m * n) = ↑(-↑m) * ↑n

Next tactic:
induction m with
    | zero => simp
    | succ m ih => simp_all [add_mul]
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => simp
    | succ m ih => simp_all [add_mul]
  · induction m with
    

Proof state:
case intro.inr.zero
α : Type u_1
inst✝ : NonAssocRing α
⊢ ∀ (n : ℤ), ↑(-↑zero * n) = ↑(-↑zero) * ↑n

Next tactic:
| zero => simp
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => simp
    | succ m ih => simp_all [add_mul]
  · induction m with
    | zero => 

Proof state:
case intro.inr.zero
α : Type u_1
inst✝ : NonAssocRing α
⊢ ∀ (n : ℤ), ↑(-↑zero * n) = ↑(-↑zero) * ↑n

Next tactic:
simp
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => simp
    | succ m ih => simp_all [add_mul]
  · induction m with
    | zero => simp
    

Proof state:
case intro.inr.succ
α : Type u_1
inst✝ : NonAssocRing α
m : ℕ
ih : ∀ (n : ℤ), ↑(-↑m * n) = ↑(-↑m) * ↑n
⊢ ∀ (n : ℤ), ↑(-↑(succ m) * n) = ↑(-↑(succ m)) * ↑n

Next tactic:
| succ m ih => simp_all [add_mul]
@[simp, norm_cast]
theorem cast_mul [NonAssocRing α] : ∀ m n, ((m * n : ℤ) : α) = m * n := fun m => by
  obtain ⟨m, rfl | rfl⟩ := Int.eq_nat_or_neg m
  · induction m with
    | zero => simp
    | succ m ih => simp_all [add_mul]
  · induction m with
    | zero => simp
    | succ m ih => 

Proof state:
case intro.inr.succ
α : Type u_1
inst✝ : NonAssocRing α
m : ℕ
ih : ∀ (n : ℤ), ↑(-↑m * n) = ↑(-↑m) * ↑n
⊢ ∀ (n : ℤ), ↑(-↑(succ m) * n) = ↑(-↑(succ m)) * ↑n

Next tactic:
simp_all [add_mul]
instance : AddCommMonoid ℤ    := by 

Proof state:
⊢ AddCommMonoid ℤ

Next tactic:
infer_instance
instance : AddMonoid ℤ        := by 

Proof state:
⊢ AddMonoid ℤ

Next tactic:
infer_instance
instance : Monoid ℤ           := by 

Proof state:
⊢ Monoid ℤ

Next tactic:
infer_instance
instance : CommMonoid ℤ       := by 

Proof state:
⊢ CommMonoid ℤ

Next tactic:
infer_instance
instance : CommSemigroup ℤ    := by 

Proof state:
⊢ CommSemigroup ℤ

Next tactic:
infer_instance
instance : Semigroup ℤ        := by 

Proof state:
⊢ Semigroup ℤ

Next tactic:
infer_instance
instance : AddCommGroup ℤ     := by 

Proof state:
⊢ AddCommGroup ℤ

Next tactic:
infer_instance
instance : AddGroup ℤ         := by 

Proof state:
⊢ AddGroup ℤ

Next tactic:
infer_instance
instance : AddCommSemigroup ℤ := by 

Proof state:
⊢ AddCommSemigroup ℤ

Next tactic:
infer_instance
instance : AddSemigroup ℤ     := by 

Proof state:
⊢ AddSemigroup ℤ

Next tactic:
infer_instance
instance : CommSemiring ℤ     := by 

Proof state:
⊢ CommSemiring ℤ

Next tactic:
infer_instance
instance : Semiring ℤ         := by 

Proof state:
⊢ Semiring ℤ

Next tactic:
infer_instance
instance instRingInt : Ring ℤ             := by 

Proof state:
⊢ Ring ℤ

Next tactic:
infer_instance
instance : Distrib ℤ          := by 

Proof state:
⊢ Distrib ℤ

Next tactic:
infer_instance
theorem succ_neg_succ (a : ℤ) : succ (-succ a) = -a := by 

Proof state:
a : ℤ
⊢ succ (-succ a) = -a

Next tactic:
rw [neg_succ, succ_pred]
theorem neg_pred (a : ℤ) : -pred a = succ (-a) := by
  

Proof state:
a : ℤ
⊢ -pred a = succ (-a)

Next tactic:
rw [neg_eq_iff_eq_neg.mp (neg_succ (-a)), neg_neg]
theorem pred_neg_pred (a : ℤ) : pred (-pred a) = -a := by 

Proof state:
a : ℤ
⊢ pred (-pred a) = -a

Next tactic:
rw [neg_pred, pred_succ]
@[norm_cast] theorem coe_pred_of_pos {n : ℕ} (h : 0 < n) : ((n - 1 : ℕ) : ℤ) = (n : ℤ) - 1 := by
  

Proof state:
n : ℕ
h : 0 < n
⊢ ↑(n - 1) = ↑n - 1

Next tactic:
cases n
@[norm_cast] theorem coe_pred_of_pos {n : ℕ} (h : 0 < n) : ((n - 1 : ℕ) : ℤ) = (n : ℤ) - 1 := by
  cases n; 

Proof state:
case zero
h : 0 < zero
⊢ ↑(zero - 1) = ↑zero - 1
case succ n✝ : ℕ h : 0 < Nat.succ n✝ ⊢ ↑(Nat.succ n✝ - 1) = ↑(Nat.succ n✝) - 1

Next tactic:
cases h
@[norm_cast] theorem coe_pred_of_pos {n : ℕ} (h : 0 < n) : ((n - 1 : ℕ) : ℤ) = (n : ℤ) - 1 := by
  cases n; cases h; 

Proof state:
case succ
n✝ : ℕ
h : 0 < Nat.succ n✝
⊢ ↑(Nat.succ n✝ - 1) = ↑(Nat.succ n✝) - 1

Next tactic:
simp
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  

Proof state:
p : ℤ → Prop
i : ℤ
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
⊢ p i

Next tactic:
induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; induction n with
    | zero => simp [hz, Nat.cast_zero]
    | succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  

Proof state:
case ofNat
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (ofNat i)

Next tactic:
| ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    

Proof state:
case ofNat
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (ofNat i)

Next tactic:
induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    

Proof state:
case ofNat.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
⊢ p (ofNat zero)

Next tactic:
| zero => exact hz
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => 

Proof state:
case ofNat.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
⊢ p (ofNat zero)

Next tactic:
exact hz
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    

Proof state:
case ofNat.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
ih : p (ofNat i)
⊢ p (ofNat (Nat.succ i))

Next tactic:
| succ i ih => exact hp _ ih
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => 

Proof state:
case ofNat.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
ih : p (ofNat i)
⊢ p (ofNat (Nat.succ i))

Next tactic:
exact hp _ ih
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  

Proof state:
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p -[i+1]

Next tactic:
| negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; induction n with
    | zero => simp [hz, Nat.cast_zero]
    | succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    

Proof state:
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p -[i+1]

Next tactic:
suffices ∀ n : ℕ, p (-n) from this (i + 1)
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    

Proof state:
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ ∀ (n : ℕ), p (-↑n)

Next tactic:
intro n
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; 

Proof state:
case negSucc
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
⊢ p (-↑n)

Next tactic:
induction n with
    | zero => simp [hz, Nat.cast_zero]
    | succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; induction n with
    

Proof state:
case negSucc.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (-↑zero)

Next tactic:
| zero => simp [hz, Nat.cast_zero]
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; induction n with
    | zero => 

Proof state:
case negSucc.zero
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i : ℕ
⊢ p (-↑zero)

Next tactic:
simp [hz, Nat.cast_zero]
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; induction n with
    | zero => simp [hz, Nat.cast_zero]
    

Proof state:
case negSucc.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
ih : p (-↑n)
⊢ p (-↑(Nat.succ n))

Next tactic:
| succ n ih => convert hn _ ih using 1; simp [sub_eq_neg_add]
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; induction n with
    | zero => simp [hz, Nat.cast_zero]
    | succ n ih => 

Proof state:
case negSucc.succ
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
ih : p (-↑n)
⊢ p (-↑(Nat.succ n))

Next tactic:
convert hn _ ih using 1
@[elab_as_elim] protected theorem induction_on {p : ℤ → Prop} (i : ℤ)
    (hz : p 0) (hp : ∀ i : ℕ, p i → p (i + 1)) (hn : ∀ i : ℕ, p (-i) → p (-i - 1)) : p i := by
  induction i with
  | ofNat i =>
    induction i with
    | zero => exact hz
    | succ i ih => exact hp _ ih
  | negSucc i =>
    suffices ∀ n : ℕ, p (-n) from this (i + 1)
    intro n; induction n with
    | zero => simp [hz, Nat.cast_zero]
    | succ n ih => convert hn _ ih using 1; 

Proof state:
case h.e'_1
p : ℤ → Prop
hz : p 0
hp : ∀ (i : ℕ), p ↑i → p (↑i + 1)
hn : ∀ (i : ℕ), p (-↑i) → p (-↑i - 1)
i n : ℕ
ih : p (-↑n)
⊢ -↑(Nat.succ n) = -↑n - 1

Next tactic:
simp [sub_eq_neg_add]
theorem ediv_of_neg_of_pos {a b : ℤ} (Ha : a < 0) (Hb : 0 < b) : ediv a b = -((-a - 1) / b + 1) :=
  match a, b, eq_negSucc_of_lt_zero Ha, eq_succ_of_zero_lt Hb with
  | _, _, ⟨m, rfl⟩, ⟨n, rfl⟩ => by
    

Proof state:
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ ediv -[m+1] ↑(Nat.succ n) = -((- -[m+1] - 1) / ↑(Nat.succ n) + 1)

Next tactic:
rw [show (- -[m+1] : ℤ) = (m + 1 : ℤ) by rfl]
theorem ediv_of_neg_of_pos {a b : ℤ} (Ha : a < 0) (Hb : 0 < b) : ediv a b = -((-a - 1) / b + 1) :=
  match a, b, eq_negSucc_of_lt_zero Ha, eq_succ_of_zero_lt Hb with
  | _, _, ⟨m, rfl⟩, ⟨n, rfl⟩ => by
    rw [show (- -[m+1] : ℤ) = (m + 1 : ℤ) by 

Proof state:
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ - -[m+1] = ↑m + 1

Next tactic:
rfl
theorem ediv_of_neg_of_pos {a b : ℤ} (Ha : a < 0) (Hb : 0 < b) : ediv a b = -((-a - 1) / b + 1) :=
  match a, b, eq_negSucc_of_lt_zero Ha, eq_succ_of_zero_lt Hb with
  | _, _, ⟨m, rfl⟩, ⟨n, rfl⟩ => by
    rw [show (- -[m+1] : ℤ) = (m + 1 : ℤ) by rfl]; 

Proof state:
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ ediv -[m+1] ↑(Nat.succ n) = -((↑m + 1 - 1) / ↑(Nat.succ n) + 1)

Next tactic:
rw [add_sub_cancel]
theorem ediv_of_neg_of_pos {a b : ℤ} (Ha : a < 0) (Hb : 0 < b) : ediv a b = -((-a - 1) / b + 1) :=
  match a, b, eq_negSucc_of_lt_zero Ha, eq_succ_of_zero_lt Hb with
  | _, _, ⟨m, rfl⟩, ⟨n, rfl⟩ => by
    rw [show (- -[m+1] : ℤ) = (m + 1 : ℤ) by rfl]; rw [add_sub_cancel]; 

Proof state:
a b : ℤ
m n : ℕ
Ha : -[m+1] < 0
Hb : 0 < ↑(Nat.succ n)
⊢ ediv -[m+1] ↑(Nat.succ n) = -(↑m / ↑(Nat.succ n) + 1)

Next tactic:
rfl
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
    (⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
s : (i : ι) → i ∈ S → Set α
⊢ ⋂ i, ⋂ (hi : i ∈ S), s i hi ∈ l ↔ ∀ (i : ι) (hi : i ∈ S), s i hi ∈ l

Next tactic:
rw [biInter_eq_iInter]
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
    (⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
  rw [biInter_eq_iInter]
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
s : (i : ι) → i ∈ S → Set α
⊢ ⋂ x, s ↑x (_ : ↑x ∈ S) ∈ l ↔ ∀ (i : ι) (hi : i ∈ S), s i hi ∈ l

Next tactic:
haveI := hS.toEncodable
theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} :
    (⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by
  rw [biInter_eq_iInter]
  haveI := hS.toEncodable
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
s : (i : ι) → i ∈ S → Set α
this : Encodable ↑S
⊢ ⋂ x, s ↑x (_ : ↑x ∈ S) ∈ l ↔ ∀ (i : ι) (hi : i ∈ S), s i hi ∈ l

Next tactic:
exact countable_iInter_mem.trans Subtype.forall
theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} :
    (∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i := by
  

Proof state:
ι : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝¹ : CountableInterFilter l
inst✝ : Countable ι
p : α → ι → Prop
⊢ (∀ᶠ (x : α) in l, ∀ (i : ι), p x i) ↔ ∀ (i : ι), ∀ᶠ (x : α) in l, p x i

Next tactic:
simpa only [Filter.Eventually, setOf_forall] using
    @countable_iInter_mem _ _ l _ _ fun i => { x | p x i }
theorem eventually_countable_ball {ι : Type*} {S : Set ι} (hS : S.Countable)
    {p : α → ∀ i ∈ S, Prop} :
    (∀ᶠ x in l, ∀ i hi, p x i hi) ↔ ∀ i hi, ∀ᶠ x in l, p x i hi := by
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
p : α → (i : ι) → i ∈ S → Prop
⊢ (∀ᶠ (x : α) in l, ∀ (i : ι) (hi : i ∈ S), p x i hi) ↔ ∀ (i : ι) (hi : i ∈ S), ∀ᶠ (x : α) in l, p x i hi

Next tactic:
simpa only [Filter.Eventually, setOf_forall] using
    @countable_bInter_mem _ l _ _ _ hS fun i hi => { x | p x i hi }
theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
    ⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_› := by
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
s t : (i : ι) → i ∈ S → Set α
h : ∀ (i : ι) (hi : i ∈ S), s i hi ≤ᶠ[l] t i hi
⊢ ⋃ i, ⋃ (h : i ∈ S), s i h ≤ᶠ[l] ⋃ i, ⋃ (h : i ∈ S), t i h

Next tactic:
simp only [biUnion_eq_iUnion]
theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
    ⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_› := by
  simp only [biUnion_eq_iUnion]
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
s t : (i : ι) → i ∈ S → Set α
h : ∀ (i : ι) (hi : i ∈ S), s i hi ≤ᶠ[l] t i hi
⊢ ⋃ x, s ↑x (_ : ↑x ∈ S) ≤ᶠ[l] ⋃ x, t ↑x (_ : ↑x ∈ S)

Next tactic:
haveI := hS.toEncodable
theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
    ⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_› := by
  simp only [biUnion_eq_iUnion]
  haveI := hS.toEncodable
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
s t : (i : ι) → i ∈ S → Set α
h : ∀ (i : ι) (hi : i ∈ S), s i hi ≤ᶠ[l] t i hi
this : Encodable ↑S
⊢ ⋃ x, s ↑x (_ : ↑x ∈ S) ≤ᶠ[l] ⋃ x, t ↑x (_ : ↑x ∈ S)

Next tactic:
exact EventuallyLE.countable_iUnion fun i => h i i.2
theorem EventuallyLE.countable_bInter {ι : Type*} {S : Set ι} (hS : S.Countable)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
    ⋂ i ∈ S, s i ‹_› ≤ᶠ[l] ⋂ i ∈ S, t i ‹_› := by
  

Proof state:
ι✝ : Sort u_1
α : Type u_2
β : Type u_3
l : Filter α
inst✝ : CountableInterFilter l
ι : Type u_4
S : Set ι
hS : Set.Countable S
s t : (i : ι) → i ∈ S → Set α
h : ∀ (i : ι) (hi : i ∈ S), s i hi ≤ᶠ[l] t i hi
⊢ ⋂ i, ⋂ (h : i ∈ S), s i h ≤ᶠ[l] ⋂ i, ⋂ (h : i ∈ S), t i h

Next tactic:
simp only [biInter_eq_iInter]