l3lab/ntp-mathlib huggingface dataset:
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
column positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_col_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ j, 0 < ∑ i, A i j) :
    A.det ≠ 0 := by
  cases isEmpty_or_nonempty n
  · simp
  · contrapose! h2
    obtain ⟨v, ⟨h_vnz, h_vA⟩⟩ := Matrix.exists_vecMul_eq_zero_iff.mpr h2
    wlog h_sup : 0 < Finset.sup' Finset.univ Finset.univ_nonempty v
    · refine this h1 inferInstance h2 (-1 • v) ?_ ?_ ?_
      · exact smul_ne_zero (by norm_num) h_vnz
      · rw [Matrix.vecMul_smul, h_vA, smul_zero]
      · obtain ⟨i, hi⟩ := Function.ne_iff.mp h_vnz
        simp_rw [Finset.lt_sup'_iff, Finset.mem_univ, true_and] at h_sup ⊢
        simp_rw [not_exists, not_lt] at h_sup
        refine ⟨i, ?_⟩
        rw [Pi.smul_apply, neg_smul, one_smul, Left.neg_pos_iff]
        refine Ne.lt_of_le hi (h_sup i)
    · obtain ⟨j₀, -, h_j₀⟩ := Finset.exists_mem_eq_sup' Finset.univ_nonempty v
      refine ⟨j₀, ?_⟩
      rw [← mul_le_mul_left (h_j₀ ▸ h_sup), Finset.mul_sum, mul_zero]
      

Proof state:
case intro.intro
n✝ : Type u_1
inst✝³ : Fintype n✝
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h✝ : Nonempty n
h2 : det A = 0
v : n → S
h_vnz : v ≠ 0
h_vA : vecMul v A = 0
h_sup : 0 < Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v
j₀ : n
h_j₀ : Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v = v j₀
⊢ ∑ x : n, v j₀ * A x j₀ ≤ 0

Next tactic:
rw [show 0 = ∑ i, v i * A i j₀ from (congrFun h_vA j₀).symm]
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
column positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_col_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ j, 0 < ∑ i, A i j) :
    A.det ≠ 0 := by
  cases isEmpty_or_nonempty n
  · simp
  · contrapose! h2
    obtain ⟨v, ⟨h_vnz, h_vA⟩⟩ := Matrix.exists_vecMul_eq_zero_iff.mpr h2
    wlog h_sup : 0 < Finset.sup' Finset.univ Finset.univ_nonempty v
    · refine this h1 inferInstance h2 (-1 • v) ?_ ?_ ?_
      · exact smul_ne_zero (by norm_num) h_vnz
      · rw [Matrix.vecMul_smul, h_vA, smul_zero]
      · obtain ⟨i, hi⟩ := Function.ne_iff.mp h_vnz
        simp_rw [Finset.lt_sup'_iff, Finset.mem_univ, true_and] at h_sup ⊢
        simp_rw [not_exists, not_lt] at h_sup
        refine ⟨i, ?_⟩
        rw [Pi.smul_apply, neg_smul, one_smul, Left.neg_pos_iff]
        refine Ne.lt_of_le hi (h_sup i)
    · obtain ⟨j₀, -, h_j₀⟩ := Finset.exists_mem_eq_sup' Finset.univ_nonempty v
      refine ⟨j₀, ?_⟩
      rw [← mul_le_mul_left (h_j₀ ▸ h_sup), Finset.mul_sum, mul_zero]
      rw [show 0 = ∑ i, v i * A i j₀ from (congrFun h_vA j₀).symm]
      

Proof state:
case intro.intro
n✝ : Type u_1
inst✝³ : Fintype n✝
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h✝ : Nonempty n
h2 : det A = 0
v : n → S
h_vnz : v ≠ 0
h_vA : vecMul v A = 0
h_sup : 0 < Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v
j₀ : n
h_j₀ : Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v = v j₀
⊢ ∑ x : n, v j₀ * A x j₀ ≤ ∑ i : n, v i * A i j₀

Next tactic:
refine Finset.sum_le_sum (fun i hi => ?_)
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
column positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_col_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ j, 0 < ∑ i, A i j) :
    A.det ≠ 0 := by
  cases isEmpty_or_nonempty n
  · simp
  · contrapose! h2
    obtain ⟨v, ⟨h_vnz, h_vA⟩⟩ := Matrix.exists_vecMul_eq_zero_iff.mpr h2
    wlog h_sup : 0 < Finset.sup' Finset.univ Finset.univ_nonempty v
    · refine this h1 inferInstance h2 (-1 • v) ?_ ?_ ?_
      · exact smul_ne_zero (by norm_num) h_vnz
      · rw [Matrix.vecMul_smul, h_vA, smul_zero]
      · obtain ⟨i, hi⟩ := Function.ne_iff.mp h_vnz
        simp_rw [Finset.lt_sup'_iff, Finset.mem_univ, true_and] at h_sup ⊢
        simp_rw [not_exists, not_lt] at h_sup
        refine ⟨i, ?_⟩
        rw [Pi.smul_apply, neg_smul, one_smul, Left.neg_pos_iff]
        refine Ne.lt_of_le hi (h_sup i)
    · obtain ⟨j₀, -, h_j₀⟩ := Finset.exists_mem_eq_sup' Finset.univ_nonempty v
      refine ⟨j₀, ?_⟩
      rw [← mul_le_mul_left (h_j₀ ▸ h_sup), Finset.mul_sum, mul_zero]
      rw [show 0 = ∑ i, v i * A i j₀ from (congrFun h_vA j₀).symm]
      refine Finset.sum_le_sum (fun i hi => ?_)
      

Proof state:
case intro.intro
n✝ : Type u_1
inst✝³ : Fintype n✝
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h✝ : Nonempty n
h2 : det A = 0
v : n → S
h_vnz : v ≠ 0
h_vA : vecMul v A = 0
h_sup : 0 < Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v
j₀ : n
h_j₀ : Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v = v j₀
i : n
hi : i ∈ Finset.univ
⊢ v j₀ * A i j₀ ≤ v i * A i j₀

Next tactic:
by_cases h : i = j₀
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
column positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_col_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ j, 0 < ∑ i, A i j) :
    A.det ≠ 0 := by
  cases isEmpty_or_nonempty n
  · simp
  · contrapose! h2
    obtain ⟨v, ⟨h_vnz, h_vA⟩⟩ := Matrix.exists_vecMul_eq_zero_iff.mpr h2
    wlog h_sup : 0 < Finset.sup' Finset.univ Finset.univ_nonempty v
    · refine this h1 inferInstance h2 (-1 • v) ?_ ?_ ?_
      · exact smul_ne_zero (by norm_num) h_vnz
      · rw [Matrix.vecMul_smul, h_vA, smul_zero]
      · obtain ⟨i, hi⟩ := Function.ne_iff.mp h_vnz
        simp_rw [Finset.lt_sup'_iff, Finset.mem_univ, true_and] at h_sup ⊢
        simp_rw [not_exists, not_lt] at h_sup
        refine ⟨i, ?_⟩
        rw [Pi.smul_apply, neg_smul, one_smul, Left.neg_pos_iff]
        refine Ne.lt_of_le hi (h_sup i)
    · obtain ⟨j₀, -, h_j₀⟩ := Finset.exists_mem_eq_sup' Finset.univ_nonempty v
      refine ⟨j₀, ?_⟩
      rw [← mul_le_mul_left (h_j₀ ▸ h_sup), Finset.mul_sum, mul_zero]
      rw [show 0 = ∑ i, v i * A i j₀ from (congrFun h_vA j₀).symm]
      refine Finset.sum_le_sum (fun i hi => ?_)
      by_cases h : i = j₀
      · 

Proof state:
case pos
n✝ : Type u_1
inst✝³ : Fintype n✝
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h✝ : Nonempty n
h2 : det A = 0
v : n → S
h_vnz : v ≠ 0
h_vA : vecMul v A = 0
h_sup : 0 < Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v
j₀ : n
h_j₀ : Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v = v j₀
i : n
hi : i ∈ Finset.univ
h : i = j₀
⊢ v j₀ * A i j₀ ≤ v i * A i j₀

Next tactic:
rw [h]
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
column positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_col_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ j, 0 < ∑ i, A i j) :
    A.det ≠ 0 := by
  cases isEmpty_or_nonempty n
  · simp
  · contrapose! h2
    obtain ⟨v, ⟨h_vnz, h_vA⟩⟩ := Matrix.exists_vecMul_eq_zero_iff.mpr h2
    wlog h_sup : 0 < Finset.sup' Finset.univ Finset.univ_nonempty v
    · refine this h1 inferInstance h2 (-1 • v) ?_ ?_ ?_
      · exact smul_ne_zero (by norm_num) h_vnz
      · rw [Matrix.vecMul_smul, h_vA, smul_zero]
      · obtain ⟨i, hi⟩ := Function.ne_iff.mp h_vnz
        simp_rw [Finset.lt_sup'_iff, Finset.mem_univ, true_and] at h_sup ⊢
        simp_rw [not_exists, not_lt] at h_sup
        refine ⟨i, ?_⟩
        rw [Pi.smul_apply, neg_smul, one_smul, Left.neg_pos_iff]
        refine Ne.lt_of_le hi (h_sup i)
    · obtain ⟨j₀, -, h_j₀⟩ := Finset.exists_mem_eq_sup' Finset.univ_nonempty v
      refine ⟨j₀, ?_⟩
      rw [← mul_le_mul_left (h_j₀ ▸ h_sup), Finset.mul_sum, mul_zero]
      rw [show 0 = ∑ i, v i * A i j₀ from (congrFun h_vA j₀).symm]
      refine Finset.sum_le_sum (fun i hi => ?_)
      by_cases h : i = j₀
      · rw [h]
      · 

Proof state:
case neg
n✝ : Type u_1
inst✝³ : Fintype n✝
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h✝ : Nonempty n
h2 : det A = 0
v : n → S
h_vnz : v ≠ 0
h_vA : vecMul v A = 0
h_sup : 0 < Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v
j₀ : n
h_j₀ : Finset.sup' Finset.univ (_ : Finset.Nonempty Finset.univ) v = v j₀
i : n
hi : i ∈ Finset.univ
h : ¬i = j₀
⊢ v j₀ * A i j₀ ≤ v i * A i j₀

Next tactic:
exact (mul_le_mul_right_of_neg (h1 i j₀ h)).mpr (h_j₀ ▸ Finset.le_sup' v hi)
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
row positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_row_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ i, 0 < ∑ j, A i j) :
    A.det ≠ 0 := by
  

Proof state:
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h2 : ∀ (i : n), 0 < ∑ j : n, A i j
⊢ det A ≠ 0

Next tactic:
rw [← Matrix.det_transpose]
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
row positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_row_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ i, 0 < ∑ j, A i j) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  

Proof state:
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h2 : ∀ (i : n), 0 < ∑ j : n, A i j
⊢ det Aᵀ ≠ 0

Next tactic:
refine det_ne_zero_of_sum_col_pos ?_ ?_
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
row positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_row_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ i, 0 < ∑ j, A i j) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  refine det_ne_zero_of_sum_col_pos ?_ ?_
  · 

Proof state:
case refine_1
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h2 : ∀ (i : n), 0 < ∑ j : n, A i j
⊢ ∀ (i j : n), i ≠ j → Aᵀ i j < 0

Next tactic:
simp_rw [Matrix.transpose_apply]
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
row positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_row_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ i, 0 < ∑ j, A i j) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  refine det_ne_zero_of_sum_col_pos ?_ ?_
  · simp_rw [Matrix.transpose_apply]
    

Proof state:
case refine_1
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h2 : ∀ (i : n), 0 < ∑ j : n, A i j
⊢ ∀ (i j : n), i ≠ j → A j i < 0

Next tactic:
exact fun i j h => h1 j i h.symm
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
row positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_row_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ i, 0 < ∑ j, A i j) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  refine det_ne_zero_of_sum_col_pos ?_ ?_
  · simp_rw [Matrix.transpose_apply]
    exact fun i j h => h1 j i h.symm
  · 

Proof state:
case refine_2
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h2 : ∀ (i : n), 0 < ∑ j : n, A i j
⊢ ∀ (j : n), 0 < ∑ i : n, Aᵀ i j

Next tactic:
simp_rw [Matrix.transpose_apply]
/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
row positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_row_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : ∀ i j, i ≠ j → A i j < 0) (h2 : ∀ i, 0 < ∑ j, A i j) :
    A.det ≠ 0 := by
  rw [← Matrix.det_transpose]
  refine det_ne_zero_of_sum_col_pos ?_ ?_
  · simp_rw [Matrix.transpose_apply]
    exact fun i j h => h1 j i h.symm
  · simp_rw [Matrix.transpose_apply]
    

Proof state:
case refine_2
n : Type u_1
inst✝² : Fintype n
inst✝¹ : DecidableEq n
S : Type u_2
inst✝ : LinearOrderedCommRing S
A : Matrix n n S
h1 : ∀ (i j : n), i ≠ j → A i j < 0
h2 : ∀ (i : n), 0 < ∑ j : n, A i j
⊢ ∀ (j : n), 0 < ∑ x : n, A j x

Next tactic:
exact h2
/-- The complex sine function is everywhere strictly differentiable, with the derivative `cos x`. -/
theorem hasStrictDerivAt_sin (x : ℂ) : HasStrictDerivAt sin (cos x) x := by
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt sin (cos x) x

Next tactic:
simp only [cos, div_eq_mul_inv]
/-- The complex sine function is everywhere strictly differentiable, with the derivative `cos x`. -/
theorem hasStrictDerivAt_sin (x : ℂ) : HasStrictDerivAt sin (cos x) x := by
  simp only [cos, div_eq_mul_inv]
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt sin ((cexp (x * I) + cexp (-x * I)) * 2⁻¹) x

Next tactic:
convert ((((hasStrictDerivAt_id x).neg.mul_const I).cexp.sub
    ((hasStrictDerivAt_id x).mul_const I).cexp).mul_const I).mul_const (2 : ℂ)⁻¹ using 1
/-- The complex sine function is everywhere strictly differentiable, with the derivative `cos x`. -/
theorem hasStrictDerivAt_sin (x : ℂ) : HasStrictDerivAt sin (cos x) x := by
  simp only [cos, div_eq_mul_inv]
  convert ((((hasStrictDerivAt_id x).neg.mul_const I).cexp.sub
    ((hasStrictDerivAt_id x).mul_const I).cexp).mul_const I).mul_const (2 : ℂ)⁻¹ using 1
  

Proof state:
case h.e'_7
x : ℂ
⊢ (cexp (x * I) + cexp (-x * I)) * 2⁻¹ = (cexp (-id x * I) * (-1 * I) - cexp (id x * I) * (1 * I)) * I * 2⁻¹

Next tactic:
simp only [Function.comp, id]
/-- The complex sine function is everywhere strictly differentiable, with the derivative `cos x`. -/
theorem hasStrictDerivAt_sin (x : ℂ) : HasStrictDerivAt sin (cos x) x := by
  simp only [cos, div_eq_mul_inv]
  convert ((((hasStrictDerivAt_id x).neg.mul_const I).cexp.sub
    ((hasStrictDerivAt_id x).mul_const I).cexp).mul_const I).mul_const (2 : ℂ)⁻¹ using 1
  simp only [Function.comp, id]
  

Proof state:
case h.e'_7
x : ℂ
⊢ (cexp (x * I) + cexp (-x * I)) * 2⁻¹ = (cexp (-x * I) * (-1 * I) - cexp (x * I) * (1 * I)) * I * 2⁻¹

Next tactic:
rw [sub_mul, mul_assoc, mul_assoc, I_mul_I, neg_one_mul, neg_neg, mul_one, one_mul, mul_assoc,
    I_mul_I, mul_neg_one, sub_neg_eq_add, add_comm]
/-- The complex cosine function is everywhere strictly differentiable, with the derivative
`-sin x`. -/
theorem hasStrictDerivAt_cos (x : ℂ) : HasStrictDerivAt cos (-sin x) x := by
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt cos (-sin x) x

Next tactic:
simp only [sin, div_eq_mul_inv, neg_mul_eq_neg_mul]
/-- The complex cosine function is everywhere strictly differentiable, with the derivative
`-sin x`. -/
theorem hasStrictDerivAt_cos (x : ℂ) : HasStrictDerivAt cos (-sin x) x := by
  simp only [sin, div_eq_mul_inv, neg_mul_eq_neg_mul]
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt cos (-(cexp (-x * I) - cexp (x * I)) * I * 2⁻¹) x

Next tactic:
convert (((hasStrictDerivAt_id x).mul_const I).cexp.add
    ((hasStrictDerivAt_id x).neg.mul_const I).cexp).mul_const (2 : ℂ)⁻¹ using 1
/-- The complex cosine function is everywhere strictly differentiable, with the derivative
`-sin x`. -/
theorem hasStrictDerivAt_cos (x : ℂ) : HasStrictDerivAt cos (-sin x) x := by
  simp only [sin, div_eq_mul_inv, neg_mul_eq_neg_mul]
  convert (((hasStrictDerivAt_id x).mul_const I).cexp.add
    ((hasStrictDerivAt_id x).neg.mul_const I).cexp).mul_const (2 : ℂ)⁻¹ using 1
  

Proof state:
case h.e'_7
x : ℂ
⊢ -(cexp (-x * I) - cexp (x * I)) * I * 2⁻¹ = (cexp (id x * I) * (1 * I) + cexp (-id x * I) * (-1 * I)) * 2⁻¹

Next tactic:
simp only [Function.comp, id]
/-- The complex cosine function is everywhere strictly differentiable, with the derivative
`-sin x`. -/
theorem hasStrictDerivAt_cos (x : ℂ) : HasStrictDerivAt cos (-sin x) x := by
  simp only [sin, div_eq_mul_inv, neg_mul_eq_neg_mul]
  convert (((hasStrictDerivAt_id x).mul_const I).cexp.add
    ((hasStrictDerivAt_id x).neg.mul_const I).cexp).mul_const (2 : ℂ)⁻¹ using 1
  simp only [Function.comp, id]
  

Proof state:
case h.e'_7
x : ℂ
⊢ -(cexp (-x * I) - cexp (x * I)) * I * 2⁻¹ = (cexp (x * I) * (1 * I) + cexp (-x * I) * (-1 * I)) * 2⁻¹

Next tactic:
ring
/-- The complex hyperbolic sine function is everywhere strictly differentiable, with the derivative
`cosh x`. -/
theorem hasStrictDerivAt_sinh (x : ℂ) : HasStrictDerivAt sinh (cosh x) x := by
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt sinh (cosh x) x

Next tactic:
simp only [cosh, div_eq_mul_inv]
/-- The complex hyperbolic sine function is everywhere strictly differentiable, with the derivative
`cosh x`. -/
theorem hasStrictDerivAt_sinh (x : ℂ) : HasStrictDerivAt sinh (cosh x) x := by
  simp only [cosh, div_eq_mul_inv]
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt sinh ((cexp x + cexp (-x)) * 2⁻¹) x

Next tactic:
convert ((hasStrictDerivAt_exp x).sub (hasStrictDerivAt_id x).neg.cexp).mul_const (2 : ℂ)⁻¹
    using 1
/-- The complex hyperbolic sine function is everywhere strictly differentiable, with the derivative
`cosh x`. -/
theorem hasStrictDerivAt_sinh (x : ℂ) : HasStrictDerivAt sinh (cosh x) x := by
  simp only [cosh, div_eq_mul_inv]
  convert ((hasStrictDerivAt_exp x).sub (hasStrictDerivAt_id x).neg.cexp).mul_const (2 : ℂ)⁻¹
    using 1
  

Proof state:
case h.e'_7
x : ℂ
⊢ (cexp x + cexp (-x)) * 2⁻¹ = (cexp x - cexp (-id x) * -1) * 2⁻¹

Next tactic:
rw [id, mul_neg_one, sub_eq_add_neg, neg_neg]
/-- The complex hyperbolic cosine function is everywhere strictly differentiable, with the
derivative `sinh x`. -/
theorem hasStrictDerivAt_cosh (x : ℂ) : HasStrictDerivAt cosh (sinh x) x := by
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt cosh (sinh x) x

Next tactic:
simp only [sinh, div_eq_mul_inv]
/-- The complex hyperbolic cosine function is everywhere strictly differentiable, with the
derivative `sinh x`. -/
theorem hasStrictDerivAt_cosh (x : ℂ) : HasStrictDerivAt cosh (sinh x) x := by
  simp only [sinh, div_eq_mul_inv]
  

Proof state:
x : ℂ
⊢ HasStrictDerivAt cosh ((cexp x - cexp (-x)) * 2⁻¹) x

Next tactic:
convert ((hasStrictDerivAt_exp x).add (hasStrictDerivAt_id x).neg.cexp).mul_const (2 : ℂ)⁻¹
    using 1
/-- The complex hyperbolic cosine function is everywhere strictly differentiable, with the
derivative `sinh x`. -/
theorem hasStrictDerivAt_cosh (x : ℂ) : HasStrictDerivAt cosh (sinh x) x := by
  simp only [sinh, div_eq_mul_inv]
  convert ((hasStrictDerivAt_exp x).add (hasStrictDerivAt_id x).neg.cexp).mul_const (2 : ℂ)⁻¹
    using 1
  

Proof state:
case h.e'_7
x : ℂ
⊢ (cexp x - cexp (-x)) * 2⁻¹ = (cexp x + cexp (-id x) * -1) * 2⁻¹

Next tactic:
rw [id, mul_neg_one, sub_eq_add_neg]
/-- `sinh` is strictly monotone. -/
theorem sinh_strictMono : StrictMono sinh :=
  strictMono_of_deriv_pos <| by 

Proof state:
x y z : ℝ
⊢ ∀ (x : ℝ), 0 < deriv sinh x

Next tactic:
rw [Real.deriv_sinh]
/-- `sinh` is strictly monotone. -/
theorem sinh_strictMono : StrictMono sinh :=
  strictMono_of_deriv_pos <| by rw [Real.deriv_sinh]; 

Proof state:
x y z : ℝ
⊢ ∀ (x : ℝ), 0 < cosh x

Next tactic:
exact cosh_pos
@[simp]
theorem sinh_pos_iff : 0 < sinh x ↔ 0 < x := by 

Proof state:
x y z : ℝ
⊢ 0 < sinh x ↔ 0 < x

Next tactic:
simpa only [sinh_zero] using @sinh_lt_sinh 0 x
@[simp]
theorem sinh_nonpos_iff : sinh x ≤ 0 ↔ x ≤ 0 := by 

Proof state:
x y z : ℝ
⊢ sinh x ≤ 0 ↔ x ≤ 0

Next tactic:
simpa only [sinh_zero] using @sinh_le_sinh x 0
@[simp]
theorem sinh_neg_iff : sinh x < 0 ↔ x < 0 := by 

Proof state:
x y z : ℝ
⊢ sinh x < 0 ↔ x < 0

Next tactic:
simpa only [sinh_zero] using @sinh_lt_sinh x 0
@[simp]
theorem sinh_nonneg_iff : 0 ≤ sinh x ↔ 0 ≤ x := by 

Proof state:
x y z : ℝ
⊢ 0 ≤ sinh x ↔ 0 ≤ x

Next tactic:
simpa only [sinh_zero] using @sinh_le_sinh 0 x
theorem abs_sinh (x : ℝ) : |sinh x| = sinh |x| := by
  

Proof state:
x✝ y z x : ℝ
⊢ |sinh x| = sinh |x|

Next tactic:
cases le_total x 0
theorem abs_sinh (x : ℝ) : |sinh x| = sinh |x| := by
  cases le_total x 0 <;> 

Proof state:
case inl
x✝ y z x : ℝ
h✝ : x ≤ 0
⊢ |sinh x| = sinh |x|

Next tactic:
simp [abs_of_nonneg, abs_of_nonpos, *]
theorem abs_sinh (x : ℝ) : |sinh x| = sinh |x| := by
  cases le_total x 0 <;> 

Proof state:
case inr
x✝ y z x : ℝ
h✝ : 0 ≤ x
⊢ |sinh x| = sinh |x|

Next tactic:
simp [abs_of_nonneg, abs_of_nonpos, *]
theorem cosh_strictMonoOn : StrictMonoOn cosh (Ici 0) :=
  (convex_Ici _).strictMonoOn_of_deriv_pos continuous_cosh.continuousOn fun x hx => by
    

Proof state:
x✝ y z x : ℝ
hx : x ∈ interior (Ici 0)
⊢ 0 < deriv cosh x

Next tactic:
rw [interior_Ici, mem_Ioi] at hx
theorem cosh_strictMonoOn : StrictMonoOn cosh (Ici 0) :=
  (convex_Ici _).strictMonoOn_of_deriv_pos continuous_cosh.continuousOn fun x hx => by
    rw [interior_Ici, mem_Ioi] at hx; 

Proof state:
x✝ y z x : ℝ
hx : 0 < x
⊢ 0 < deriv cosh x

Next tactic:
rwa [deriv_cosh, sinh_pos_iff]
@[simp]
theorem one_le_cosh (x : ℝ) : 1 ≤ cosh x :=
  cosh_zero ▸ cosh_le_cosh.2 (by 

Proof state:
x✝ y z x : ℝ
⊢ |0| ≤ |x|

Next tactic:
simp only [_root_.abs_zero, _root_.abs_nonneg]
@[simp]
theorem one_lt_cosh : 1 < cosh x ↔ x ≠ 0 :=
  cosh_zero ▸ cosh_lt_cosh.trans (by 

Proof state:
x y z : ℝ
⊢ |0| < |x| ↔ x ≠ 0

Next tactic:
simp only [_root_.abs_zero, abs_pos]
theorem sinh_sub_id_strictMono : StrictMono fun x => sinh x - x := by
  -- Porting note: `by simp; abel` was just `by simp` in mathlib3.
  

Proof state:
x y z : ℝ
⊢ StrictMono fun x => sinh x - x

Next tactic:
refine' strictMono_of_odd_strictMonoOn_nonneg (fun x => by simp; abel) _
theorem sinh_sub_id_strictMono : StrictMono fun x => sinh x - x := by
  -- Porting note: `by simp; abel` was just `by simp` in mathlib3.
  refine' strictMono_of_odd_strictMonoOn_nonneg (fun x => by 

Proof state:
x✝ y z x : ℝ
⊢ sinh (-x) - -x = -(sinh x - x)

Next tactic:
simp
theorem sinh_sub_id_strictMono : StrictMono fun x => sinh x - x := by
  -- Porting note: `by simp; abel` was just `by simp` in mathlib3.
  refine' strictMono_of_odd_strictMonoOn_nonneg (fun x => by simp; 

Proof state:
x✝ y z x : ℝ
⊢ -sinh x + x = x - sinh x

Next tactic:
abel
theorem sinh_sub_id_strictMono : StrictMono fun x => sinh x - x := by
  -- Porting note: `by simp; abel` was just `by simp` in mathlib3.
  refine' strictMono_of_odd_strictMonoOn_nonneg (fun x => by simp; abel) _
  

Proof state:
x y z : ℝ
⊢ StrictMonoOn (fun x => sinh x - x) (Ici 0)

Next tactic:
refine' (convex_Ici _).strictMonoOn_of_deriv_pos _ fun x hx => _
theorem sinh_sub_id_strictMono : StrictMono fun x => sinh x - x := by
  -- Porting note: `by simp; abel` was just `by simp` in mathlib3.
  refine' strictMono_of_odd_strictMonoOn_nonneg (fun x => by simp; abel) _
  refine' (convex_Ici _).strictMonoOn_of_deriv_pos _ fun x hx => _
  · 

Proof state:
case refine'_1
x y z : ℝ
⊢ ContinuousOn (fun x => sinh x - x) (Ici 0)

Next tactic:
exact (continuous_sinh.sub continuous_id).continuousOn
theorem sinh_sub_id_strictMono : StrictMono fun x => sinh x - x := by
  -- Porting note: `by simp; abel` was just `by simp` in mathlib3.
  refine' strictMono_of_odd_strictMonoOn_nonneg (fun x => by simp; abel) _
  refine' (convex_Ici _).strictMonoOn_of_deriv_pos _ fun x hx => _
  · exact (continuous_sinh.sub continuous_id).continuousOn
  · 

Proof state:
case refine'_2
x✝ y z x : ℝ
hx : x ∈ interior (Ici 0)
⊢ 0 < deriv (fun x => sinh x - x) x

Next tactic:
rw [interior_Ici, mem_Ioi] at hx