l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem and_eq_false_eq_eq_false_or_eq_false (a b : Bool) :
    ((a && b) = false) = (a = false ∨ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case false.false
⊢ ((false && false) = false) = (false = false ∨ false = false)

Next tactic:
simp
@[simp]
theorem and_eq_false_eq_eq_false_or_eq_false (a b : Bool) :
    ((a && b) = false) = (a = false ∨ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case false.true
⊢ ((false && true) = false) = (false = false ∨ true = false)

Next tactic:
simp
@[simp]
theorem and_eq_false_eq_eq_false_or_eq_false (a b : Bool) :
    ((a && b) = false) = (a = false ∨ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case true.false
⊢ ((true && false) = false) = (true = false ∨ false = false)

Next tactic:
simp
@[simp]
theorem and_eq_false_eq_eq_false_or_eq_false (a b : Bool) :
    ((a && b) = false) = (a = false ∨ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case true.true
⊢ ((true && true) = false) = (true = false ∨ true = false)

Next tactic:
simp
@[simp]
theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false) := by
  

Proof state:
a b : Bool
⊢ ((a || b) = false) = (a = false ∧ b = false)

Next tactic:
cases a
@[simp]
theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false) := by
  cases a <;> 

Proof state:
case false
b : Bool
⊢ ((false || b) = false) = (false = false ∧ b = false)

Next tactic:
cases b
@[simp]
theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false) := by
  cases a <;> 

Proof state:
case true
b : Bool
⊢ ((true || b) = false) = (true = false ∧ b = false)

Next tactic:
cases b
@[simp]
theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case false.false
⊢ ((false || false) = false) = (false = false ∧ false = false)

Next tactic:
simp
@[simp]
theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case false.true
⊢ ((false || true) = false) = (false = false ∧ true = false)

Next tactic:
simp
@[simp]
theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case true.false
⊢ ((true || false) = false) = (true = false ∧ false = false)

Next tactic:
simp
@[simp]
theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false) := by
  cases a <;> cases b <;> 

Proof state:
case true.true
⊢ ((true || true) = false) = (true = false ∧ true = false)

Next tactic:
simp
theorem not_eq_false_eq_eq_true (a : Bool) : (not a = false) = (a = true) := by 

Proof state:
a : Bool
⊢ ((!a) = false) = (a = true)

Next tactic:
cases a
theorem not_eq_false_eq_eq_true (a : Bool) : (not a = false) = (a = true) := by cases a <;> 

Proof state:
case false
⊢ ((!false) = false) = (false = true)

Next tactic:
simp
theorem not_eq_false_eq_eq_true (a : Bool) : (not a = false) = (a = true) := by cases a <;> 

Proof state:
case true
⊢ ((!true) = false) = (true = true)

Next tactic:
simp
theorem coe_false : ↑false = False := by 

Proof state:
⊢ (false = true) = False

Next tactic:
simp
theorem coe_true : ↑true = True := by 

Proof state:
⊢ (true = true) = True

Next tactic:
simp
theorem coe_sort_false : (↥false : Prop) = False := by 

Proof state:
⊢ (false = true) = False

Next tactic:
simp
theorem coe_sort_true : (↥true : Prop) = True := by 

Proof state:
⊢ (true = true) = True

Next tactic:
simp
theorem decide_iff (p : Prop) [d : Decidable p] : decide p = true ↔ p := by 

Proof state:
p : Prop
d : Decidable p
⊢ decide p = true ↔ p

Next tactic:
simp
theorem bool_iff_false {b : Bool} : ¬b ↔ b = false := by 

Proof state:
b : Bool
⊢ ¬b = true ↔ b = false

Next tactic:
cases b
theorem bool_iff_false {b : Bool} : ¬b ↔ b = false := by cases b <;> 

Proof state:
case false
⊢ ¬false = true ↔ false = false

Next tactic:
exact by decide
theorem bool_iff_false {b : Bool} : ¬b ↔ b = false := by cases b <;> exact by 

Proof state:
⊢ ¬false = true ↔ false = false

Next tactic:
decide
theorem bool_iff_false {b : Bool} : ¬b ↔ b = false := by cases b <;> 

Proof state:
case true
⊢ ¬true = true ↔ true = false

Next tactic:
exact by decide
theorem bool_iff_false {b : Bool} : ¬b ↔ b = false := by cases b <;> exact by 

Proof state:
⊢ ¬true = true ↔ true = false

Next tactic:
decide
theorem decide_congr {p q : Prop} [Decidable p] [Decidable q] (h : p ↔ q) :
    decide p = decide q := by
  

Proof state:
p q : Prop
inst✝¹ : Decidable p
inst✝ : Decidable q
h : p ↔ q
⊢ decide p = decide q

Next tactic:
cases h' : decide q with
  | false => exact decide_false (mt h.1 <| of_decide_false h')
  | true => exact decide_true (h.2 <| of_decide_true h')
theorem decide_congr {p q : Prop} [Decidable p] [Decidable q] (h : p ↔ q) :
    decide p = decide q := by
  

Proof state:
p q : Prop
inst✝¹ : Decidable p
inst✝ : Decidable q
h : p ↔ q
x✝ : Bool
h' : decide q = x✝
⊢ decide p = x✝

Next tactic:
cases h' : decide q with
  | false => exact decide_false (mt h.1 <| of_decide_false h')
  | true => exact decide_true (h.2 <| of_decide_true h')
theorem decide_congr {p q : Prop} [Decidable p] [Decidable q] (h : p ↔ q) :
    decide p = decide q := by
  cases h' : decide q with
  

Proof state:
case false
p q : Prop
inst✝¹ : Decidable p
inst✝ : Decidable q
h : p ↔ q
h' : decide q = false
⊢ decide p = false

Next tactic:
| false => exact decide_false (mt h.1 <| of_decide_false h')
theorem decide_congr {p q : Prop} [Decidable p] [Decidable q] (h : p ↔ q) :
    decide p = decide q := by
  cases h' : decide q with
  | false => 

Proof state:
case false
p q : Prop
inst✝¹ : Decidable p
inst✝ : Decidable q
h : p ↔ q
h' : decide q = false
⊢ decide p = false

Next tactic:
exact decide_false (mt h.1 <| of_decide_false h')
theorem decide_congr {p q : Prop} [Decidable p] [Decidable q] (h : p ↔ q) :
    decide p = decide q := by
  cases h' : decide q with
  | false => exact decide_false (mt h.1 <| of_decide_false h')
  

Proof state:
case true
p q : Prop
inst✝¹ : Decidable p
inst✝ : Decidable q
h : p ↔ q
h' : decide q = true
⊢ decide p = true

Next tactic:
| true => exact decide_true (h.2 <| of_decide_true h')
theorem decide_congr {p q : Prop} [Decidable p] [Decidable q] (h : p ↔ q) :
    decide p = decide q := by
  cases h' : decide q with
  | false => exact decide_false (mt h.1 <| of_decide_false h')
  | true => 

Proof state:
case true
p q : Prop
inst✝¹ : Decidable p
inst✝ : Decidable q
h : p ↔ q
h' : decide q = true
⊢ decide p = true

Next tactic:
exact decide_true (h.2 <| of_decide_true h')
theorem coe_or_iff (a b : Bool) : a || b ↔ a ∨ b := by 

Proof state:
a b : Bool
⊢ (a || b) = true ↔ a = true ∨ b = true

Next tactic:
simp
theorem coe_and_iff (a b : Bool) : a && b ↔ a ∧ b := by 

Proof state:
a b : Bool
⊢ (a && b) = true ↔ a = true ∧ b = true

Next tactic:
simp
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  

Proof state:
a b : Bool
⊢ xor a b = true ↔ Xor' (a = true) (b = true)

Next tactic:
cases a
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> 

Proof state:
case false
b : Bool
⊢ xor false b = true ↔ Xor' (false = true) (b = true)

Next tactic:
cases b
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> 

Proof state:
case true
b : Bool
⊢ xor true b = true ↔ Xor' (true = true) (b = true)

Next tactic:
cases b
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> 

Proof state:
case false.false
⊢ xor false false = true ↔ Xor' (false = true) (false = true)

Next tactic:
exact by decide
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> exact by 

Proof state:
⊢ xor false false = true ↔ Xor' (false = true) (false = true)

Next tactic:
decide
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> 

Proof state:
case false.true
⊢ xor false true = true ↔ Xor' (false = true) (true = true)

Next tactic:
exact by decide
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> exact by 

Proof state:
⊢ xor false true = true ↔ Xor' (false = true) (true = true)

Next tactic:
decide
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> 

Proof state:
case true.false
⊢ xor true false = true ↔ Xor' (true = true) (false = true)

Next tactic:
exact by decide
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> exact by 

Proof state:
⊢ xor true false = true ↔ Xor' (true = true) (false = true)

Next tactic:
decide
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> 

Proof state:
case true.true
⊢ xor true true = true ↔ Xor' (true = true) (true = true)

Next tactic:
exact by decide
theorem coe_xor_iff (a b : Bool) : xor a b ↔ Xor' (a = true) (b = true) := by
  cases a <;> cases b <;> exact by 

Proof state:
⊢ xor true true = true ↔ Xor' (true = true) (true = true)

Next tactic:
decide
@[simp]
theorem ite_eq_true_distrib (c : Prop) [Decidable c] (a b : Bool) :
    ((if c then a else b) = true) = if c then a = true else b = true := by 

Proof state:
c : Prop
inst✝ : Decidable c
a b : Bool
⊢ ((if c then a else b) = true) = if c then a = true else b = true

Next tactic:
by_cases c
@[simp]
theorem ite_eq_true_distrib (c : Prop) [Decidable c] (a b : Bool) :
    ((if c then a else b) = true) = if c then a = true else b = true := by by_cases c <;> 

Proof state:
case pos
c : Prop
inst✝ : Decidable c
a b : Bool
h✝ : c
⊢ ((if c then a else b) = true) = if c then a = true else b = true

Next tactic:
simp [*]
@[simp]
theorem ite_eq_true_distrib (c : Prop) [Decidable c] (a b : Bool) :
    ((if c then a else b) = true) = if c then a = true else b = true := by by_cases c <;> 

Proof state:
case neg
c : Prop
inst✝ : Decidable c
a b : Bool
h✝ : ¬c
⊢ ((if c then a else b) = true) = if c then a = true else b = true

Next tactic:
simp [*]
@[simp]
theorem ite_eq_false_distrib (c : Prop) [Decidable c] (a b : Bool) :
    ((if c then a else b) = false) = if c then a = false else b = false := by
  

Proof state:
c : Prop
inst✝ : Decidable c
a b : Bool
⊢ ((if c then a else b) = false) = if c then a = false else b = false

Next tactic:
by_cases c
@[simp]
theorem ite_eq_false_distrib (c : Prop) [Decidable c] (a b : Bool) :
    ((if c then a else b) = false) = if c then a = false else b = false := by
  by_cases c <;> 

Proof state:
case pos
c : Prop
inst✝ : Decidable c
a b : Bool
h✝ : c
⊢ ((if c then a else b) = false) = if c then a = false else b = false

Next tactic:
simp [*]
@[simp]
theorem ite_eq_false_distrib (c : Prop) [Decidable c] (a b : Bool) :
    ((if c then a else b) = false) = if c then a = false else b = false := by
  by_cases c <;> 

Proof state:
case neg
c : Prop
inst✝ : Decidable c
a b : Bool
h✝ : ¬c
⊢ ((if c then a else b) = false) = if c then a = false else b = false

Next tactic:
simp [*]
theorem norm_smul_le (r : α) (x : β) : ‖r • x‖ ≤ ‖r‖ * ‖x‖ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : SeminormedAddGroup α
inst✝² : SeminormedAddGroup β
inst✝¹ : SMulZeroClass α β
inst✝ : BoundedSMul α β
r : α
x : β
⊢ ‖r • x‖ ≤ ‖r‖ * ‖x‖

Next tactic:
simpa [smul_zero] using dist_smul_pair r 0 x
theorem dist_smul_le (s : α) (x y : β) : dist (s • x) (s • y) ≤ ‖s‖ * dist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : SeminormedAddGroup α
inst✝² : SeminormedAddGroup β
inst✝¹ : SMulZeroClass α β
inst✝ : BoundedSMul α β
s : α
x y : β
⊢ dist (s • x) (s • y) ≤ ‖s‖ * dist x y

Next tactic:
simpa only [dist_eq_norm, sub_zero] using dist_smul_pair s x y
/-- Left multiplication is bounded. -/
instance NonUnitalSeminormedRing.to_boundedSMul [NonUnitalSeminormedRing α] : BoundedSMul α α where
  dist_smul_pair' x y₁ y₂ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : NonUnitalSeminormedRing α
x y₁ y₂ : α
⊢ dist (x • y₁) (x • y₂) ≤ dist x 0 * dist y₁ y₂

Next tactic:
simpa [mul_sub, dist_eq_norm] using norm_mul_le x (y₁ - y₂)
/-- Left multiplication is bounded. -/
instance NonUnitalSeminormedRing.to_boundedSMul [NonUnitalSeminormedRing α] : BoundedSMul α α where
  dist_smul_pair' x y₁ y₂ := by simpa [mul_sub, dist_eq_norm] using norm_mul_le x (y₁ - y₂)
  dist_pair_smul' x₁ x₂ y := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : NonUnitalSeminormedRing α
x₁ x₂ y : α
⊢ dist (x₁ • y) (x₂ • y) ≤ dist x₁ x₂ * dist y 0

Next tactic:
simpa [sub_mul, dist_eq_norm] using norm_mul_le (x₁ - x₂) y
/-- Right multiplication is bounded. -/
instance NonUnitalSeminormedRing.to_has_bounded_op_smul [NonUnitalSeminormedRing α] :
    BoundedSMul αᵐᵒᵖ α where
  dist_smul_pair' x y₁ y₂ := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : NonUnitalSeminormedRing α
x : αᵐᵒᵖ
y₁ y₂ : α
⊢ dist (x • y₁) (x • y₂) ≤ dist x 0 * dist y₁ y₂

Next tactic:
simpa [sub_mul, dist_eq_norm, mul_comm] using norm_mul_le (y₁ - y₂) x.unop
/-- Right multiplication is bounded. -/
instance NonUnitalSeminormedRing.to_has_bounded_op_smul [NonUnitalSeminormedRing α] :
    BoundedSMul αᵐᵒᵖ α where
  dist_smul_pair' x y₁ y₂ := by
    simpa [sub_mul, dist_eq_norm, mul_comm] using norm_mul_le (y₁ - y₂) x.unop
  dist_pair_smul' x₁ x₂ y := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : NonUnitalSeminormedRing α
x₁ x₂ : αᵐᵒᵖ
y : α
⊢ dist (x₁ • y) (x₂ • y) ≤ dist x₁ x₂ * dist y 0

Next tactic:
simpa [mul_sub, dist_eq_norm, mul_comm] using norm_mul_le y (x₁ - x₂).unop
theorem BoundedSMul.of_norm_smul_le (h : ∀ (r : α) (x : β), ‖r • x‖ ≤ ‖r‖ * ‖x‖) :
    BoundedSMul α β :=
  { dist_smul_pair' := fun a b₁ b₂ => by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : SeminormedRing α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : Module α β
h : ∀ (r : α) (x : β), ‖r • x‖ ≤ ‖r‖ * ‖x‖
a : α
b₁ b₂ : β
⊢ dist (a • b₁) (a • b₂) ≤ dist a 0 * dist b₁ b₂

Next tactic:
simpa [smul_sub, dist_eq_norm] using h a (b₁ - b₂)
theorem BoundedSMul.of_norm_smul_le (h : ∀ (r : α) (x : β), ‖r • x‖ ≤ ‖r‖ * ‖x‖) :
    BoundedSMul α β :=
  { dist_smul_pair' := fun a b₁ b₂ => by simpa [smul_sub, dist_eq_norm] using h a (b₁ - b₂)
    dist_pair_smul' := fun a₁ a₂ b => by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : SeminormedRing α
inst✝¹ : SeminormedAddCommGroup β
inst✝ : Module α β
h : ∀ (r : α) (x : β), ‖r • x‖ ≤ ‖r‖ * ‖x‖
a₁ a₂ : α
b : β
⊢ dist (a₁ • b) (a₂ • b) ≤ dist a₁ a₂ * dist b 0

Next tactic:
simpa [sub_smul, dist_eq_norm] using h (a₁ - a₂) b
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
⊢ ‖r • x‖ = ‖r‖ * ‖x‖

Next tactic:
by_cases h : r = 0
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  by_cases h : r = 0
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : r = 0
⊢ ‖r • x‖ = ‖r‖ * ‖x‖

Next tactic:
simp [h, zero_smul α x]
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  by_cases h : r = 0
  · simp [h, zero_smul α x]
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r • x‖ = ‖r‖ * ‖x‖

Next tactic:
refine' le_antisymm (norm_smul_le r x) _
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  by_cases h : r = 0
  · simp [h, zero_smul α x]
  · refine' le_antisymm (norm_smul_le r x) _
    

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * ‖x‖ ≤ ‖r • x‖

Next tactic:
calc
      ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖ := by rw [inv_smul_smul₀ h]
      _ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) := by gcongr; apply norm_smul_le
      _ = ‖r • x‖ := by rw [norm_inv, ← mul_assoc, mul_inv_cancel (mt norm_eq_zero.1 h), one_mul]
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  by_cases h : r = 0
  · simp [h, zero_smul α x]
  · refine' le_antisymm (norm_smul_le r x) _
    calc
      ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖

Next tactic:
rw [inv_smul_smul₀ h]
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  by_cases h : r = 0
  · simp [h, zero_smul α x]
  · refine' le_antisymm (norm_smul_le r x) _
    calc
      ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖ := by rw [inv_smul_smul₀ h]
      _ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * ‖r⁻¹ • r • x‖ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖)

Next tactic:
gcongr
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  by_cases h : r = 0
  · simp [h, zero_smul α x]
  · refine' le_antisymm (norm_smul_le r x) _
    calc
      ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖ := by rw [inv_smul_smul₀ h]
      _ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) := by gcongr; 

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r⁻¹ • r • x‖ ≤ ‖r⁻¹‖ * ‖r • x‖

Next tactic:
apply norm_smul_le
theorem norm_smul (r : α) (x : β) : ‖r • x‖ = ‖r‖ * ‖x‖ := by
  by_cases h : r = 0
  · simp [h, zero_smul α x]
  · refine' le_antisymm (norm_smul_le r x) _
    calc
      ‖r‖ * ‖x‖ = ‖r‖ * ‖r⁻¹ • r • x‖ := by rw [inv_smul_smul₀ h]
      _ ≤ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) := by gcongr; apply norm_smul_le
      _ = ‖r • x‖ := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddGroup β
inst✝¹ : MulActionWithZero α β
inst✝ : BoundedSMul α β
r : α
x : β
h : ¬r = 0
⊢ ‖r‖ * (‖r⁻¹‖ * ‖r • x‖) = ‖r • x‖

Next tactic:
rw [norm_inv, ← mul_assoc, mul_inv_cancel (mt norm_eq_zero.1 h), one_mul]
theorem dist_smul₀ (s : α) (x y : β) : dist (s • x) (s • y) = ‖s‖ * dist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddCommGroup β
inst✝¹ : Module α β
inst✝ : BoundedSMul α β
s : α
x y : β
⊢ dist (s • x) (s • y) = ‖s‖ * dist x y

Next tactic:
simp_rw [dist_eq_norm, (norm_smul s (x - y)).symm, smul_sub]
theorem edist_smul₀ (s : α) (x y : β) : edist (s • x) (s • y) = ‖s‖₊ • edist x y := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : NormedDivisionRing α
inst✝² : SeminormedAddCommGroup β
inst✝¹ : Module α β
inst✝ : BoundedSMul α β
s : α
x y : β
⊢ edist (s • x) (s • y) = ‖s‖₊ • edist x y

Next tactic:
simp only [edist_nndist, nndist_smul₀, ENNReal.coe_mul, ENNReal.smul_def, smul_eq_mul]
theorem list_sum_right [NonUnitalNonAssocSemiring R] (a : R) (l : List R)
    (h : ∀ b ∈ l, Commute a b) : Commute a l.sum := by
  

Proof state:
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : NonUnitalNonAssocSemiring R
a : R
l : List R
h : ∀ b ∈ l, Commute a b
⊢ Commute a (sum l)

Next tactic:
induction' l with x xs ih
theorem list_sum_right [NonUnitalNonAssocSemiring R] (a : R) (l : List R)
    (h : ∀ b ∈ l, Commute a b) : Commute a l.sum := by
  induction' l with x xs ih
  · 

Proof state:
case nil
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : NonUnitalNonAssocSemiring R
a : R
h : ∀ b ∈ [], Commute a b
⊢ Commute a (sum [])

Next tactic:
exact Commute.zero_right _
theorem list_sum_right [NonUnitalNonAssocSemiring R] (a : R) (l : List R)
    (h : ∀ b ∈ l, Commute a b) : Commute a l.sum := by
  induction' l with x xs ih
  · exact Commute.zero_right _
  · 

Proof state:
case cons
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : NonUnitalNonAssocSemiring R
a x : R
xs : List R
ih : (∀ b ∈ xs, Commute a b) → Commute a (sum xs)
h : ∀ b ∈ x :: xs, Commute a b
⊢ Commute a (sum (x :: xs))

Next tactic:
rw [List.sum_cons]
theorem list_sum_right [NonUnitalNonAssocSemiring R] (a : R) (l : List R)
    (h : ∀ b ∈ l, Commute a b) : Commute a l.sum := by
  induction' l with x xs ih
  · exact Commute.zero_right _
  · rw [List.sum_cons]
    

Proof state:
case cons
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : NonUnitalNonAssocSemiring R
a x : R
xs : List R
ih : (∀ b ∈ xs, Commute a b) → Commute a (sum xs)
h : ∀ b ∈ x :: xs, Commute a b
⊢ Commute a (x + sum xs)

Next tactic:
exact (h _ <| mem_cons_self _ _).add_right (ih fun j hj => h _ <| mem_cons_of_mem _ hj)
@[to_additive]
theorem prod_eq_one_iff [CanonicallyOrderedCommMonoid M] (l : List M) :
    l.prod = 1 ↔ ∀ x ∈ l, x = (1 : M) :=
  ⟨all_one_of_le_one_le_of_prod_eq_one fun _ _ => one_le _, fun h => by
    

Proof state:
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
l : List M
h : ∀ x ∈ l, x = 1
⊢ prod l = 1

Next tactic:
rw [List.eq_replicate.2 ⟨_, h⟩, prod_replicate, one_pow]
@[to_additive]
theorem prod_eq_one_iff [CanonicallyOrderedCommMonoid M] (l : List M) :
    l.prod = 1 ↔ ∀ x ∈ l, x = (1 : M) :=
  ⟨all_one_of_le_one_le_of_prod_eq_one fun _ _ => one_le _, fun h => by
    rw [List.eq_replicate.2 ⟨_, h⟩, prod_replicate, one_pow]; 

Proof state:
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
l : List M
h : ∀ x ∈ l, x = 1
⊢ ℕ
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
l : List M
h : ∀ x ∈ l, x = 1
⊢ length l = ?m.5696

Next tactic:
exact (length l)
@[to_additive]
theorem prod_eq_one_iff [CanonicallyOrderedCommMonoid M] (l : List M) :
    l.prod = 1 ↔ ∀ x ∈ l, x = (1 : M) :=
  ⟨all_one_of_le_one_le_of_prod_eq_one fun _ _ => one_le _, fun h => by
    rw [List.eq_replicate.2 ⟨_, h⟩, prod_replicate, one_pow]; exact (length l); 

Proof state:
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
inst✝ : CanonicallyOrderedCommMonoid M
l : List M
h : ∀ x ∈ l, x = 1
⊢ length l = length l

Next tactic:
rfl
/-- If a product of integers is `-1`, then at least one factor must be `-1`. -/
theorem neg_one_mem_of_prod_eq_neg_one {l : List ℤ} (h : l.prod = -1) : (-1 : ℤ) ∈ l := by
  

Proof state:
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
l : List ℤ
h : prod l = -1
⊢ -1 ∈ l

Next tactic:
obtain ⟨x, h₁, h₂⟩ := exists_mem_ne_one_of_prod_ne_one (ne_of_eq_of_ne h (by decide))
/-- If a product of integers is `-1`, then at least one factor must be `-1`. -/
theorem neg_one_mem_of_prod_eq_neg_one {l : List ℤ} (h : l.prod = -1) : (-1 : ℤ) ∈ l := by
  obtain ⟨x, h₁, h₂⟩ := exists_mem_ne_one_of_prod_ne_one (ne_of_eq_of_ne h (by 

Proof state:
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
l : List ℤ
h : prod l = -1
⊢ -1 ≠ 1

Next tactic:
decide
/-- If a product of integers is `-1`, then at least one factor must be `-1`. -/
theorem neg_one_mem_of_prod_eq_neg_one {l : List ℤ} (h : l.prod = -1) : (-1 : ℤ) ∈ l := by
  obtain ⟨x, h₁, h₂⟩ := exists_mem_ne_one_of_prod_ne_one (ne_of_eq_of_ne h (by decide))
  

Proof state:
case intro.intro
ι : Type u_1
α : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
M₀ : Type u_6
G : Type u_7
R : Type u_8
l : List ℤ
h : prod l = -1
x : ℤ
h₁ : x ∈ l
h₂ : x ≠ 1
⊢ -1 ∈ l

Next tactic:
exact
    Or.resolve_left
        (Int.isUnit_iff.mp
          (prod_isUnit_iff.mp (h.symm ▸ IsUnit.neg isUnit_one : IsUnit l.prod) x h₁))
        h₂ ▸
      h₁