l3lab/ntp-mathlib huggingface dataset:
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact sub_eq_add_neg _ _
    neg_neg := fun s => by apply NonemptyInterval.ext; exact neg_neg _
    neg_add_rev := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact neg_add_rev _ _
    neg_eq_of_add := fun s t h => by
      

Proof state:
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t✝ : NonemptyInterval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (NonemptyInterval α) := addCommMonoid
s t : NonemptyInterval α
h : s + t = 0
⊢ -s = t

Next tactic:
obtain ⟨a, b, rfl, rfl, hab⟩ := NonemptyInterval.add_eq_zero_iff.1 h
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact sub_eq_add_neg _ _
    neg_neg := fun s => by apply NonemptyInterval.ext; exact neg_neg _
    neg_add_rev := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact neg_add_rev _ _
    neg_eq_of_add := fun s t h => by
      obtain ⟨a, b, rfl, rfl, hab⟩ := NonemptyInterval.add_eq_zero_iff.1 h
      

Proof state:
case intro.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : NonemptyInterval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (NonemptyInterval α) := addCommMonoid
a b : α
hab : a + b = 0
h : pure a + pure b = 0
⊢ -pure a = pure b

Next tactic:
rw [neg_pure, neg_eq_of_add_eq_zero_right hab]
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s t : NonemptyInterval α
⊢ s / t = s * t⁻¹

Next tactic:
refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_)
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      

Proof state:
case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s t : NonemptyInterval α
⊢ (s / t).toProd.1 = (s * t⁻¹).toProd.1

Next tactic:
exact div_eq_mul_inv _ _
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      

Proof state:
case refine_2
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s t : NonemptyInterval α
⊢ (s / t).toProd.2 = (s * t⁻¹).toProd.2

Next tactic:
exact div_eq_mul_inv _ _
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact div_eq_mul_inv _ _
    inv_inv := fun s => by 

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s : NonemptyInterval α
⊢ s⁻¹⁻¹ = s

Next tactic:
apply NonemptyInterval.ext
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact div_eq_mul_inv _ _
    inv_inv := fun s => by apply NonemptyInterval.ext; 

Proof state:
case h
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s : NonemptyInterval α
⊢ s⁻¹⁻¹.toProd = s.toProd

Next tactic:
exact inv_inv _
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact div_eq_mul_inv _ _
    inv_inv := fun s => by apply NonemptyInterval.ext; exact inv_inv _
    mul_inv_rev := fun s t => by
      

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s t : NonemptyInterval α
⊢ (s * t)⁻¹ = t⁻¹ * s⁻¹

Next tactic:
refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_)
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact div_eq_mul_inv _ _
    inv_inv := fun s => by apply NonemptyInterval.ext; exact inv_inv _
    mul_inv_rev := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      

Proof state:
case refine_1
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s t : NonemptyInterval α
⊢ (s * t)⁻¹.toProd.1 = (t⁻¹ * s⁻¹).toProd.1

Next tactic:
exact mul_inv_rev _ _
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact div_eq_mul_inv _ _
    inv_inv := fun s => by apply NonemptyInterval.ext; exact inv_inv _
    mul_inv_rev := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      

Proof state:
case refine_2
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s t : NonemptyInterval α
⊢ (s * t)⁻¹.toProd.2 = (t⁻¹ * s⁻¹).toProd.2

Next tactic:
exact mul_inv_rev _ _
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact div_eq_mul_inv _ _
    inv_inv := fun s => by apply NonemptyInterval.ext; exact inv_inv _
    mul_inv_rev := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact mul_inv_rev _ _
    inv_eq_of_mul := fun s t h => by
      

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s✝ t✝ : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
s t : NonemptyInterval α
h : s * t = 1
⊢ s⁻¹ = t

Next tactic:
obtain ⟨a, b, rfl, rfl, hab⟩ := NonemptyInterval.mul_eq_one_iff.1 h
@[to_additive existing NonemptyInterval.subtractionCommMonoid]
instance divisionCommMonoid : DivisionCommMonoid (NonemptyInterval α) :=
  { NonemptyInterval.commMonoid with
    inv := Inv.inv
    div := (· / ·)
    div_eq_mul_inv := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact div_eq_mul_inv _ _
    inv_inv := fun s => by apply NonemptyInterval.ext; exact inv_inv _
    mul_inv_rev := fun s t => by
      refine NonemptyInterval.ext _ _ (Prod.ext ?_ ?_) <;>
      exact mul_inv_rev _ _
    inv_eq_of_mul := fun s t h => by
      obtain ⟨a, b, rfl, rfl, hab⟩ := NonemptyInterval.mul_eq_one_iff.1 h
      

Proof state:
case intro.intro.intro.intro
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : NonemptyInterval α
src✝ : CommMonoid (NonemptyInterval α) := commMonoid
a b : α
hab : a * b = 1
h : pure a * pure b = 1
⊢ (pure a)⁻¹ = pure b

Next tactic:
rw [inv_pure, inv_eq_of_mul_eq_one_right hab]
@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1 := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
s t : Interval α
⊢ s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1

Next tactic:
cases s
@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1 := by
  cases s
  · 

Proof state:
case none
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
t : Interval α
⊢ none * t = 1 ↔ ∃ a b, none = pure a ∧ t = pure b ∧ a * b = 1

Next tactic:
simp [WithBot.none_eq_bot]
@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1 := by
  cases s
  · simp [WithBot.none_eq_bot]
  

Proof state:
case some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
t : Interval α
val✝ : NonemptyInterval α
⊢ some val✝ * t = 1 ↔ ∃ a b, some val✝ = pure a ∧ t = pure b ∧ a * b = 1

Next tactic:
cases t
@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1 := by
  cases s
  · simp [WithBot.none_eq_bot]
  cases t
  · 

Proof state:
case some.none
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
val✝ : NonemptyInterval α
⊢ some val✝ * none = 1 ↔ ∃ a b, some val✝ = pure a ∧ none = pure b ∧ a * b = 1

Next tactic:
simp [WithBot.none_eq_bot]
@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1 := by
  cases s
  · simp [WithBot.none_eq_bot]
  cases t
  · simp [WithBot.none_eq_bot]
  · 

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
val✝¹ val✝ : NonemptyInterval α
⊢ some val✝¹ * some val✝ = 1 ↔ ∃ a b, some val✝¹ = pure a ∧ some val✝ = pure b ∧ a * b = 1

Next tactic:
simp_rw [WithBot.some_eq_coe, ← NonemptyInterval.coe_mul_interval,
      ← NonemptyInterval.coe_one_interval, WithBot.coe_inj, NonemptyInterval.coe_eq_pure]
@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1 := by
  cases s
  · simp [WithBot.none_eq_bot]
  cases t
  · simp [WithBot.none_eq_bot]
  · simp_rw [WithBot.some_eq_coe, ← NonemptyInterval.coe_mul_interval,
      ← NonemptyInterval.coe_one_interval, WithBot.coe_inj, NonemptyInterval.coe_eq_pure]
    

Proof state:
case some.some
ι : Type u_1
α : Type u_2
inst✝ : OrderedCommGroup α
val✝¹ val✝ : NonemptyInterval α
⊢ val✝¹ * val✝ = 1 ↔ ∃ a b, val✝¹ = NonemptyInterval.pure a ∧ val✝ = NonemptyInterval.pure b ∧ a * b = 1

Next tactic:
exact NonemptyInterval.mul_eq_one_iff
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      

Proof state:
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ ∀ (a b : Interval α), a - b = a + -b

Next tactic:
rintro (_ | s) (_ | t)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> 

Proof state:
case none.none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ none - none = none + -none

Next tactic:
first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |

Proof state:
case none.none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ none - none = none + -none

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> 

Proof state:
case none.some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t✝ : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
t : NonemptyInterval α
⊢ none - some t = none + -some t

Next tactic:
first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |

Proof state:
case none.some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t✝ : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
t : NonemptyInterval α
⊢ none - some t = none + -some t

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> 

Proof state:
case some.none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s : NonemptyInterval α
⊢ some s - none = some s + -none

Next tactic:
first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |

Proof state:
case some.none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s : NonemptyInterval α
⊢ some s - none = some s + -none

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> 

Proof state:
case some.some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t✝ : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s t : NonemptyInterval α
⊢ some s - some t = some s + -some t

Next tactic:
first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |

Proof state:
case some.some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t✝ : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s t : NonemptyInterval α
⊢ some s - some t = some s + -some t

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|

Proof state:
case some.some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t✝ : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s t : NonemptyInterval α
⊢ some s - some t = some s + -some t

Next tactic:
exact congr_arg some (sub_eq_add_neg _ _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by 

Proof state:
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ ∀ (x : Interval α), - -x = x

Next tactic:
rintro (_ | s)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> 

Proof state:
case none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ - -none = none

Next tactic:
first |rfl|exact congr_arg some (neg_neg _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |

Proof state:
case none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ - -none = none

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> 

Proof state:
case some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s : NonemptyInterval α
⊢ - -some s = some s

Next tactic:
first |rfl|exact congr_arg some (neg_neg _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |

Proof state:
case some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s : NonemptyInterval α
⊢ - -some s = some s

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |rfl|

Proof state:
case some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s : NonemptyInterval α
⊢ - -some s = some s

Next tactic:
exact congr_arg some (neg_neg _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |rfl|exact congr_arg some (neg_neg _)
    neg_add_rev := by 

Proof state:
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ ∀ (a b : Interval α), -(a + b) = -b + -a

Next tactic:
rintro (_ | s) (_ | t)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |rfl|exact congr_arg some (neg_neg _)
    neg_add_rev := by rintro (_ | s) (_ | t) <;> 

Proof state:
case none.none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ -(none + none) = -none + -none

Next tactic:
first |rfl|exact congr_arg some (neg_add_rev _ _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |rfl|exact congr_arg some (neg_neg _)
    neg_add_rev := by rintro (_ | s) (_ | t) <;> first |

Proof state:
case none.none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
⊢ -(none + none) = -none + -none

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |rfl|exact congr_arg some (neg_neg _)
    neg_add_rev := by rintro (_ | s) (_ | t) <;> 

Proof state:
case none.some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t✝ : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
t : NonemptyInterval α
⊢ -(none + some t) = -some t + -none

Next tactic:
first |rfl|exact congr_arg some (neg_add_rev _ _)
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |rfl|exact congr_arg some (neg_neg _)
    neg_add_rev := by rintro (_ | s) (_ | t) <;> first |

Proof state:
case none.some
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s t✝ : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
t : NonemptyInterval α
⊢ -(none + some t) = -some t + -none

Next tactic:
rfl
instance subtractionCommMonoid {α : Type u} [OrderedAddCommGroup α] :
    SubtractionCommMonoid (Interval α) :=
  { Interval.addCommMonoid with
    neg := Neg.neg
    sub := Sub.sub
    sub_eq_add_neg := by
      rintro (_ | s) (_ | t) <;> first |rfl|exact congr_arg some (sub_eq_add_neg _ _)
    neg_neg := by rintro (_ | s) <;> first |rfl|exact congr_arg some (neg_neg _)
    neg_add_rev := by rintro (_ | s) (_ | t) <;> 

Proof state:
case some.none
ι : Type u_1
α✝ : Type u_2
inst✝¹ : OrderedCommGroup α✝
s✝ t : Interval α✝
α : Type u
inst✝ : OrderedAddCommGroup α
src✝ : AddCommMonoid (Interval α) := addCommMonoid
s : NonemptyInterval α
⊢ -(some s + none) = -none + -some s

Next tactic:
first |rfl|exact congr_arg some (neg_add_rev _ _)