l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
theorem le_div_iff_mul_le' : b ≤ c / a ↔ a * b ≤ c := by 

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LE α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
⊢ b ≤ c / a ↔ a * b ≤ c

Next tactic:
rw [le_div_iff_mul_le, mul_comm]
@[to_additive]
theorem div_le_iff_le_mul' : a / b ≤ c ↔ a ≤ b * c := by 

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LE α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
⊢ a / b ≤ c ↔ a ≤ b * c

Next tactic:
rw [div_le_iff_le_mul, mul_comm]
@[to_additive]
theorem inv_le_div_iff_le_mul' : a⁻¹ ≤ b / c ↔ c ≤ a * b := by 

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LE α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
⊢ a⁻¹ ≤ b / c ↔ c ≤ a * b

Next tactic:
rw [inv_le_div_iff_le_mul, mul_comm]
@[to_additive sub_le_sub]
theorem div_le_div'' (hab : a ≤ b) (hcd : c ≤ d) : a / d ≤ b / c := by
  

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : Preorder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
hab : a ≤ b
hcd : c ≤ d
⊢ a / d ≤ b / c

Next tactic:
rw [div_eq_mul_inv, div_eq_mul_inv, mul_comm b, mul_inv_le_inv_mul_iff, mul_comm]
@[to_additive sub_le_sub]
theorem div_le_div'' (hab : a ≤ b) (hcd : c ≤ d) : a / d ≤ b / c := by
  rw [div_eq_mul_inv, div_eq_mul_inv, mul_comm b, mul_inv_le_inv_mul_iff, mul_comm]
  

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : Preorder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
hab : a ≤ b
hcd : c ≤ d
⊢ a * c ≤ b * d

Next tactic:
exact mul_le_mul' hab hcd
@[to_additive (attr := simp)]
theorem div_lt_div_iff_right (c : α) : a / c < b / c ↔ a < b := by
  

Proof state:
α : Type u
inst✝² : Group α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c✝ d c : α
⊢ a / c < b / c ↔ a < b

Next tactic:
simpa only [div_eq_mul_inv] using mul_lt_mul_iff_right _
@[to_additive (attr := simp) sub_pos]
theorem one_lt_div' : 1 < a / b ↔ b < a := by
  

Proof state:
α : Type u
inst✝² : Group α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
⊢ 1 < a / b ↔ b < a

Next tactic:
rw [← mul_lt_mul_iff_right b, one_mul, div_eq_mul_inv, inv_mul_cancel_right]
@[to_additive (attr := simp) sub_neg "For `a - -b = a + b`, see `sub_neg_eq_add`."]
theorem div_lt_one' : a / b < 1 ↔ a < b := by
  

Proof state:
α : Type u
inst✝² : Group α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
⊢ a / b < 1 ↔ a < b

Next tactic:
rw [← mul_lt_mul_iff_right b, one_mul, div_eq_mul_inv, inv_mul_cancel_right]
@[to_additive]
theorem lt_div_iff_mul_lt : a < c / b ↔ a * b < c := by
  

Proof state:
α : Type u
inst✝² : Group α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
⊢ a < c / b ↔ a * b < c

Next tactic:
rw [← mul_lt_mul_iff_right b, div_eq_mul_inv, inv_mul_cancel_right]
@[to_additive]
theorem div_lt_iff_lt_mul : a / c < b ↔ a < b * c := by
  

Proof state:
α : Type u
inst✝² : Group α
inst✝¹ : LT α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
⊢ a / c < b ↔ a < b * c

Next tactic:
rw [← mul_lt_mul_iff_right c, div_eq_mul_inv, inv_mul_cancel_right]
@[to_additive (attr := simp)]
theorem div_lt_div_iff_left (a : α) : a / b < a / c ↔ c < b := by
  

Proof state:
α : Type u
inst✝³ : Group α
inst✝² : LT α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a✝ b c a : α
⊢ a / b < a / c ↔ c < b

Next tactic:
rw [div_eq_mul_inv, div_eq_mul_inv, ← mul_lt_mul_iff_left a⁻¹, inv_mul_cancel_left,
    inv_mul_cancel_left, inv_lt_inv_iff]
@[to_additive (attr := simp)]
theorem inv_lt_div_iff_lt_mul : a⁻¹ < b / c ↔ c < a * b := by
  

Proof state:
α : Type u
inst✝³ : Group α
inst✝² : LT α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c : α
⊢ a⁻¹ < b / c ↔ c < a * b

Next tactic:
rw [div_eq_mul_inv, lt_mul_inv_iff_mul_lt, inv_mul_lt_iff_lt_mul]
@[to_additive sub_lt_sub_iff]
theorem div_lt_div_iff' : a / b < c / d ↔ a * d < c * b := by
  

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
⊢ a / b < c / d ↔ a * d < c * b

Next tactic:
simpa only [div_eq_mul_inv] using mul_inv_lt_mul_inv_iff'
@[to_additive]
theorem lt_div_iff_mul_lt' : b < c / a ↔ a * b < c := by 

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
⊢ b < c / a ↔ a * b < c

Next tactic:
rw [lt_div_iff_mul_lt, mul_comm]
@[to_additive]
theorem div_lt_iff_lt_mul' : a / b < c ↔ a < b * c := by 

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LT α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
⊢ a / b < c ↔ a < b * c

Next tactic:
rw [div_lt_iff_lt_mul, mul_comm]
@[to_additive sub_lt_sub]
theorem div_lt_div'' (hab : a < b) (hcd : c < d) : a / d < b / c := by
  

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : Preorder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
hab : a < b
hcd : c < d
⊢ a / d < b / c

Next tactic:
rw [div_eq_mul_inv, div_eq_mul_inv, mul_comm b, mul_inv_lt_inv_mul_iff, mul_comm]
@[to_additive sub_lt_sub]
theorem div_lt_div'' (hab : a < b) (hcd : c < d) : a / d < b / c := by
  rw [div_eq_mul_inv, div_eq_mul_inv, mul_comm b, mul_inv_lt_inv_mul_iff, mul_comm]
  

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : Preorder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
hab : a < b
hcd : c < d
⊢ a * c < b * d

Next tactic:
exact mul_lt_mul_of_lt_of_lt hab hcd
@[to_additive] lemma lt_or_lt_of_div_lt_div : a / d < b / c → a < b ∨ c < d := by
  

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
⊢ a / d < b / c → a < b ∨ c < d

Next tactic:
contrapose!
@[to_additive] lemma lt_or_lt_of_div_lt_div : a / d < b / c → a < b ∨ c < d := by
  contrapose!; 

Proof state:
α : Type u
inst✝² : CommGroup α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c d : α
⊢ b ≤ a ∧ d ≤ c → b / c ≤ a / d

Next tactic:
exact fun h ↦ div_le_div'' h.1 h.2
@[to_additive (attr := simp) cmp_sub_zero]
theorem cmp_div_one' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (a b : α) :
    cmp (a / b) 1 = cmp a b := by 

Proof state:
α : Type u
inst✝² : Group α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ cmp (a / b) 1 = cmp a b

Next tactic:
rw [← cmp_mul_right' _ _ b, one_mul, div_mul_cancel']
@[to_additive]
theorem le_of_forall_one_lt_lt_mul (h : ∀ ε : α, 1 < ε → a < b * ε) : a ≤ b :=
  le_of_not_lt fun h₁ => lt_irrefl a (by 

Proof state:
α : Type u
inst✝² : Group α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c : α
h : ∀ (ε : α), 1 < ε → a < b * ε
h₁ : b < a
⊢ a < a

Next tactic:
simpa using h _ (lt_inv_mul_iff_lt.mpr h₁)
@[to_additive]
theorem div_le_inv_mul_iff [CovariantClass α α (swap (· * ·)) (· ≤ ·)] :
    a / b ≤ a⁻¹ * b ↔ a ≤ b := by
  

Proof state:
α : Type u
inst✝³ : Group α
inst✝² : LinearOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c : α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
⊢ a / b ≤ a⁻¹ * b ↔ a ≤ b

Next tactic:
rw [div_eq_mul_inv, mul_inv_le_inv_mul_iff]
@[to_additive]
theorem div_le_inv_mul_iff [CovariantClass α α (swap (· * ·)) (· ≤ ·)] :
    a / b ≤ a⁻¹ * b ↔ a ≤ b := by
  rw [div_eq_mul_inv, mul_inv_le_inv_mul_iff]
  

Proof state:
α : Type u
inst✝³ : Group α
inst✝² : LinearOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b c : α
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
⊢ a * a ≤ b * b ↔ a ≤ b

Next tactic:
exact
    ⟨fun h => not_lt.mp fun k => not_lt.mpr h (mul_lt_mul_of_lt_of_lt k k), fun h =>
      mul_le_mul' h h⟩
@[to_additive]
theorem div_le_div_flip {α : Type*} [CommGroup α] [LinearOrder α]
    [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} : a / b ≤ b / a ↔ a ≤ b := by
  

Proof state:
α✝ : Type u
inst✝⁵ : Group α✝
inst✝⁴ : LinearOrder α✝
inst✝³ : CovariantClass α✝ α✝ (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a✝ b✝ c : α✝
α : Type u_1
inst✝² : CommGroup α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a / b ≤ b / a ↔ a ≤ b

Next tactic:
rw [div_eq_mul_inv b, mul_comm]
@[to_additive]
theorem div_le_div_flip {α : Type*} [CommGroup α] [LinearOrder α]
    [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} : a / b ≤ b / a ↔ a ≤ b := by
  rw [div_eq_mul_inv b, mul_comm]
  

Proof state:
α✝ : Type u
inst✝⁵ : Group α✝
inst✝⁴ : LinearOrder α✝
inst✝³ : CovariantClass α✝ α✝ (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a✝ b✝ c : α✝
α : Type u_1
inst✝² : CommGroup α
inst✝¹ : LinearOrder α
inst✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a / b ≤ a⁻¹ * b ↔ a ≤ b

Next tactic:
exact div_le_inv_mul_iff
@[to_additive exists_zero_lt]
theorem exists_one_lt' [Nontrivial α] : ∃ a : α, 1 < a := by
  

Proof state:
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
⊢ ∃ a, 1 < a

Next tactic:
obtain ⟨y, hy⟩ := Decidable.exists_ne (1 : α)
@[to_additive exists_zero_lt]
theorem exists_one_lt' [Nontrivial α] : ∃ a : α, 1 < a := by
  obtain ⟨y, hy⟩ := Decidable.exists_ne (1 : α)
  

Proof state:
case intro
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
y : α
hy : y ≠ 1
⊢ ∃ a, 1 < a

Next tactic:
obtain h|h := hy.lt_or_lt
@[to_additive exists_zero_lt]
theorem exists_one_lt' [Nontrivial α] : ∃ a : α, 1 < a := by
  obtain ⟨y, hy⟩ := Decidable.exists_ne (1 : α)
  obtain h|h := hy.lt_or_lt
  · 

Proof state:
case intro.inl
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
y : α
hy : y ≠ 1
h : y < 1
⊢ ∃ a, 1 < a

Next tactic:
exact ⟨y⁻¹, one_lt_inv'.mpr h⟩
@[to_additive exists_zero_lt]
theorem exists_one_lt' [Nontrivial α] : ∃ a : α, 1 < a := by
  obtain ⟨y, hy⟩ := Decidable.exists_ne (1 : α)
  obtain h|h := hy.lt_or_lt
  · exact ⟨y⁻¹, one_lt_inv'.mpr h⟩
  · 

Proof state:
case intro.inr
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
y : α
hy : y ≠ 1
h : 1 < y
⊢ ∃ a, 1 < a

Next tactic:
exact ⟨y, h⟩
@[to_additive]
instance (priority := 100) LinearOrderedCommGroup.to_noMaxOrder [Nontrivial α] : NoMaxOrder α :=
  ⟨by
    

Proof state:
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
⊢ ∀ (a : α), ∃ b, a < b

Next tactic:
obtain ⟨y, hy⟩ : ∃ a : α, 1 < a := exists_one_lt'
@[to_additive]
instance (priority := 100) LinearOrderedCommGroup.to_noMaxOrder [Nontrivial α] : NoMaxOrder α :=
  ⟨by
    obtain ⟨y, hy⟩ : ∃ a : α, 1 < a := exists_one_lt'
    

Proof state:
case intro
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
y : α
hy : 1 < y
⊢ ∀ (a : α), ∃ b, a < b

Next tactic:
exact fun a => ⟨a * y, lt_mul_of_one_lt_right' a hy⟩
@[to_additive]
instance (priority := 100) LinearOrderedCommGroup.to_noMinOrder [Nontrivial α] : NoMinOrder α :=
  ⟨by
    

Proof state:
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
⊢ ∀ (a : α), ∃ b, b < a

Next tactic:
obtain ⟨y, hy⟩ : ∃ a : α, 1 < a := exists_one_lt'
@[to_additive]
instance (priority := 100) LinearOrderedCommGroup.to_noMinOrder [Nontrivial α] : NoMinOrder α :=
  ⟨by
    obtain ⟨y, hy⟩ : ∃ a : α, 1 < a := exists_one_lt'
    

Proof state:
case intro
α : Type u
inst✝¹ : LinearOrderedCommGroup α
a b c : α
inst✝ : Nontrivial α
y : α
hy : 1 < y
⊢ ∀ (a : α), ∃ b, b < a

Next tactic:
exact fun a => ⟨a / y, (div_lt_self_iff a).mpr hy⟩
@[to_additive (attr := simp)]
theorem inv_le_self_iff : a⁻¹ ≤ a ↔ 1 ≤ a := by 

Proof state:
α : Type u
inst✝ : LinearOrderedCommGroup α
a b c : α
⊢ a⁻¹ ≤ a ↔ 1 ≤ a

Next tactic:
simp [inv_le_iff_one_le_mul']
@[to_additive (attr := simp)]
theorem inv_lt_self_iff : a⁻¹ < a ↔ 1 < a := by 

Proof state:
α : Type u
inst✝ : LinearOrderedCommGroup α
a b c : α
⊢ a⁻¹ < a ↔ 1 < a

Next tactic:
simp [inv_lt_iff_one_lt_mul]
@[to_additive (attr := simp)]
theorem le_inv_self_iff : a ≤ a⁻¹ ↔ a ≤ 1 := by 

Proof state:
α : Type u
inst✝ : LinearOrderedCommGroup α
a b c : α
⊢ a ≤ a⁻¹ ↔ a ≤ 1

Next tactic:
simp [← not_iff_not]
@[to_additive (attr := simp)]
theorem lt_inv_self_iff : a < a⁻¹ ↔ a < 1 := by 

Proof state:
α : Type u
inst✝ : LinearOrderedCommGroup α
a b c : α
⊢ a < a⁻¹ ↔ a < 1

Next tactic:
simp [← not_iff_not]
/-- Construct an `OrderedAddCommGroup` by
designating a positive cone in an existing `AddCommGroup`. -/
def mkOfPositiveCone {α : Type*} [AddCommGroup α] (C : PositiveCone α) : OrderedAddCommGroup α :=
  { ‹AddCommGroup α› with
    le := fun a b => C.nonneg (b - a),
    lt := fun a b => C.pos (b - a),
    lt_iff_le_not_le := fun a b => by simp [C.pos_iff],
    le_refl := fun a => by 

Proof state:
α✝ : Type u
α : Type u_1
inst✝ : AddCommGroup α
C : PositiveCone α
src✝ : AddCommGroup α := inst✝
a : α
⊢ a ≤ a

Next tactic:
simp [C.zero_nonneg]
/-- Construct an `OrderedAddCommGroup` by
designating a positive cone in an existing `AddCommGroup`. -/
def mkOfPositiveCone {α : Type*} [AddCommGroup α] (C : PositiveCone α) : OrderedAddCommGroup α :=
  { ‹AddCommGroup α› with
    le := fun a b => C.nonneg (b - a),
    lt := fun a b => C.pos (b - a),
    lt_iff_le_not_le := fun a b => by simp [C.pos_iff],
    le_refl := fun a => by simp [C.zero_nonneg],
    le_trans := fun a b c nab nbc => by 

Proof state:
α✝ : Type u
α : Type u_1
inst✝ : AddCommGroup α
C : PositiveCone α
src✝ : AddCommGroup α := inst✝
a b c : α
nab : a ≤ b
nbc : b ≤ c
⊢ a ≤ c

Next tactic:
simpa [← sub_add_sub_cancel] using C.add_nonneg nbc nab
/-- Construct an `OrderedAddCommGroup` by
designating a positive cone in an existing `AddCommGroup`. -/
def mkOfPositiveCone {α : Type*} [AddCommGroup α] (C : PositiveCone α) : OrderedAddCommGroup α :=
  { ‹AddCommGroup α› with
    le := fun a b => C.nonneg (b - a),
    lt := fun a b => C.pos (b - a),
    lt_iff_le_not_le := fun a b => by 

Proof state:
α✝ : Type u
α : Type u_1
inst✝ : AddCommGroup α
C : PositiveCone α
src✝ : AddCommGroup α := inst✝
a b : α
⊢ a < b ↔ a ≤ b ∧ ¬b ≤ a

Next tactic:
simp [C.pos_iff]
/-- Construct an `OrderedAddCommGroup` by
designating a positive cone in an existing `AddCommGroup`. -/
def mkOfPositiveCone {α : Type*} [AddCommGroup α] (C : PositiveCone α) : OrderedAddCommGroup α :=
  { ‹AddCommGroup α› with
    le := fun a b => C.nonneg (b - a),
    lt := fun a b => C.pos (b - a),
    lt_iff_le_not_le := fun a b => by simp [C.pos_iff],
    le_refl := fun a => by simp [C.zero_nonneg],
    le_trans := fun a b c nab nbc => by simpa [← sub_add_sub_cancel] using C.add_nonneg nbc nab,
    le_antisymm := fun a b nab nba =>
      eq_of_sub_eq_zero <| C.nonneg_antisymm nba (by 

Proof state:
α✝ : Type u
α : Type u_1
inst✝ : AddCommGroup α
C : PositiveCone α
src✝ : AddCommGroup α := inst✝
a b : α
nab : a ≤ b
nba : b ≤ a
⊢ PositiveCone.nonneg C (-(a - b))

Next tactic:
rwa [neg_sub]
/-- Construct an `OrderedAddCommGroup` by
designating a positive cone in an existing `AddCommGroup`. -/
def mkOfPositiveCone {α : Type*} [AddCommGroup α] (C : PositiveCone α) : OrderedAddCommGroup α :=
  { ‹AddCommGroup α› with
    le := fun a b => C.nonneg (b - a),
    lt := fun a b => C.pos (b - a),
    lt_iff_le_not_le := fun a b => by simp [C.pos_iff],
    le_refl := fun a => by simp [C.zero_nonneg],
    le_trans := fun a b c nab nbc => by simpa [← sub_add_sub_cancel] using C.add_nonneg nbc nab,
    le_antisymm := fun a b nab nba =>
      eq_of_sub_eq_zero <| C.nonneg_antisymm nba (by rwa [neg_sub]),
    add_le_add_left := fun a b nab c => by 

Proof state:
α✝ : Type u
α : Type u_1
inst✝ : AddCommGroup α
C : PositiveCone α
src✝ : AddCommGroup α := inst✝
a b : α
nab : a ≤ b
c : α
⊢ c + a ≤ c + b

Next tactic:
simpa using nab
/-- Construct a `LinearOrderedAddCommGroup` by
designating a positive cone in an existing `AddCommGroup`
such that for every `a`, either `a` or `-a` is non-negative. -/
def mkOfPositiveCone {α : Type*} [AddCommGroup α] (C : TotalPositiveCone α) :
    LinearOrderedAddCommGroup α :=
  { OrderedAddCommGroup.mkOfPositiveCone C.toPositiveCone with
    -- Porting note: was `C.nonneg_total (b - a)`
    le_total := fun a b => by 

Proof state:
α✝ : Type u
α : Type u_1
inst✝ : AddCommGroup α
C : TotalPositiveCone α
src✝ : OrderedAddCommGroup α := OrderedAddCommGroup.mkOfPositiveCone C.toPositiveCone
a b : α
⊢ a ≤ b ∨ b ≤ a

Next tactic:
simpa [neg_sub] using C.nonneg_total (b - a)
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
⊢ IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)

Next tactic:
refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · 

Proof state:
case refine_1
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
h : IsLocalHomeomorphOn f s
x : X
hx : x ∈ s
⊢ ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)

Next tactic:
obtain ⟨e, hxe, rfl⟩ := h x hx
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · obtain ⟨e, hxe, rfl⟩ := h x hx
    

Proof state:
case refine_1.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f : X → Y
s : Set X
t : Set Y
x : X
hx : x ∈ s
e : PartialHomeomorph X Y
hxe : x ∈ e.source
h : IsLocalHomeomorphOn (↑e) s
⊢ ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U ↑e)

Next tactic:
exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · obtain ⟨e, hxe, rfl⟩ := h x hx
    exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩
  · 

Proof state:
case refine_2
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
h : ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)
x : X
hx : x ∈ s
⊢ ∃ e, x ∈ e.source ∧ f = ↑e

Next tactic:
obtain ⟨U, hU, emb⟩ := h x hx
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · obtain ⟨e, hxe, rfl⟩ := h x hx
    exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩
  · obtain ⟨U, hU, emb⟩ := h x hx
    

Proof state:
case refine_2.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
h : ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)
x : X
hx : x ∈ s
U : Set X
hU : U ∈ 𝓝 x
emb : OpenEmbedding (Set.restrict U f)
⊢ ∃ e, x ∈ e.source ∧ f = ↑e

Next tactic:
have : OpenEmbedding ((interior U).restrict f)
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · obtain ⟨e, hxe, rfl⟩ := h x hx
    exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩
  · obtain ⟨U, hU, emb⟩ := h x hx
    have : OpenEmbedding ((interior U).restrict f)
    · 

Proof state:
case this
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
h : ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)
x : X
hx : x ∈ s
U : Set X
hU : U ∈ 𝓝 x
emb : OpenEmbedding (Set.restrict U f)
⊢ OpenEmbedding (Set.restrict (interior U) f)

Next tactic:
refine emb.comp ⟨embedding_inclusion interior_subset, ?_⟩
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · obtain ⟨e, hxe, rfl⟩ := h x hx
    exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩
  · obtain ⟨U, hU, emb⟩ := h x hx
    have : OpenEmbedding ((interior U).restrict f)
    · refine emb.comp ⟨embedding_inclusion interior_subset, ?_⟩
      

Proof state:
case this
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
h : ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)
x : X
hx : x ∈ s
U : Set X
hU : U ∈ 𝓝 x
emb : OpenEmbedding (Set.restrict U f)
⊢ IsOpen (Set.range (Set.inclusion (_ : interior U ⊆ U)))

Next tactic:
rw [Set.range_inclusion]
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · obtain ⟨e, hxe, rfl⟩ := h x hx
    exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩
  · obtain ⟨U, hU, emb⟩ := h x hx
    have : OpenEmbedding ((interior U).restrict f)
    · refine emb.comp ⟨embedding_inclusion interior_subset, ?_⟩
      rw [Set.range_inclusion]; 

Proof state:
case this
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
h : ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)
x : X
hx : x ∈ s
U : Set X
hU : U ∈ 𝓝 x
emb : OpenEmbedding (Set.restrict U f)
⊢ IsOpen {x | ↑x ∈ interior U}

Next tactic:
exact isOpen_induced isOpen_interior
theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f) := by
  refine ⟨fun h x hx ↦ ?_, fun h x hx ↦ ?_⟩
  · obtain ⟨e, hxe, rfl⟩ := h x hx
    exact ⟨e.source, e.open_source.mem_nhds hxe, e.openEmbedding_restrict⟩
  · obtain ⟨U, hU, emb⟩ := h x hx
    have : OpenEmbedding ((interior U).restrict f)
    · refine emb.comp ⟨embedding_inclusion interior_subset, ?_⟩
      rw [Set.range_inclusion]; exact isOpen_induced isOpen_interior
    

Proof state:
case refine_2.intro.intro
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
g : Y → Z
f✝ : X → Y
s : Set X
t : Set Y
f : X → Y
h : ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (Set.restrict U f)
x : X
hx : x ∈ s
U : Set X
hU : U ∈ 𝓝 x
emb : OpenEmbedding (Set.restrict U f)
this : OpenEmbedding (Set.restrict (interior U) f)
⊢ ∃ e, x ∈ e.source ∧ f = ↑e

Next tactic:
obtain ⟨cont, inj, openMap⟩ := openEmbedding_iff_continuous_injective_open.mp this