zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_21 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ)
  (minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∑ i, ‖y i‖ ≥ ∑ i, ‖xm i‖ + inner ((1 / (t * μ)) • (x - xm)) (y - xm) →
          ∀ i ∈ Finset.univ, |xm i| + (y i - xm i) * (μ⁻¹ * t⁻¹ * (x i - xm i)) ≤ |y i| := sorry

Tactic state before:
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
⊢ ∑ i, ‖y i‖ ≥ ∑ i, ‖xm i‖ + inner ((1 / (t * μ)) • (x - xm)) (y - xm)

Tactic:
simp
    rw [← sum_add_distrib]
    apply sum_le_sum

Tactic state after:
[case h
 n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 ⊢ ∀ i ∈ Finset.univ, |xm i| + (y i - xm i) * (μ⁻¹ * t⁻¹ * (x i - xm i)) ≤ |y i|]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_22 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          let abs_subg := SubderivAt_abs (xm i);
          xm i = 0 →
            x i = 0 ∨ |x i| ≤ t * μ →
              |x i| ≤ t * μ → y i * (μ⁻¹ * t⁻¹ * x i) ≤ μ⁻¹ * t⁻¹ * |x i * y i| → 0 < μ * t := sorry

Tactic state before:
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
abs_subg : SubderivAt abs (xm i) = if xm i = 0 then Set.Icc (-1) 1 else {sign (xm i)} := SubderivAt_abs (xm i)
hxm : xm i = 0
minpoint : x i = 0 ∨ |x i| ≤ t * μ
aux : |x i| ≤ t * μ
⊢ y i * (μ⁻¹ * t⁻¹ * x i) ≤ μ⁻¹ * t⁻¹ * |x i * y i|

Tactic:
rw [mul_comm, mul_assoc _ (x i), mul_le_mul_left]
    apply le_abs_self
    rw [← mul_inv, inv_pos]

Tactic state after:
[n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 abs_subg : SubderivAt abs (xm i) = if xm i = 0 then Set.Icc (-1) 1 else {sign (xm i)} := SubderivAt_abs (xm i)
 hxm : xm i = 0
 minpoint : x i = 0 ∨ |x i| ≤ t * μ
 aux : |x i| ≤ t * μ
 ⊢ 0 < μ * t]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_23 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          let abs_subg := SubderivAt_abs (xm i);
          xm i = 0 →
            x i = 0 ∨ |x i| ≤ t * μ →
              |x i| ≤ t * μ → μ⁻¹ * t⁻¹ * |x i * y i| ≤ |y i| * μ⁻¹ * t⁻¹ * t * μ → 0 ≤ |y i| * μ⁻¹ * t⁻¹ := sorry

Tactic state before:
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
abs_subg : SubderivAt abs (xm i) = if xm i = 0 then Set.Icc (-1) 1 else {sign (xm i)} := SubderivAt_abs (xm i)
hxm : xm i = 0
minpoint : x i = 0 ∨ |x i| ≤ t * μ
aux : |x i| ≤ t * μ
⊢ μ⁻¹ * t⁻¹ * |x i * y i| ≤ |y i| * μ⁻¹ * t⁻¹ * t * μ

Tactic:
rw [abs_mul, ← mul_assoc, mul_comm, ← mul_assoc, ← mul_assoc, mul_assoc _ t]
    apply mul_le_mul_of_nonneg_left
    exact aux

Tactic state after:
[case a0
 n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 abs_subg : SubderivAt abs (xm i) = if xm i = 0 then Set.Icc (-1) 1 else {sign (xm i)} := SubderivAt_abs (xm i)
 hxm : xm i = 0
 minpoint : x i = 0 ∨ |x i| ≤ t * μ
 aux : |x i| ≤ t * μ
 ⊢ 0 ≤ |y i| * μ⁻¹ * t⁻¹]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_24 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          let abs_subg := SubderivAt_abs (xm i);
          xm i = 0 → x i = 0 ∨ |x i| ≤ t * μ → |x i| ≤ t * μ → |y i| * μ⁻¹ * t⁻¹ * t * μ = |y i| → t ≠ 0 := sorry

Tactic state before:
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
abs_subg : SubderivAt abs (xm i) = if xm i = 0 then Set.Icc (-1) 1 else {sign (xm i)} := SubderivAt_abs (xm i)
hxm : xm i = 0
minpoint : x i = 0 ∨ |x i| ≤ t * μ
aux : |x i| ≤ t * μ
⊢ |y i| * μ⁻¹ * t⁻¹ * t * μ = |y i|

Tactic:
rw [mul_assoc _ (t⁻¹) t, inv_mul_cancel₀, mul_one]
    rw [mul_assoc _ (μ⁻¹) μ, inv_mul_cancel₀, mul_one]
    linarith [μpos]

Tactic state after:
[n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 abs_subg : SubderivAt abs (xm i) = if xm i = 0 then Set.Icc (-1) 1 else {sign (xm i)} := SubderivAt_abs (xm i)
 hxm : xm i = 0
 minpoint : x i = 0 ∨ |x i| ≤ t * μ
 aux : |x i| ≤ t * μ
 ⊢ t ≠ 0]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_25 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ)
  (minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          let abs_subg := SubderivAt_abs (xm i);
          ¬xm i = 0 →
            |xm i| + (y i - xm i) * (μ⁻¹ * t⁻¹ * (x i - xm i)) ≤ |y i| →
              ¬(xm i = 0 ∧ SubderivAt abs (xm i) = Set.Icc (-1) 1) := sorry

Tactic state before:
case neg
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
abs_subg : SubderivAt abs (xm i) = if xm i = 0 then Set.Icc (-1) 1 else {sign (xm i)} := SubderivAt_abs (xm i)
hxm : ¬xm i = 0
⊢ |xm i| + (y i - xm i) * (μ⁻¹ * t⁻¹ * (x i - xm i)) ≤ |y i|

Tactic:
rw [eq_ite_iff, or_iff_right] at abs_subg
    rcases abs_subg with ⟨_, abs_subg⟩
    let sgnxm := sign (xm i)

Tactic state after:
[case neg.intro
 n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 hxm : ¬xm i = 0
 left✝ : ¬xm i = 0
 abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
 sgnxm : ℝ := sign (xm i)
 ⊢ |xm i| + (y i - xm i) * (μ⁻¹ * t⁻¹ * (x i - xm i)) ≤ |y i|,
 case neg
 n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 abs_subg : xm i = 0 ∧ SubderivAt abs (xm i) = Set.Icc (-1) 1 ∨ ¬xm i = 0 ∧ SubderivAt abs (xm i) = {sign (xm i)}
 hxm : ¬xm i = 0
 ⊢ ¬(xm i = 0 ∧ SubderivAt abs (xm i) = Set.Icc (-1) 1)]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_26 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ)
  (minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          ¬xm i = 0 →
            ¬xm i = 0 →
              SubderivAt abs (xm i) = {sign (xm i)} →
                let sgnxm := sign (xm i);
                |y i| ≥ |xm i| + inner sgnxm (y i - xm i) →
                  inner sgnxm (y i - xm i) = μ⁻¹ * t⁻¹ * (x i - xm i) * (y i - xm i) →
                    (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) * (sign (x i) * ((|x i| - t * μ) ⊔ 0)).sign =
                      μ⁻¹ * t⁻¹ * (x i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) *
                        (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) := sorry

Tactic state before:
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
hxm : ¬xm i = 0
left✝ : ¬xm i = 0
abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
sgnxm : ℝ := sign (xm i)
aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
⊢ inner sgnxm (y i - xm i) = μ⁻¹ * t⁻¹ * (x i - xm i) * (y i - xm i)

Tactic:
simp [sgnxm]
    rw [minpoint]
    simp

Tactic state after:
[n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 hxm : ¬xm i = 0
 left✝ : ¬xm i = 0
 abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
 sgnxm : ℝ := sign (xm i)
 aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
 ⊢ (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) * (sign (x i) * ((|x i| - t * μ) ⊔ 0)).sign =
     μ⁻¹ * t⁻¹ * (x i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) * (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0))]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_27 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ)
  (minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          ¬xm i = 0 →
            SubderivAt abs (xm i) = {sign (xm i)} →
              let sgnxm := sign (xm i);
              |y i| ≥ |xm i| + inner sgnxm (y i - xm i) →
                x i ≠ 0 →
                  t * μ < |x i| →
                    (|x i| - t * μ) ⊔ 0 = |x i| - t * μ →
                      (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) * (sign (x i) * ((|x i| - t * μ) ⊔ 0)).sign =
                          μ⁻¹ * t⁻¹ * (x i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) *
                            (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) →
                        (y i - sign (x i) * (|x i| - t * μ)) * (sign (x i) * (|x i| - t * μ)).sign =
                          μ⁻¹ * t⁻¹ * (x i - sign (x i) * (|x i| - t * μ)) * y i -
                            μ⁻¹ * t⁻¹ * (x i - sign (x i) * (|x i| - t * μ)) * (sign (x i) * (|x i| - t * μ)) := sorry

Tactic state before:
case intro
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
left✝ : ¬xm i = 0
abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
sgnxm : ℝ := sign (xm i)
aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
xiieq0 : x i ≠ 0
ieq : t * μ < |x i|
eq1 : (|x i| - t * μ) ⊔ 0 = |x i| - t * μ
⊢ (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) * (sign (x i) * ((|x i| - t * μ) ⊔ 0)).sign =
    μ⁻¹ * t⁻¹ * (x i - sign (x i) * ((|x i| - t * μ) ⊔ 0)) * (y i - sign (x i) * ((|x i| - t * μ) ⊔ 0))

Tactic:
rw [eq1]
    simp
    nth_rw 3 [mul_sub]

Tactic state after:
[case intro
 n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 left✝ : ¬xm i = 0
 abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
 sgnxm : ℝ := sign (xm i)
 aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
 xiieq0 : x i ≠ 0
 ieq : t * μ < |x i|
 eq1 : (|x i| - t * μ) ⊔ 0 = |x i| - t * μ
 ⊢ (y i - sign (x i) * (|x i| - t * μ)) * (sign (x i) * (|x i| - t * μ)).sign =
     μ⁻¹ * t⁻¹ * (x i - sign (x i) * (|x i| - t * μ)) * y i -
       μ⁻¹ * t⁻¹ * (x i - sign (x i) * (|x i| - t * μ)) * (sign (x i) * (|x i| - t * μ))]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_28 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ)
  (minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          ¬xm i = 0 →
            SubderivAt abs (xm i) = {sign (xm i)} →
              let sgnxm := sign (xm i);
              |y i| ≥ |xm i| + inner sgnxm (y i - xm i) →
                x i ≠ 0 →
                  t * μ < |x i| →
                    (|x i| - t * μ) ⊔ 0 = |x i| - t * μ →
                      0 < x i → (sign (x i) * (|x i| - t * μ)).sign = 1 → 0 < |x i| - t * μ := sorry

Tactic state before:
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
left✝ : ¬xm i = 0
abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
sgnxm : ℝ := sign (xm i)
aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
xiieq0 : x i ≠ 0
ieq : t * μ < |x i|
eq1 : (|x i| - t * μ) ⊔ 0 = |x i| - t * μ
hx : 0 < x i
⊢ (sign (x i) * (|x i| - t * μ)).sign = 1

Tactic:
apply Real.sign_of_pos
    apply mul_pos
    calc
  0 < 1 := by simp
  1 = sign (x i) := by symm; apply Real.sign_of_pos hx

Tactic state after:
[case hr.hb
 n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 left✝ : ¬xm i = 0
 abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
 sgnxm : ℝ := sign (xm i)
 aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
 xiieq0 : x i ≠ 0
 ieq : t * μ < |x i|
 eq1 : (|x i| - t * μ) ⊔ 0 = |x i| - t * μ
 hx : 0 < x i
 ⊢ 0 < |x i| - t * μ]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_30 {n : ℕ+} {t μ : ℝ} {h : EuclideanSpace ℝ (Fin ↑n) → ℝ}
  (lasso : h = fun y => μ • ∑ i, ‖y i‖) (x xm : EuclideanSpace ℝ (Fin ↑n)) (tpos : 0 < t) (μpos : 0 < μ)
  (minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)) :
  let g := (t * μ) • fun x => ∑ i, ‖x i‖;
  g = t • h →
    0 < t * μ →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ∀ i ∈ Finset.univ,
          ¬xm i = 0 →
            SubderivAt abs (xm i) = {sign (xm i)} →
              let sgnxm := sign (xm i);
              |y i| ≥ |xm i| + inner sgnxm (y i - xm i) →
                x i ≠ 0 →
                  t * μ < |x i| →
                    (|x i| - t * μ) ⊔ 0 = |x i| - t * μ →
                      ¬0 < x i → x i < 0 → (sign (x i) * (|x i| - t * μ)).sign = -1 → 0 < |x i| - t * μ := sorry

Tactic state before:
n : ℕ+
t μ : ℝ
h : EuclideanSpace ℝ (Fin ↑n) → ℝ
lasso : h = fun y => μ • ∑ i, ‖y i‖
x xm : EuclideanSpace ℝ (Fin ↑n)
tpos : 0 < t
μpos : 0 < μ
minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
geqth : g = t • h
tμpos : 0 < t * μ
y : EuclideanSpace ℝ (Fin ↑n)
i : Fin ↑n
a✝ : i ∈ Finset.univ
left✝ : ¬xm i = 0
abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
sgnxm : ℝ := sign (xm i)
aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
xiieq0 : x i ≠ 0
ieq : t * μ < |x i|
eq1 : (|x i| - t * μ) ⊔ 0 = |x i| - t * μ
hx : ¬0 < x i
xneg : x i < 0
⊢ (sign (x i) * (|x i| - t * μ)).sign = -1

Tactic:
apply Real.sign_of_neg
    apply mul_neg_of_neg_of_pos
    calc
  sign (x i) = -1 := by apply Real.sign_of_neg xneg
  _ < 0 := by linarith

Tactic state after:
[case hr.hb
 n : ℕ+
 t μ : ℝ
 h : EuclideanSpace ℝ (Fin ↑n) → ℝ
 lasso : h = fun y => μ • ∑ i, ‖y i‖
 x xm : EuclideanSpace ℝ (Fin ↑n)
 tpos : 0 < t
 μpos : 0 < μ
 minpoint : ∀ (i : Fin ↑n), xm i = sign (x i) * ((|x i| - t * μ) ⊔ 0)
 g : EuclideanSpace ℝ (Fin ↑n) → ℝ := (t * μ) • fun x => ∑ i, ‖x i‖
 geqth : g = t • h
 tμpos : 0 < t * μ
 y : EuclideanSpace ℝ (Fin ↑n)
 i : Fin ↑n
 a✝ : i ∈ Finset.univ
 left✝ : ¬xm i = 0
 abs_subg : SubderivAt abs (xm i) = {sign (xm i)}
 sgnxm : ℝ := sign (xm i)
 aux : |y i| ≥ |xm i| + inner sgnxm (y i - xm i)
 xiieq0 : x i ≠ 0
 ieq : t * μ < |x i|
 eq1 : (|x i| - t * μ) ⊔ 0 = |x i| - t * μ
 hx : ¬0 < x i
 xneg : x i < 0
 ⊢ 0 < |x i| - t * μ]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_32 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} {b : Fin ↑m → ℝ} {μ : ℝ} {μpos : 0 < μ}
  {Ane0 : A ≠ 0} {x₀ : EuclideanSpace ℝ (Fin ↑n)} (p : LASSO A b μ μpos Ane0 x₀) (x y : EuclideanSpace ℝ (Fin ↑n))
  (h_original_goal : ‖Aᵀ *ᵥ (A *ᵥ x - b) - Aᵀ *ᵥ (A *ᵥ y - b)‖ ≤ ↑p.L * ‖x - y‖) :
  ‖Aᵀ *ᵥ A *ᵥ (x - y)‖ ≤ ↑‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) (Aᵀ * A)‖₊ * ‖x - y‖ := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
b : Fin ↑m → ℝ
μ : ℝ
μpos : 0 < μ
Ane0 : A ≠ 0
x₀ : EuclideanSpace ℝ (Fin ↑n)
p : LASSO A b μ μpos Ane0 x₀
x y : EuclideanSpace ℝ (Fin ↑n)
⊢ ‖Aᵀ *ᵥ (A *ᵥ x - b) - Aᵀ *ᵥ (A *ᵥ y - b)‖ ≤ ↑p.L * ‖x - y‖

Tactic:
rw [← Matrix.mulVec_sub, ← sub_add, sub_add_eq_add_sub, sub_add_cancel]
    rw [← Matrix.mulVec_sub]
    rw [p.Leq]

Tactic state after:
[n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 b : Fin ↑m → ℝ
 μ : ℝ
 μpos : 0 < μ
 Ane0 : A ≠ 0
 x₀ : EuclideanSpace ℝ (Fin ↑n)
 p : LASSO A b μ μpos Ane0 x₀
 x y : EuclideanSpace ℝ (Fin ↑n)
 ⊢ ‖Aᵀ *ᵥ A *ᵥ (x - y)‖ ≤ ↑‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) (Aᵀ * A)‖₊ * ‖x - y‖]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_33 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} {μ : ℝ} {μpos : 0 < μ} {Ane0 : A ≠ 0}
  (x : EuclideanSpace ℝ (Fin ↑n)) (a : x ∈ Set.univ) (ε : ℝ) (εpos : ε > 0) (h_original_goal : 0 < ε / ↑↑n / μ) :
  0 < ↑↑n := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
b : Fin ↑m → ℝ
μ : ℝ
μpos : 0 < μ
Ane0 : A ≠ 0
x₀ : EuclideanSpace ℝ (Fin ↑n)
p : LASSO A b μ μpos Ane0 x₀
x : EuclideanSpace ℝ (Fin ↑n)
a✝ : x ∈ Set.univ
ε : ℝ
εpos : ε > 0
⊢ 0 < ε / ↑↑n / μ

Tactic:
apply div_pos
    apply div_pos
    linarith

Tactic state after:
[case ha.hb
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 b : Fin ↑m → ℝ
 μ : ℝ
 μpos : 0 < μ
 Ane0 : A ≠ 0
 x₀ : EuclideanSpace ℝ (Fin ↑n)
 p : LASSO A b μ μpos Ane0 x₀
 x : EuclideanSpace ℝ (Fin ↑n)
 a✝ : x ∈ Set.univ
 ε : ℝ
 εpos : ε > 0
 ⊢ 0 < ↑↑n,
 case hb
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 b : Fin ↑m → ℝ
 μ : ℝ
 μpos : 0 < μ
 Ane0 : A ≠ 0
 x₀ : EuclideanSpace ℝ (Fin ↑n)
 p : LASSO A b μ μpos Ane0 x₀
 x : EuclideanSpace ℝ (Fin ↑n)
 a✝ : x ∈ Set.univ
 ε : ℝ
 εpos : ε > 0
 ⊢ 0 < μ]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_34 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} {μ : ℝ} {μpos : 0 < μ} {Ane0 : A ≠ 0}
  (x : EuclideanSpace ℝ (Fin ↑n)) (a : x ∈ Set.univ) (ε : ℝ) (εpos : ε > 0) (h_original_goal : 0 < ε / ↑↑n / μ) :
  0 < μ := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
b : Fin ↑m → ℝ
μ : ℝ
μpos : 0 < μ
Ane0 : A ≠ 0
x₀ : EuclideanSpace ℝ (Fin ↑n)
p : LASSO A b μ μpos Ane0 x₀
x : EuclideanSpace ℝ (Fin ↑n)
a✝ : x ∈ Set.univ
ε : ℝ
εpos : ε > 0
⊢ 0 < ε / ↑↑n / μ

Tactic:
apply div_pos
    apply div_pos
    linarith

Tactic state after:
[case ha.hb
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 b : Fin ↑m → ℝ
 μ : ℝ
 μpos : 0 < μ
 Ane0 : A ≠ 0
 x₀ : EuclideanSpace ℝ (Fin ↑n)
 p : LASSO A b μ μpos Ane0 x₀
 x : EuclideanSpace ℝ (Fin ↑n)
 a✝ : x ∈ Set.univ
 ε : ℝ
 εpos : ε > 0
 ⊢ 0 < ↑↑n,
 case hb
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 b : Fin ↑m → ℝ
 μ : ℝ
 μpos : 0 < μ
 Ane0 : A ≠ 0
 x₀ : EuclideanSpace ℝ (Fin ↑n)
 p : LASSO A b μ μpos Ane0 x₀
 x : EuclideanSpace ℝ (Fin ↑n)
 a✝ : x ∈ Set.univ
 ε : ℝ
 εpos : ε > 0
 ⊢ 0 < μ]