l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem Ioi_zero_eq_map : Ioi (0 : Fin n.succ) = univ.map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_Ioi, mem_map, mem_univ, Function.Embedding.coeFn_mk, exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · 

Proof state:
case a.mp.refine'_2
α : Type u_1
β : Type u_2
n : ℕ
i : Fin (Nat.succ n)
⊢ ∀ (i : Fin n), 0 < succ i → ∃ a, True ∧ (succEmbedding n).toEmbedding a = succ i

Next tactic:
intro j _
@[simp]
theorem Ioi_zero_eq_map : Ioi (0 : Fin n.succ) = univ.map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_Ioi, mem_map, mem_univ, Function.Embedding.coeFn_mk, exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · intro j _
      

Proof state:
case a.mp.refine'_2
α : Type u_1
β : Type u_2
n : ℕ
i : Fin (Nat.succ n)
j : Fin n
a✝ : 0 < succ j
⊢ ∃ a, True ∧ (succEmbedding n).toEmbedding a = succ j

Next tactic:
use j
@[simp]
theorem Ioi_zero_eq_map : Ioi (0 : Fin n.succ) = univ.map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_Ioi, mem_map, mem_univ, Function.Embedding.coeFn_mk, exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · intro j _
      use j
      

Proof state:
case h
α : Type u_1
β : Type u_2
n : ℕ
i : Fin (Nat.succ n)
j : Fin n
a✝ : 0 < succ j
⊢ True ∧ (succEmbedding n).toEmbedding j = succ j

Next tactic:
simp only [val_succEmbedding, and_self, RelEmbedding.coe_toEmbedding]
@[simp]
theorem Ioi_zero_eq_map : Ioi (0 : Fin n.succ) = univ.map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_Ioi, mem_map, mem_univ, Function.Embedding.coeFn_mk, exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · intro j _
      use j
      simp only [val_succEmbedding, and_self, RelEmbedding.coe_toEmbedding]
  · 

Proof state:
case a.mpr
α : Type u_1
β : Type u_2
n : ℕ
i : Fin (Nat.succ n)
⊢ (∃ a, True ∧ (succEmbedding n).toEmbedding a = i) → 0 < i

Next tactic:
rintro ⟨i, _, rfl⟩
@[simp]
theorem Ioi_zero_eq_map : Ioi (0 : Fin n.succ) = univ.map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_Ioi, mem_map, mem_univ, Function.Embedding.coeFn_mk, exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · intro j _
      use j
      simp only [val_succEmbedding, and_self, RelEmbedding.coe_toEmbedding]
  · rintro ⟨i, _, rfl⟩
    

Proof state:
case a.mpr.intro.intro
α : Type u_1
β : Type u_2
n : ℕ
i : Fin n
left✝ : True
⊢ 0 < (succEmbedding n).toEmbedding i

Next tactic:
exact succ_pos _
@[simp]
theorem Iio_last_eq_map : Iio (Fin.last n) = Finset.univ.map Fin.castSuccEmb.toEmbedding := by
  

Proof state:
α : Type u_1
β : Type u_2
n : ℕ
⊢ Iio (last n) = map castSuccEmb.toEmbedding univ

Next tactic:
apply Finset.map_injective Fin.valEmbedding
@[simp]
theorem Iio_last_eq_map : Iio (Fin.last n) = Finset.univ.map Fin.castSuccEmb.toEmbedding := by
  apply Finset.map_injective Fin.valEmbedding
  

Proof state:
case a
α : Type u_1
β : Type u_2
n : ℕ
⊢ map valEmbedding (Iio (last n)) = map valEmbedding (map castSuccEmb.toEmbedding univ)

Next tactic:
rw [Finset.map_map, Fin.map_valEmbedding_Iio, Fin.val_last]
@[simp]
theorem Iio_last_eq_map : Iio (Fin.last n) = Finset.univ.map Fin.castSuccEmb.toEmbedding := by
  apply Finset.map_injective Fin.valEmbedding
  rw [Finset.map_map, Fin.map_valEmbedding_Iio, Fin.val_last]
  

Proof state:
case a
α : Type u_1
β : Type u_2
n : ℕ
⊢ Iio n = map (Function.Embedding.trans castSuccEmb.toEmbedding valEmbedding) univ

Next tactic:
exact map_valEmbedding_univ.symm
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  

Proof state:
α : Type u_1
β : Type u_2
n : ℕ
i : Fin n
⊢ Ioi (succ i) = map (succEmbedding n).toEmbedding (Ioi i)

Next tactic:
ext i
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  

Proof state:
case a
α : Type u_1
β : Type u_2
n : ℕ
i✝ : Fin n
i : Fin (Nat.succ n)
⊢ i ∈ Ioi (succ i✝) ↔ i ∈ map (succEmbedding n).toEmbedding (Ioi i✝)

Next tactic:
simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
  

Proof state:
case a
α : Type u_1
β : Type u_2
n : ℕ
i✝ : Fin n
i : Fin (Nat.succ n)
⊢ succ i✝ < i ↔ ∃ a, i✝ < a ∧ (succEmbedding n).toEmbedding a = i

Next tactic:
constructor
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
  constructor
  · 

Proof state:
case a.mp
α : Type u_1
β : Type u_2
n : ℕ
i✝ : Fin n
i : Fin (Nat.succ n)
⊢ succ i✝ < i → ∃ a, i✝ < a ∧ (succEmbedding n).toEmbedding a = i

Next tactic:
refine' cases _ _ i
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
  constructor
  · refine' cases _ _ i
    · 

Proof state:
case a.mp.refine'_1
α : Type u_1
β : Type u_2
n : ℕ
i✝ : Fin n
i : Fin (Nat.succ n)
⊢ succ i✝ < 0 → ∃ a, i✝ < a ∧ (succEmbedding n).toEmbedding a = 0

Next tactic:
rintro ⟨⟨⟩⟩
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · 

Proof state:
case a.mp.refine'_2
α : Type u_1
β : Type u_2
n : ℕ
i✝ : Fin n
i : Fin (Nat.succ n)
⊢ ∀ (i : Fin n), succ i✝ < succ i → ∃ a, i✝ < a ∧ (succEmbedding n).toEmbedding a = succ i

Next tactic:
intro i hi
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · intro i hi
      

Proof state:
case a.mp.refine'_2
α : Type u_1
β : Type u_2
n : ℕ
i✝¹ : Fin n
i✝ : Fin (Nat.succ n)
i : Fin n
hi : succ i✝¹ < succ i
⊢ ∃ a, i✝¹ < a ∧ (succEmbedding n).toEmbedding a = succ i

Next tactic:
refine' ⟨i, succ_lt_succ_iff.mp hi, rfl⟩
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · intro i hi
      refine' ⟨i, succ_lt_succ_iff.mp hi, rfl⟩
  · 

Proof state:
case a.mpr
α : Type u_1
β : Type u_2
n : ℕ
i✝ : Fin n
i : Fin (Nat.succ n)
⊢ (∃ a, i✝ < a ∧ (succEmbedding n).toEmbedding a = i) → succ i✝ < i

Next tactic:
rintro ⟨i, hi, rfl⟩
@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmbedding _).toEmbedding := by
  ext i
  simp only [mem_filter, mem_Ioi, mem_map, mem_univ, true_and_iff, Function.Embedding.coeFn_mk,
    exists_true_left]
  constructor
  · refine' cases _ _ i
    · rintro ⟨⟨⟩⟩
    · intro i hi
      refine' ⟨i, succ_lt_succ_iff.mp hi, rfl⟩
  · rintro ⟨i, hi, rfl⟩
    

Proof state:
case a.mpr.intro.intro
α : Type u_1
β : Type u_2
n : ℕ
i✝ i : Fin n
hi : i✝ < i
⊢ succ i✝ < (succEmbedding n).toEmbedding i

Next tactic:
simpa
@[simp]
theorem Iio_castSucc (i : Fin n) :
    Iio (castSucc i) = (Iio i).map Fin.castSuccEmb.toEmbedding := by
  

Proof state:
α : Type u_1
β : Type u_2
n : ℕ
i : Fin n
⊢ Iio (castSucc i) = map castSuccEmb.toEmbedding (Iio i)

Next tactic:
apply Finset.map_injective Fin.valEmbedding
@[simp]
theorem Iio_castSucc (i : Fin n) :
    Iio (castSucc i) = (Iio i).map Fin.castSuccEmb.toEmbedding := by
  apply Finset.map_injective Fin.valEmbedding
  

Proof state:
case a
α : Type u_1
β : Type u_2
n : ℕ
i : Fin n
⊢ map valEmbedding (Iio (castSucc i)) = map valEmbedding (map castSuccEmb.toEmbedding (Iio i))

Next tactic:
rw [Finset.map_map, Fin.map_valEmbedding_Iio]
@[simp]
theorem Iio_castSucc (i : Fin n) :
    Iio (castSucc i) = (Iio i).map Fin.castSuccEmb.toEmbedding := by
  apply Finset.map_injective Fin.valEmbedding
  rw [Finset.map_map, Fin.map_valEmbedding_Iio]
  

Proof state:
case a
α : Type u_1
β : Type u_2
n : ℕ
i : Fin n
⊢ Iio ↑(castSucc i) = map (Function.Embedding.trans castSuccEmb.toEmbedding valEmbedding) (Iio i)

Next tactic:
exact (Fin.map_valEmbedding_Iio i).symm
theorem card_filter_univ_succ' (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card = ite (p 0) 1 0 + (univ.filter (p ∘ Fin.succ)).card := by
  

Proof state:
α : Type u_1
β : Type u_2
n : ℕ
p : Fin (n + 1) → Prop
inst✝ : DecidablePred p
⊢ Finset.card (filter p univ) = (if p 0 then 1 else 0) + Finset.card (filter (p ∘ succ) univ)

Next tactic:
rw [Fin.univ_succ, filter_cons, card_disjUnion, filter_map, card_map]
theorem card_filter_univ_succ' (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card = ite (p 0) 1 0 + (univ.filter (p ∘ Fin.succ)).card := by
  rw [Fin.univ_succ, filter_cons, card_disjUnion, filter_map, card_map]
  

Proof state:
α : Type u_1
β : Type u_2
n : ℕ
p : Fin (n + 1) → Prop
inst✝ : DecidablePred p
⊢ Finset.card (if p 0 then {0} else ∅) +
      Finset.card (filter (p ∘ ⇑{ toFun := succ, inj' := (_ : Function.Injective succ) }) univ) =
    (if p 0 then 1 else 0) + Finset.card (filter (p ∘ succ) univ)

Next tactic:
split_ifs
theorem card_filter_univ_succ' (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card = ite (p 0) 1 0 + (univ.filter (p ∘ Fin.succ)).card := by
  rw [Fin.univ_succ, filter_cons, card_disjUnion, filter_map, card_map]
  split_ifs <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
n : ℕ
p : Fin (n + 1) → Prop
inst✝ : DecidablePred p
h✝ : p 0
⊢ Finset.card {0} + Finset.card (filter (p ∘ ⇑{ toFun := succ, inj' := (_ : Function.Injective succ) }) univ) =
    1 + Finset.card (filter (p ∘ succ) univ)

Next tactic:
simp
theorem card_filter_univ_succ' (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card = ite (p 0) 1 0 + (univ.filter (p ∘ Fin.succ)).card := by
  rw [Fin.univ_succ, filter_cons, card_disjUnion, filter_map, card_map]
  split_ifs <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
n : ℕ
p : Fin (n + 1) → Prop
inst✝ : DecidablePred p
h✝ : ¬p 0
⊢ Finset.card ∅ + Finset.card (filter (p ∘ ⇑{ toFun := succ, inj' := (_ : Function.Injective succ) }) univ) =
    0 + Finset.card (filter (p ∘ succ) univ)

Next tactic:
simp
theorem card_filter_univ_succ (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card =
    if p 0 then (univ.filter (p ∘ Fin.succ)).card + 1 else (univ.filter (p ∘ Fin.succ)).card :=
  (card_filter_univ_succ' p).trans (by 

Proof state:
α : Type u_1
β : Type u_2
n : ℕ
p : Fin (n + 1) → Prop
inst✝ : DecidablePred p
⊢ (if p 0 then 1 else 0) + Finset.card (filter (p ∘ succ) univ) =
    if p 0 then Finset.card (filter (p ∘ succ) univ) + 1 else Finset.card (filter (p ∘ succ) univ)

Next tactic:
split_ifs
theorem card_filter_univ_succ (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card =
    if p 0 then (univ.filter (p ∘ Fin.succ)).card + 1 else (univ.filter (p ∘ Fin.succ)).card :=
  (card_filter_univ_succ' p).trans (by split_ifs <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
n : ℕ
p : Fin (n + 1) → Prop
inst✝ : DecidablePred p
h✝ : p 0
⊢ 1 + Finset.card (filter (p ∘ succ) univ) = Finset.card (filter (p ∘ succ) univ) + 1

Next tactic:
simp [add_comm 1]
theorem card_filter_univ_succ (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card =
    if p 0 then (univ.filter (p ∘ Fin.succ)).card + 1 else (univ.filter (p ∘ Fin.succ)).card :=
  (card_filter_univ_succ' p).trans (by split_ifs <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
n : ℕ
p : Fin (n + 1) → Prop
inst✝ : DecidablePred p
h✝ : ¬p 0
⊢ 0 + Finset.card (filter (p ∘ succ) univ) = Finset.card (filter (p ∘ succ) univ)

Next tactic:
simp [add_comm 1]
theorem card_filter_univ_eq_vector_get_eq_count [DecidableEq α] (a : α) (v : Vector α n) :
    (univ.filter fun i => a = v.get i).card = v.toList.count a := by
  

Proof state:
α : Type u_1
β : Type u_2
n : ℕ
inst✝ : DecidableEq α
a : α
v : Vector α n
⊢ Finset.card (filter (fun i => a = Vector.get v i) univ) = List.count a (Vector.toList v)

Next tactic:
induction' v using Vector.inductionOn with n x xs hxs
theorem card_filter_univ_eq_vector_get_eq_count [DecidableEq α] (a : α) (v : Vector α n) :
    (univ.filter fun i => a = v.get i).card = v.toList.count a := by
  induction' v using Vector.inductionOn with n x xs hxs
  · 

Proof state:
case h_nil
α : Type u_1
β : Type u_2
n : ℕ
inst✝ : DecidableEq α
a : α
⊢ Finset.card (filter (fun i => a = Vector.get Vector.nil i) univ) = List.count a (Vector.toList Vector.nil)

Next tactic:
simp
theorem card_filter_univ_eq_vector_get_eq_count [DecidableEq α] (a : α) (v : Vector α n) :
    (univ.filter fun i => a = v.get i).card = v.toList.count a := by
  induction' v using Vector.inductionOn with n x xs hxs
  · simp
  · 

Proof state:
case h_cons
α : Type u_1
β : Type u_2
n✝ : ℕ
inst✝ : DecidableEq α
a : α
n : ℕ
x : α
xs : Vector α n
hxs : Finset.card (filter (fun i => a = Vector.get xs i) univ) = List.count a (Vector.toList xs)
⊢ Finset.card (filter (fun i => a = Vector.get (x ::ᵥ xs) i) univ) = List.count a (Vector.toList (x ::ᵥ xs))

Next tactic:
simp_rw [card_filter_univ_succ', Vector.get_cons_zero, Vector.toList_cons, Function.comp,
      Vector.get_cons_succ, hxs, List.count_cons, add_comm (ite (a = x) 1 0)]
@[simp]
theorem inv_pos : 0 < a⁻¹ ↔ 0 < a :=
  suffices ∀ a : α, 0 < a → 0 < a⁻¹ from ⟨fun h => inv_inv a ▸ this _ h, this a⟩
  fun a ha => flip lt_of_mul_lt_mul_left ha.le <| by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a✝ b c d e : α
m n : ℤ
a : α
ha : 0 < a
⊢ a * 0 < a * a⁻¹

Next tactic:
simp [ne_of_gt ha, zero_lt_one]
@[simp]
theorem inv_nonneg : 0 ≤ a⁻¹ ↔ 0 ≤ a := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
⊢ 0 ≤ a⁻¹ ↔ 0 ≤ a

Next tactic:
simp only [le_iff_eq_or_lt, inv_pos, zero_eq_inv]
@[simp]
theorem inv_lt_zero : a⁻¹ < 0 ↔ a < 0 := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
⊢ a⁻¹ < 0 ↔ a < 0

Next tactic:
simp only [← not_le, inv_nonneg]
@[simp]
theorem inv_nonpos : a⁻¹ ≤ 0 ↔ a ≤ 0 := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
⊢ a⁻¹ ≤ 0 ↔ a ≤ 0

Next tactic:
simp only [← not_lt, inv_pos]
theorem div_pos (ha : 0 < a) (hb : 0 < b) : 0 < a / b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 0 < a
hb : 0 < b
⊢ 0 < a / b

Next tactic:
rw [div_eq_mul_inv]
theorem div_pos (ha : 0 < a) (hb : 0 < b) : 0 < a / b := by
  rw [div_eq_mul_inv]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 0 < a
hb : 0 < b
⊢ 0 < a * b⁻¹

Next tactic:
exact mul_pos ha (inv_pos.2 hb)
theorem div_nonneg (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a / b := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 0 ≤ a
hb : 0 ≤ b
⊢ 0 ≤ a / b

Next tactic:
rw [div_eq_mul_inv]
theorem div_nonneg (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a / b := by
  rw [div_eq_mul_inv]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 0 ≤ a
hb : 0 ≤ b
⊢ 0 ≤ a * b⁻¹

Next tactic:
exact mul_nonneg ha (inv_nonneg.2 hb)
theorem div_nonpos_of_nonpos_of_nonneg (ha : a ≤ 0) (hb : 0 ≤ b) : a / b ≤ 0 := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : a ≤ 0
hb : 0 ≤ b
⊢ a / b ≤ 0

Next tactic:
rw [div_eq_mul_inv]
theorem div_nonpos_of_nonpos_of_nonneg (ha : a ≤ 0) (hb : 0 ≤ b) : a / b ≤ 0 := by
  rw [div_eq_mul_inv]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : a ≤ 0
hb : 0 ≤ b
⊢ a * b⁻¹ ≤ 0

Next tactic:
exact mul_nonpos_of_nonpos_of_nonneg ha (inv_nonneg.2 hb)
theorem div_nonpos_of_nonneg_of_nonpos (ha : 0 ≤ a) (hb : b ≤ 0) : a / b ≤ 0 := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 0 ≤ a
hb : b ≤ 0
⊢ a / b ≤ 0

Next tactic:
rw [div_eq_mul_inv]
theorem div_nonpos_of_nonneg_of_nonpos (ha : 0 ≤ a) (hb : b ≤ 0) : a / b ≤ 0 := by
  rw [div_eq_mul_inv]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 0 ≤ a
hb : b ≤ 0
⊢ a * b⁻¹ ≤ 0

Next tactic:
exact mul_nonpos_of_nonneg_of_nonpos ha (inv_nonpos.2 hb)
theorem zpow_nonneg (ha : 0 ≤ a) : ∀ n : ℤ, 0 ≤ a ^ n
  | (n : ℕ) => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 ≤ a
n : ℕ
⊢ 0 ≤ a ^ ↑n

Next tactic:
rw [zpow_ofNat]
theorem zpow_nonneg (ha : 0 ≤ a) : ∀ n : ℤ, 0 ≤ a ^ n
  | (n : ℕ) => by
    rw [zpow_ofNat]
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 ≤ a
n : ℕ
⊢ 0 ≤ a ^ n

Next tactic:
exact pow_nonneg ha _
theorem zpow_nonneg (ha : 0 ≤ a) : ∀ n : ℤ, 0 ≤ a ^ n
  | (n : ℕ) => by
    rw [zpow_ofNat]
    exact pow_nonneg ha _
  | -(n + 1 : ℕ) => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 ≤ a
n : ℕ
⊢ 0 ≤ a ^ (-↑(n + 1))

Next tactic:
rw [zpow_neg, inv_nonneg, zpow_ofNat]
theorem zpow_nonneg (ha : 0 ≤ a) : ∀ n : ℤ, 0 ≤ a ^ n
  | (n : ℕ) => by
    rw [zpow_ofNat]
    exact pow_nonneg ha _
  | -(n + 1 : ℕ) => by
    rw [zpow_neg, inv_nonneg, zpow_ofNat]
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 ≤ a
n : ℕ
⊢ 0 ≤ a ^ (n + 1)

Next tactic:
exact pow_nonneg ha _
theorem zpow_pos_of_pos (ha : 0 < a) : ∀ n : ℤ, 0 < a ^ n
  | (n : ℕ) => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 < a
n : ℕ
⊢ 0 < a ^ ↑n

Next tactic:
rw [zpow_ofNat]
theorem zpow_pos_of_pos (ha : 0 < a) : ∀ n : ℤ, 0 < a ^ n
  | (n : ℕ) => by
    rw [zpow_ofNat]
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 < a
n : ℕ
⊢ 0 < a ^ n

Next tactic:
exact pow_pos ha _
theorem zpow_pos_of_pos (ha : 0 < a) : ∀ n : ℤ, 0 < a ^ n
  | (n : ℕ) => by
    rw [zpow_ofNat]
    exact pow_pos ha _
  | -(n + 1 : ℕ) => by
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 < a
n : ℕ
⊢ 0 < a ^ (-↑(n + 1))

Next tactic:
rw [zpow_neg, inv_pos, zpow_ofNat]
theorem zpow_pos_of_pos (ha : 0 < a) : ∀ n : ℤ, 0 < a ^ n
  | (n : ℕ) => by
    rw [zpow_ofNat]
    exact pow_pos ha _
  | -(n + 1 : ℕ) => by
    rw [zpow_neg, inv_pos, zpow_ofNat]
    

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n✝ : ℤ
ha : 0 < a
n : ℕ
⊢ 0 < a ^ (n + 1)

Next tactic:
exact pow_pos ha _
theorem le_div_iff' (hc : 0 < c) : a ≤ b / c ↔ c * a ≤ b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
hc : 0 < c
⊢ a ≤ b / c ↔ c * a ≤ b

Next tactic:
rw [mul_comm, le_div_iff hc]
theorem div_le_iff (hb : 0 < b) : a / b ≤ c ↔ a ≤ c * b :=
  ⟨fun h =>
    calc
      a = a / b * b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
hb : 0 < b
h : a / b ≤ c
⊢ a = a / b * b

Next tactic:
rw [div_mul_cancel _ (ne_of_lt hb).symm]
theorem div_le_iff (hb : 0 < b) : a / b ≤ c ↔ a ≤ c * b :=
  ⟨fun h =>
    calc
      a = a / b * b := by rw [div_mul_cancel _ (ne_of_lt hb).symm]
      _ ≤ c * b := mul_le_mul_of_nonneg_right h hb.le
      ,
    fun h =>
    calc
      a / b = a * (1 / b) := div_eq_mul_one_div a b
      _ ≤ c * b * (1 / b) := mul_le_mul_of_nonneg_right h (one_div_pos.2 hb).le
      _ = c * b / b := (div_eq_mul_one_div (c * b) b).symm
      _ = c := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
hb : 0 < b
h : a ≤ c * b
⊢ c * b / b = c

Next tactic:
refine' (div_eq_iff (ne_of_gt hb)).mpr rfl
theorem div_le_iff' (hb : 0 < b) : a / b ≤ c ↔ a ≤ b * c := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
hb : 0 < b
⊢ a / b ≤ c ↔ a ≤ b * c

Next tactic:
rw [mul_comm, div_le_iff hb]
theorem lt_div_iff' (hc : 0 < c) : a < b / c ↔ c * a < b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
hc : 0 < c
⊢ a < b / c ↔ c * a < b

Next tactic:
rw [mul_comm, lt_div_iff hc]
theorem div_lt_iff' (hc : 0 < c) : b / c < a ↔ b < c * a := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
hc : 0 < c
⊢ b / c < a ↔ b < c * a

Next tactic:
rw [mul_comm, div_lt_iff hc]
theorem inv_mul_le_iff (h : 0 < b) : b⁻¹ * a ≤ c ↔ a ≤ b * c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ b⁻¹ * a ≤ c ↔ a ≤ b * c

Next tactic:
rw [inv_eq_one_div, mul_comm, ← div_eq_mul_one_div]
theorem inv_mul_le_iff (h : 0 < b) : b⁻¹ * a ≤ c ↔ a ≤ b * c := by
  rw [inv_eq_one_div, mul_comm, ← div_eq_mul_one_div]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ a / b ≤ c ↔ a ≤ b * c

Next tactic:
exact div_le_iff' h
theorem inv_mul_le_iff' (h : 0 < b) : b⁻¹ * a ≤ c ↔ a ≤ c * b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ b⁻¹ * a ≤ c ↔ a ≤ c * b

Next tactic:
rw [inv_mul_le_iff h, mul_comm]
theorem mul_inv_le_iff (h : 0 < b) : a * b⁻¹ ≤ c ↔ a ≤ b * c := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ a * b⁻¹ ≤ c ↔ a ≤ b * c

Next tactic:
rw [mul_comm, inv_mul_le_iff h]
theorem mul_inv_le_iff' (h : 0 < b) : a * b⁻¹ ≤ c ↔ a ≤ c * b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ a * b⁻¹ ≤ c ↔ a ≤ c * b

Next tactic:
rw [mul_comm, inv_mul_le_iff' h]
theorem div_self_le_one (a : α) : a / a ≤ 1 :=
  if h : a = 0 then by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a✝ b c d e : α
m n : ℤ
a : α
h : a = 0
⊢ a / a ≤ 1

Next tactic:
simp [h]
theorem div_self_le_one (a : α) : a / a ≤ 1 :=
  if h : a = 0 then by simp [h] else by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a✝ b c d e : α
m n : ℤ
a : α
h : ¬a = 0
⊢ a / a ≤ 1

Next tactic:
simp [h]
theorem inv_mul_lt_iff (h : 0 < b) : b⁻¹ * a < c ↔ a < b * c := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ b⁻¹ * a < c ↔ a < b * c

Next tactic:
rw [inv_eq_one_div, mul_comm, ← div_eq_mul_one_div]
theorem inv_mul_lt_iff (h : 0 < b) : b⁻¹ * a < c ↔ a < b * c := by
  rw [inv_eq_one_div, mul_comm, ← div_eq_mul_one_div]
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ a / b < c ↔ a < b * c

Next tactic:
exact div_lt_iff' h
theorem inv_mul_lt_iff' (h : 0 < b) : b⁻¹ * a < c ↔ a < c * b := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h : 0 < b
⊢ b⁻¹ * a < c ↔ a < c * b

Next tactic:
rw [inv_mul_lt_iff h, mul_comm]