l3lab/ntp-mathlib huggingface dataset:
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; 

Proof state:
case refine'_13
α : Type u
c : ConditionallyCompleteLattice α
le : α → α → Prop
eq_le : le = LE.le
sup : α → α → α
eq_sup : sup = Sup.sup
inf : α → α → α
eq_inf : inf = Inf.inf
sSup : Set α → α
eq_sSup : sSup = SupSet.sSup
sInf : Set α → α
eq_sInf : sInf = InfSet.sInf
s✝ : Set α
a✝ : α
hb : Set.Nonempty s✝
h : a✝ ∈ upperBounds s✝
⊢ SupSet.sSup s✝ ≤ a✝

Next tactic:
subst_vars
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; subst_vars; 

Proof state:
case refine'_13
α : Type u
c : ConditionallyCompleteLattice α
s✝ : Set α
a✝ : α
hb : Set.Nonempty s✝
h : a✝ ∈ upperBounds s✝
⊢ sSup s✝ ≤ a✝

Next tactic:
exact csSup_le _ _ hb h
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; subst_vars; exact csSup_le _ _ hb h
  · 

Proof state:
case refine'_14
α : Type u
c : ConditionallyCompleteLattice α
le : α → α → Prop
eq_le : le = LE.le
sup : α → α → α
eq_sup : sup = Sup.sup
inf : α → α → α
eq_inf : inf = Inf.inf
sSup : Set α → α
eq_sSup : sSup = SupSet.sSup
sInf : Set α → α
eq_sInf : sInf = InfSet.sInf
⊢ ∀ (s : Set α) (a : α), BddBelow s → a ∈ s → InfSet.sInf s ≤ a

Next tactic:
intro _ _ hb h
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; subst_vars; exact csSup_le _ _ hb h
  · intro _ _ hb h; 

Proof state:
case refine'_14
α : Type u
c : ConditionallyCompleteLattice α
le : α → α → Prop
eq_le : le = LE.le
sup : α → α → α
eq_sup : sup = Sup.sup
inf : α → α → α
eq_inf : inf = Inf.inf
sSup : Set α → α
eq_sSup : sSup = SupSet.sSup
sInf : Set α → α
eq_sInf : sInf = InfSet.sInf
s✝ : Set α
a✝ : α
hb : BddBelow s✝
h : a✝ ∈ s✝
⊢ InfSet.sInf s✝ ≤ a✝

Next tactic:
subst_vars
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; subst_vars; exact csSup_le _ _ hb h
  · intro _ _ hb h; subst_vars; 

Proof state:
case refine'_14
α : Type u
c : ConditionallyCompleteLattice α
s✝ : Set α
a✝ : α
h : a✝ ∈ s✝
hb : BddBelow s✝
⊢ sInf s✝ ≤ a✝

Next tactic:
exact csInf_le _ _ hb h
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; subst_vars; exact csSup_le _ _ hb h
  · intro _ _ hb h; subst_vars; exact csInf_le _ _ hb h
  · 

Proof state:
case refine'_15
α : Type u
c : ConditionallyCompleteLattice α
le : α → α → Prop
eq_le : le = LE.le
sup : α → α → α
eq_sup : sup = Sup.sup
inf : α → α → α
eq_inf : inf = Inf.inf
sSup : Set α → α
eq_sSup : sSup = SupSet.sSup
sInf : Set α → α
eq_sInf : sInf = InfSet.sInf
⊢ ∀ (s : Set α) (a : α), Set.Nonempty s → a ∈ lowerBounds s → a ≤ InfSet.sInf s

Next tactic:
intro _ _ hb h
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; subst_vars; exact csSup_le _ _ hb h
  · intro _ _ hb h; subst_vars; exact csInf_le _ _ hb h
  · intro _ _ hb h; 

Proof state:
case refine'_15
α : Type u
c : ConditionallyCompleteLattice α
le : α → α → Prop
eq_le : le = LE.le
sup : α → α → α
eq_sup : sup = Sup.sup
inf : α → α → α
eq_inf : inf = Inf.inf
sSup : Set α → α
eq_sSup : sSup = SupSet.sSup
sInf : Set α → α
eq_sInf : sInf = InfSet.sInf
s✝ : Set α
a✝ : α
hb : Set.Nonempty s✝
h : a✝ ∈ lowerBounds s✝
⊢ a✝ ≤ InfSet.sInf s✝

Next tactic:
subst_vars
/-- A function to create a provable equal copy of a conditionally complete lattice
with possibly different definitional equalities. -/
def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
    (le : α → α → Prop) (eq_le : le = (by infer_instance : LE α).le)
    (sup : α → α → α) (eq_sup : sup = (by infer_instance : Sup α).sup)
    (inf : α → α → α) (eq_inf : inf = (by infer_instance : Inf α).inf)
    (sSup : Set α → α) (eq_sSup : sSup = (by infer_instance : SupSet α).sSup)
    (sInf : Set α → α) (eq_sInf : sInf = (by infer_instance : InfSet α).sInf) :
    ConditionallyCompleteLattice α := by
  refine' { le := le, sup := sup, inf := inf, sSup := sSup, sInf := sInf.. }
  · intro a b; exact le a b ∧ ¬ le b a
  · intros; simp [eq_le]
  · intro _ _ _ hab hbc; rw [eq_le] at hab hbc ⊢; exact le_trans hab hbc
  · intros; simp [eq_le]
  · intro _ _ hab hba; simp_rw [eq_le] at hab hba; exact le_antisymm hab hba
  · intros; simp [eq_le, eq_sup]
  · intros; simp [eq_le, eq_sup]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_sup, hac, hbc]
  · intros; simp [eq_le, eq_inf]
  · intros; simp [eq_le, eq_inf]
  · intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
  · intro _ _ hb h; subst_vars; exact le_csSup _ _ hb h
  · intro _ _ hb h; subst_vars; exact csSup_le _ _ hb h
  · intro _ _ hb h; subst_vars; exact csInf_le _ _ hb h
  · intro _ _ hb h; subst_vars; 

Proof state:
case refine'_15
α : Type u
c : ConditionallyCompleteLattice α
s✝ : Set α
a✝ : α
hb : Set.Nonempty s✝
h : a✝ ∈ lowerBounds s✝
⊢ a✝ ≤ sInf s✝

Next tactic:
exact le_csInf _ _ hb h
theorem add_div (a b c : α) : (a + b) / c = a / c + b / c := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a✝ b✝ c✝ d a b c : α
⊢ (a + b) / c = a / c + b / c

Next tactic:
simp_rw [div_eq_mul_inv, add_mul]
theorem same_add_div (h : b ≠ 0) : (b + a) / b = 1 + a / b := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a b c d : α
h : b ≠ 0
⊢ (b + a) / b = 1 + a / b

Next tactic:
rw [← div_self h, add_div]
theorem div_add_same (h : b ≠ 0) : (a + b) / b = a / b + 1 := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a b c d : α
h : b ≠ 0
⊢ (a + b) / b = a / b + 1

Next tactic:
rw [← div_self h, add_div]
theorem one_div_mul_add_mul_one_div_eq_one_div_add_one_div (ha : a ≠ 0) (hb : b ≠ 0) :
    1 / a * (a + b) * (1 / b) = 1 / a + 1 / b := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a b c d : α
ha : a ≠ 0
hb : b ≠ 0
⊢ 1 / a * (a + b) * (1 / b) = 1 / a + 1 / b

Next tactic:
rw [mul_add, one_div_mul_cancel ha, add_mul, one_mul, mul_assoc, mul_one_div_cancel hb, mul_one,
    add_comm]
theorem add_div_eq_mul_add_div (a b : α) (hc : c ≠ 0) : a + b / c = (a * c + b) / c :=
  (eq_div_iff_mul_eq hc).2 <| by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a✝ b✝ c d a b : α
hc : c ≠ 0
⊢ (a + b / c) * c = a * c + b

Next tactic:
rw [right_distrib, div_mul_cancel _ hc]
@[field_simps]
theorem add_div' (a b c : α) (hc : c ≠ 0) : b + a / c = (b * c + a) / c := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a✝ b✝ c✝ d a b c : α
hc : c ≠ 0
⊢ b + a / c = (b * c + a) / c

Next tactic:
rw [add_div, mul_div_cancel _ hc]
@[field_simps]
theorem div_add' (a b c : α) (hc : c ≠ 0) : a / c + b = (a + b * c) / c := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a✝ b✝ c✝ d a b c : α
hc : c ≠ 0
⊢ a / c + b = (a + b * c) / c

Next tactic:
rwa [add_comm, add_div', add_comm]
protected theorem Commute.div_add_div (hbc : Commute b c) (hbd : Commute b d) (hb : b ≠ 0)
    (hd : d ≠ 0) : a / b + c / d = (a * d + b * c) / (b * d) := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a b c d : α
hbc : Commute b c
hbd : Commute b d
hb : b ≠ 0
hd : d ≠ 0
⊢ a / b + c / d = (a * d + b * c) / (b * d)

Next tactic:
rw [add_div, mul_div_mul_right _ b hd, hbc.eq, hbd.eq, mul_div_mul_right c d hb]
protected theorem Commute.one_div_add_one_div (hab : Commute a b) (ha : a ≠ 0) (hb : b ≠ 0) :
    1 / a + 1 / b = (a + b) / (a * b) := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a b c d : α
hab : Commute a b
ha : a ≠ 0
hb : b ≠ 0
⊢ 1 / a + 1 / b = (a + b) / (a * b)

Next tactic:
rw [(Commute.one_right a).div_add_div hab ha hb, one_mul, mul_one, add_comm]
protected theorem Commute.inv_add_inv (hab : Commute a b) (ha : a ≠ 0) (hb : b ≠ 0) :
    a⁻¹ + b⁻¹ = (a + b) / (a * b) := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionSemiring α
a b c d : α
hab : Commute a b
ha : a ≠ 0
hb : b ≠ 0
⊢ a⁻¹ + b⁻¹ = (a + b) / (a * b)

Next tactic:
rw [inv_eq_one_div, inv_eq_one_div, hab.one_div_add_one_div ha hb]
theorem one_div_neg_one_eq_neg_one : (1 : K) / -1 = -1 :=
  have : -1 * -1 = (1 : K) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a b : K
⊢ -1 * -1 = 1

Next tactic:
rw [neg_mul_neg, one_mul]
theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) :=
  calc
    1 / -a = 1 / (-1 * a) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b a : K
⊢ 1 / -a = 1 / (-1 * a)

Next tactic:
rw [neg_eq_neg_one_mul]
theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) :=
  calc
    1 / -a = 1 / (-1 * a) := by rw [neg_eq_neg_one_mul]
    _ = 1 / a * (1 / -1) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b a : K
⊢ 1 / (-1 * a) = 1 / a * (1 / -1)

Next tactic:
rw [one_div_mul_one_div_rev]
theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) :=
  calc
    1 / -a = 1 / (-1 * a) := by rw [neg_eq_neg_one_mul]
    _ = 1 / a * (1 / -1) := by rw [one_div_mul_one_div_rev]
    _ = 1 / a * -1 := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b a : K
⊢ 1 / a * (1 / -1) = 1 / a * -1

Next tactic:
rw [one_div_neg_one_eq_neg_one]
theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a) :=
  calc
    1 / -a = 1 / (-1 * a) := by rw [neg_eq_neg_one_mul]
    _ = 1 / a * (1 / -1) := by rw [one_div_mul_one_div_rev]
    _ = 1 / a * -1 := by rw [one_div_neg_one_eq_neg_one]
    _ = -(1 / a) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b a : K
⊢ 1 / a * -1 = -(1 / a)

Next tactic:
rw [mul_neg, mul_one]
theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a) :=
  calc
    b / -a = b * (1 / -a) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b✝ a b : K
⊢ b / -a = b * (1 / -a)

Next tactic:
rw [← inv_eq_one_div, division_def]
theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a) :=
  calc
    b / -a = b * (1 / -a) := by rw [← inv_eq_one_div, division_def]
    _ = b * -(1 / a) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b✝ a b : K
⊢ b * (1 / -a) = b * -(1 / a)

Next tactic:
rw [one_div_neg_eq_neg_one_div]
theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a) :=
  calc
    b / -a = b * (1 / -a) := by rw [← inv_eq_one_div, division_def]
    _ = b * -(1 / a) := by rw [one_div_neg_eq_neg_one_div]
    _ = -(b * (1 / a)) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b✝ a b : K
⊢ b * -(1 / a) = -(b * (1 / a))

Next tactic:
rw [neg_mul_eq_mul_neg]
theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a) :=
  calc
    b / -a = b * (1 / -a) := by rw [← inv_eq_one_div, division_def]
    _ = b * -(1 / a) := by rw [one_div_neg_eq_neg_one_div]
    _ = -(b * (1 / a)) := by rw [neg_mul_eq_mul_neg]
    _ = -(b / a) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b✝ a b : K
⊢ -(b * (1 / a)) = -(b / a)

Next tactic:
rw [mul_one_div]
theorem neg_div (a b : K) : -b / a = -(b / a) := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b✝ a b : K
⊢ -b / a = -(b / a)

Next tactic:
rw [neg_eq_neg_one_mul, mul_div_assoc, ← neg_eq_neg_one_mul]
@[field_simps]
theorem neg_div' (a b : K) : -(b / a) = -b / a := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b✝ a b : K
⊢ -(b / a) = -b / a

Next tactic:
simp [neg_div]
theorem neg_div_neg_eq (a b : K) : -a / -b = a / b := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b✝ a b : K
⊢ -a / -b = a / b

Next tactic:
rw [div_neg_eq_neg_div, neg_div, neg_neg]
theorem neg_inv : -a⁻¹ = (-a)⁻¹ := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a b : K
⊢ -a⁻¹ = (-a)⁻¹

Next tactic:
rw [inv_eq_one_div, inv_eq_one_div, div_neg_eq_neg_div]
theorem div_neg (a : K) : a / -b = -(a / b) := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a✝ b a : K
⊢ a / -b = -(a / b)

Next tactic:
rw [← div_neg_eq_neg_div]
theorem inv_neg : (-a)⁻¹ = -a⁻¹ := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a b : K
⊢ (-a)⁻¹ = -a⁻¹

Next tactic:
rw [neg_inv]
theorem inv_neg_one : (-1 : K)⁻¹ = -1 := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝¹ : DivisionMonoid K
inst✝ : HasDistribNeg K
a b : K
⊢ (-1)⁻¹ = -1

Next tactic:
rw [← neg_inv, inv_one]
@[simp]
theorem div_neg_self {a : K} (h : a ≠ 0) : a / -a = -1 := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a✝ b c d a : K
h : a ≠ 0
⊢ a / -a = -1

Next tactic:
rw [div_neg_eq_neg_div, div_self h]
@[simp]
theorem neg_div_self {a : K} (h : a ≠ 0) : -a / a = -1 := by 

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a✝ b c d a : K
h : a ≠ 0
⊢ -a / a = -1

Next tactic:
rw [neg_div, div_self h]
theorem div_sub_div_same (a b c : K) : a / c - b / c = (a - b) / c := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a✝ b✝ c✝ d a b c : K
⊢ a / c - b / c = (a - b) / c

Next tactic:
rw [sub_eq_add_neg, ← neg_div, div_add_div_same, sub_eq_add_neg]
theorem same_sub_div {a b : K} (h : b ≠ 0) : (b - a) / b = 1 - a / b := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a✝ b✝ c d a b : K
h : b ≠ 0
⊢ (b - a) / b = 1 - a / b

Next tactic:
simpa only [← @div_self _ _ b h] using (div_sub_div_same b a b).symm
theorem div_sub_same {a b : K} (h : b ≠ 0) : (a - b) / b = a / b - 1 := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a✝ b✝ c d a b : K
h : b ≠ 0
⊢ (a - b) / b = a / b - 1

Next tactic:
simpa only [← @div_self _ _ b h] using (div_sub_div_same a b b).symm
/-- See `inv_sub_inv` for the more convenient version when `K` is commutative. -/
theorem inv_sub_inv' {a b : K} (ha : a ≠ 0) (hb : b ≠ 0) : a⁻¹ - b⁻¹ = a⁻¹ * (b - a) * b⁻¹ := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a✝ b✝ c d a b : K
ha : a ≠ 0
hb : b ≠ 0
⊢ a⁻¹ - b⁻¹ = a⁻¹ * (b - a) * b⁻¹

Next tactic:
rw [mul_sub, sub_mul, mul_inv_cancel_right₀ hb, inv_mul_cancel ha, one_mul]
theorem one_div_mul_sub_mul_one_div_eq_one_div_add_one_div (ha : a ≠ 0) (hb : b ≠ 0) :
    1 / a * (b - a) * (1 / b) = 1 / a - 1 / b := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a b c d : K
ha : a ≠ 0
hb : b ≠ 0
⊢ 1 / a * (b - a) * (1 / b) = 1 / a - 1 / b

Next tactic:
rw [mul_sub_left_distrib (1 / a), one_div_mul_cancel ha, mul_sub_right_distrib, one_mul,
    mul_assoc, mul_one_div_cancel hb, mul_one]
protected theorem Commute.div_sub_div (hbc : Commute b c) (hbd : Commute b d) (hb : b ≠ 0)
    (hd : d ≠ 0) : a / b - c / d = (a * d - b * c) / (b * d) := by
  

Proof state:
α : Type u_1
β : Type u_2
K : Type u_3
inst✝ : DivisionRing K
a b c d : K
hbc : Commute b c
hbd : Commute b d
hb : b ≠ 0
hd : d ≠ 0
⊢ a / b - c / d = (a * d - b * c) / (b * d)

Next tactic:
simpa only [mul_neg, neg_div, ← sub_eq_add_neg] using hbc.neg_right.div_add_div hbd hb hd