l3lab/ntp-mathlib huggingface dataset:
/-- Local homeomorphism between a real (semi)normed space and the unit ball.
See also `Homeomorph.unitBall`. -/
@[simps (config := .lemmasOnly)]
def PartialHomeomorph.univUnitBall : PartialHomeomorph E E where
  toFun x := (1 + ‖x‖ ^ 2).sqrt⁻¹ • x
  invFun y := (1 - ‖(y : E)‖ ^ 2).sqrt⁻¹ • (y : E)
  source := univ
  target := ball 0 1
  map_source' x _ := by
    have : 0 < 1 + ‖x‖ ^ 2 := by positivity
    rw [mem_ball_zero_iff, norm_smul, Real.norm_eq_abs, abs_inv, ← _root_.div_eq_inv_mul,
      div_lt_one (abs_pos.mpr <| Real.sqrt_ne_zero'.mpr this), ← abs_norm x, ← sq_lt_sq,
      abs_norm, Real.sq_sqrt this.le]
    exact lt_one_add _
  map_target' _ _ := trivial
  left_inv' x _ := by
    field_simp [norm_smul, smul_smul, (zero_lt_one_add_norm_sq x).ne', sq_abs,
      Real.sq_sqrt (zero_lt_one_add_norm_sq x).le, ← Real.sqrt_div (zero_lt_one_add_norm_sq x).le]
  right_inv' y hy := by
    have : 0 < 1 - ‖y‖ ^ 2 := by nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
    field_simp [norm_smul, smul_smul, this.ne', sq_abs, Real.sq_sqrt this.le,
      ← Real.sqrt_div this.le]
  open_source := isOpen_univ
  open_target := isOpen_ball
  continuousOn_toFun := by
    suffices Continuous fun (x:E) => (1 + ‖x‖ ^ 2).sqrt⁻¹
     from (this.smul continuous_id).continuousOn
    refine' Continuous.inv₀ _ fun x => Real.sqrt_ne_zero'.mpr (by positivity)
    continuity
  continuousOn_invFun := by
    have : ∀ y ∈ ball (0 : E) 1, (1 - ‖(y : E)‖ ^ 2).sqrt ≠ 0 := fun y hy ↦ by
      rw [Real.sqrt_ne_zero']
      nlinarith [norm_nonneg y, mem_ball_zero_iff.1 hy]
    

Proof state:
E : Type u_1
inst✝¹ : SeminormedAddCommGroup E
inst✝ : NormedSpace ℝ E
this : ∀ y ∈ ball 0 1, Real.sqrt (1 - ‖y‖ ^ 2) ≠ 0
⊢ ContinuousOn
    { toFun := fun x => (Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x, invFun := fun y => (Real.sqrt (1 - ‖y‖ ^ 2))⁻¹ • y,
        source := univ, target := ball 0 1,
        map_source' := (_ : ∀ x ∈ univ, (fun x => (Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x) x ∈ ball 0 1),
        map_target' := (_ : ∀ x ∈ ball 0 1, True),
        left_inv' :=
          (_ :
            ∀ x ∈ univ,
              (Real.sqrt (1 - ‖(Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x‖ ^ 2))⁻¹ • (Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x = x),
        right_inv' :=
          (_ :
            ∀ y ∈ ball 0 1,
              (Real.sqrt (1 + ‖(Real.sqrt (1 - ‖y‖ ^ 2))⁻¹ • y‖ ^ 2))⁻¹ • (Real.sqrt (1 - ‖y‖ ^ 2))⁻¹ • y = y) }.invFun
    { toFun := fun x => (Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x, invFun := fun y => (Real.sqrt (1 - ‖y‖ ^ 2))⁻¹ • y,
        source := univ, target := ball 0 1,
        map_source' := (_ : ∀ x ∈ univ, (fun x => (Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x) x ∈ ball 0 1),
        map_target' := (_ : ∀ x ∈ ball 0 1, True),
        left_inv' :=
          (_ :
            ∀ x ∈ univ,
              (Real.sqrt (1 - ‖(Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x‖ ^ 2))⁻¹ • (Real.sqrt (1 + ‖x‖ ^ 2))⁻¹ • x = x),
        right_inv' :=
          (_ :
            ∀ y ∈ ball 0 1,
              (Real.sqrt (1 + ‖(Real.sqrt (1 - ‖y‖ ^ 2))⁻¹ • y‖ ^ 2))⁻¹ • (Real.sqrt (1 - ‖y‖ ^ 2))⁻¹ • y = y) }.target

Next tactic:
exact ContinuousOn.smul (ContinuousOn.inv₀
      (continuousOn_const.sub (continuous_norm.continuousOn.pow _)).sqrt this) continuousOn_id
@[simp]
theorem PartialHomeomorph.univUnitBall_apply_zero : univUnitBall (0 : E) = 0 := by
  

Proof state:
E : Type u_1
inst✝¹ : SeminormedAddCommGroup E
inst✝ : NormedSpace ℝ E
⊢ ↑univUnitBall 0 = 0

Next tactic:
simp [PartialHomeomorph.univUnitBall_apply]
@[simp]
theorem PartialHomeomorph.univUnitBall_symm_apply_zero : univUnitBall.symm (0 : E) = 0 := by
  

Proof state:
E : Type u_1
inst✝¹ : SeminormedAddCommGroup E
inst✝ : NormedSpace ℝ E
⊢ ↑(PartialHomeomorph.symm univUnitBall) 0 = 0

Next tactic:
simp [PartialHomeomorph.univUnitBall_symm_apply]
/-- Affine homeomorphism `(r • · +ᵥ c)` between a normed space and an add torsor over this space,
interpreted as a `PartialHomeomorph` between `Metric.ball 0 1` and `Metric.ball c r`. -/
@[simps!]
def unitBallBall (c : P) (r : ℝ) (hr : 0 < r) : PartialHomeomorph E P :=
  ((Homeomorph.smulOfNeZero r hr.ne').trans
      (IsometryEquiv.vaddConst c).toHomeomorph).toPartialHomeomorphOfImageEq
      (ball 0 1) isOpen_ball (ball c r) <| by
    

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : 0 < r
⊢ ⇑(Homeomorph.trans (Homeomorph.smulOfNeZero r (_ : r ≠ 0))
          (IsometryEquiv.toHomeomorph (IsometryEquiv.vaddConst c))) ''
      ball 0 1 =
    ball c r

Next tactic:
change (IsometryEquiv.vaddConst c) ∘ (r • ·) '' ball (0 : E) 1 = ball c r
/-- Affine homeomorphism `(r • · +ᵥ c)` between a normed space and an add torsor over this space,
interpreted as a `PartialHomeomorph` between `Metric.ball 0 1` and `Metric.ball c r`. -/
@[simps!]
def unitBallBall (c : P) (r : ℝ) (hr : 0 < r) : PartialHomeomorph E P :=
  ((Homeomorph.smulOfNeZero r hr.ne').trans
      (IsometryEquiv.vaddConst c).toHomeomorph).toPartialHomeomorphOfImageEq
      (ball 0 1) isOpen_ball (ball c r) <| by
    change (IsometryEquiv.vaddConst c) ∘ (r • ·) '' ball (0 : E) 1 = ball c r
    

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : 0 < r
⊢ (⇑(IsometryEquiv.vaddConst c) ∘ fun x => r • x) '' ball 0 1 = ball c r

Next tactic:
rw [image_comp, image_smul, smul_unitBall hr.ne', IsometryEquiv.image_ball]
/-- Affine homeomorphism `(r • · +ᵥ c)` between a normed space and an add torsor over this space,
interpreted as a `PartialHomeomorph` between `Metric.ball 0 1` and `Metric.ball c r`. -/
@[simps!]
def unitBallBall (c : P) (r : ℝ) (hr : 0 < r) : PartialHomeomorph E P :=
  ((Homeomorph.smulOfNeZero r hr.ne').trans
      (IsometryEquiv.vaddConst c).toHomeomorph).toPartialHomeomorphOfImageEq
      (ball 0 1) isOpen_ball (ball c r) <| by
    change (IsometryEquiv.vaddConst c) ∘ (r • ·) '' ball (0 : E) 1 = ball c r
    rw [image_comp, image_smul, smul_unitBall hr.ne', IsometryEquiv.image_ball]
    

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : 0 < r
⊢ ball ((IsometryEquiv.vaddConst c) 0) ‖r‖ = ball c r

Next tactic:
simp [abs_of_pos hr]
@[simp]
theorem univBall_source (c : P) (r : ℝ) : (univBall c r).source = univ := by
  

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ (univBall c r).toPartialEquiv.source = univ

Next tactic:
unfold univBall
@[simp]
theorem univBall_source (c : P) (r : ℝ) : (univBall c r).source = univ := by
  unfold univBall; 

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ (if h : 0 < r then
          PartialHomeomorph.trans' univUnitBall (unitBallBall c r h)
            (_ : univUnitBall.toPartialEquiv.target = univUnitBall.toPartialEquiv.target)
        else
          Homeomorph.toPartialHomeomorph
            (IsometryEquiv.toHomeomorph (IsometryEquiv.vaddConst c))).toPartialEquiv.source =
    univ

Next tactic:
split_ifs
@[simp]
theorem univBall_source (c : P) (r : ℝ) : (univBall c r).source = univ := by
  unfold univBall; split_ifs <;> 

Proof state:
case pos
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
h✝ : 0 < r
⊢ (PartialHomeomorph.trans' univUnitBall (unitBallBall c r h✝)
          (_ : univUnitBall.toPartialEquiv.target = univUnitBall.toPartialEquiv.target)).toPartialEquiv.source =
    univ

Next tactic:
rfl
@[simp]
theorem univBall_source (c : P) (r : ℝ) : (univBall c r).source = univ := by
  unfold univBall; split_ifs <;> 

Proof state:
case neg
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
h✝ : ¬0 < r
⊢ (Homeomorph.toPartialHomeomorph (IsometryEquiv.toHomeomorph (IsometryEquiv.vaddConst c))).toPartialEquiv.source = univ

Next tactic:
rfl
theorem univBall_target (c : P) {r : ℝ} (hr : 0 < r) : (univBall c r).target = ball c r := by
  

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : 0 < r
⊢ (univBall c r).toPartialEquiv.target = ball c r

Next tactic:
rw [univBall, dif_pos hr]
theorem univBall_target (c : P) {r : ℝ} (hr : 0 < r) : (univBall c r).target = ball c r := by
  rw [univBall, dif_pos hr]; 

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : 0 < r
⊢ (PartialHomeomorph.trans' univUnitBall (unitBallBall c r hr)
          (_ : univUnitBall.toPartialEquiv.target = univUnitBall.toPartialEquiv.target)).toPartialEquiv.target =
    ball c r

Next tactic:
rfl
theorem ball_subset_univBall_target (c : P) (r : ℝ) : ball c r ⊆ (univBall c r).target := by
  

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ ball c r ⊆ (univBall c r).toPartialEquiv.target

Next tactic:
by_cases hr : 0 < r
theorem ball_subset_univBall_target (c : P) (r : ℝ) : ball c r ⊆ (univBall c r).target := by
  by_cases hr : 0 < r
  · 

Proof state:
case pos
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : 0 < r
⊢ ball c r ⊆ (univBall c r).toPartialEquiv.target

Next tactic:
rw [univBall_target c hr]
theorem ball_subset_univBall_target (c : P) (r : ℝ) : ball c r ⊆ (univBall c r).target := by
  by_cases hr : 0 < r
  · rw [univBall_target c hr]
  · 

Proof state:
case neg
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : ¬0 < r
⊢ ball c r ⊆ (univBall c r).toPartialEquiv.target

Next tactic:
rw [univBall, dif_neg hr]
theorem ball_subset_univBall_target (c : P) (r : ℝ) : ball c r ⊆ (univBall c r).target := by
  by_cases hr : 0 < r
  · rw [univBall_target c hr]
  · rw [univBall, dif_neg hr]
    

Proof state:
case neg
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
hr : ¬0 < r
⊢ ball c r ⊆
    (Homeomorph.toPartialHomeomorph (IsometryEquiv.toHomeomorph (IsometryEquiv.vaddConst c))).toPartialEquiv.target

Next tactic:
exact subset_univ _
@[simp]
theorem univBall_apply_zero (c : P) (r : ℝ) : univBall c r 0 = c := by
  

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ ↑(univBall c r) 0 = c

Next tactic:
unfold univBall
@[simp]
theorem univBall_apply_zero (c : P) (r : ℝ) : univBall c r 0 = c := by
  unfold univBall; 

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ ↑(if h : 0 < r then
          PartialHomeomorph.trans' univUnitBall (unitBallBall c r h)
            (_ : univUnitBall.toPartialEquiv.target = univUnitBall.toPartialEquiv.target)
        else Homeomorph.toPartialHomeomorph (IsometryEquiv.toHomeomorph (IsometryEquiv.vaddConst c)))
      0 =
    c

Next tactic:
split_ifs
@[simp]
theorem univBall_apply_zero (c : P) (r : ℝ) : univBall c r 0 = c := by
  unfold univBall; split_ifs <;> 

Proof state:
case pos
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
h✝ : 0 < r
⊢ ↑(PartialHomeomorph.trans' univUnitBall (unitBallBall c r h✝)
          (_ : univUnitBall.toPartialEquiv.target = univUnitBall.toPartialEquiv.target))
      0 =
    c

Next tactic:
simp
@[simp]
theorem univBall_apply_zero (c : P) (r : ℝ) : univBall c r 0 = c := by
  unfold univBall; split_ifs <;> 

Proof state:
case neg
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
h✝ : ¬0 < r
⊢ ↑(Homeomorph.toPartialHomeomorph (IsometryEquiv.toHomeomorph (IsometryEquiv.vaddConst c))) 0 = c

Next tactic:
simp
@[simp]
theorem univBall_symm_apply_center (c : P) (r : ℝ) : (univBall c r).symm c = 0 := by
  

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ ↑(PartialHomeomorph.symm (univBall c r)) c = 0

Next tactic:
have : 0 ∈ (univBall c r).source := by simp
@[simp]
theorem univBall_symm_apply_center (c : P) (r : ℝ) : (univBall c r).symm c = 0 := by
  have : 0 ∈ (univBall c r).source := by 

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ 0 ∈ (univBall c r).toPartialEquiv.source

Next tactic:
simp
@[simp]
theorem univBall_symm_apply_center (c : P) (r : ℝ) : (univBall c r).symm c = 0 := by
  have : 0 ∈ (univBall c r).source := by simp
  

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
this : 0 ∈ (univBall c r).toPartialEquiv.source
⊢ ↑(PartialHomeomorph.symm (univBall c r)) c = 0

Next tactic:
simpa only [univBall_apply_zero] using (univBall c r).left_inv this
@[continuity]
theorem continuous_univBall (c : P) (r : ℝ) : Continuous (univBall c r) := by
  

Proof state:
E : Type u_1
inst✝³ : SeminormedAddCommGroup E
inst✝² : NormedSpace ℝ E
P : Type u_2
inst✝¹ : PseudoMetricSpace P
inst✝ : NormedAddTorsor E P
c : P
r : ℝ
⊢ Continuous ↑(univBall c r)

Next tactic:
simpa [continuous_iff_continuousOn_univ] using (univBall c r).continuousOn
@[to_additive]
protected theorem div_mul_div_comm (hbd : Commute b d) (hbc : Commute b⁻¹ c) :
    a / b * (c / d) = a * c / (b * d) := by
  

Proof state:
G : Type u_1
inst✝ : DivisionMonoid G
a b c d : G
hbd : Commute b d
hbc : Commute b⁻¹ c
⊢ a / b * (c / d) = a * c / (b * d)

Next tactic:
simp_rw [div_eq_mul_inv, mul_inv_rev, hbd.inv_inv.symm.eq, hbc.mul_mul_mul_comm]
@[to_additive]
protected theorem div_div_div_comm (hbc : Commute b c) (hbd : Commute b⁻¹ d) (hcd : Commute c⁻¹ d) :
    a / b / (c / d) = a / c / (b / d) := by
  

Proof state:
G : Type u_1
inst✝ : DivisionMonoid G
a b c d : G
hbc : Commute b c
hbd : Commute b⁻¹ d
hcd : Commute c⁻¹ d
⊢ a / b / (c / d) = a / c / (b / d)

Next tactic:
simp_rw [div_eq_mul_inv, mul_inv_rev, inv_inv, hbd.symm.eq, hcd.symm.eq,
    hbc.inv_inv.mul_mul_mul_comm]
theorem exp_arsinh (x : ℝ) : exp (arsinh x) = x + sqrt (1 + x ^ 2) := by
  

Proof state:
x✝ y x : ℝ
⊢ rexp (arsinh x) = x + sqrt (1 + x ^ 2)

Next tactic:
apply exp_log
theorem exp_arsinh (x : ℝ) : exp (arsinh x) = x + sqrt (1 + x ^ 2) := by
  apply exp_log
  

Proof state:
case hx
x✝ y x : ℝ
⊢ 0 < x + sqrt (1 + x ^ 2)

Next tactic:
rw [← neg_lt_iff_pos_add']
theorem exp_arsinh (x : ℝ) : exp (arsinh x) = x + sqrt (1 + x ^ 2) := by
  apply exp_log
  rw [← neg_lt_iff_pos_add']
  

Proof state:
case hx
x✝ y x : ℝ
⊢ -x < sqrt (1 + x ^ 2)

Next tactic:
apply lt_sqrt_of_sq_lt
theorem exp_arsinh (x : ℝ) : exp (arsinh x) = x + sqrt (1 + x ^ 2) := by
  apply exp_log
  rw [← neg_lt_iff_pos_add']
  apply lt_sqrt_of_sq_lt
  

Proof state:
case hx.h
x✝ y x : ℝ
⊢ (-x) ^ 2 < 1 + x ^ 2

Next tactic:
simp
@[simp]
theorem arsinh_zero : arsinh 0 = 0 := by 

Proof state:
x y : ℝ
⊢ arsinh 0 = 0

Next tactic:
simp [arsinh]
@[simp]
theorem arsinh_neg (x : ℝ) : arsinh (-x) = -arsinh x := by
  

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

Next tactic:
rw [← exp_eq_exp, exp_arsinh, exp_neg, exp_arsinh]
@[simp]
theorem arsinh_neg (x : ℝ) : arsinh (-x) = -arsinh x := by
  rw [← exp_eq_exp, exp_arsinh, exp_neg, exp_arsinh]
  

Proof state:
x✝ y x : ℝ
⊢ -x + sqrt (1 + (-x) ^ 2) = (x + sqrt (1 + x ^ 2))⁻¹

Next tactic:
apply eq_inv_of_mul_eq_one_left
@[simp]
theorem arsinh_neg (x : ℝ) : arsinh (-x) = -arsinh x := by
  rw [← exp_eq_exp, exp_arsinh, exp_neg, exp_arsinh]
  apply eq_inv_of_mul_eq_one_left
  

Proof state:
case h
x✝ y x : ℝ
⊢ (-x + sqrt (1 + (-x) ^ 2)) * (x + sqrt (1 + x ^ 2)) = 1

Next tactic:
rw [neg_sq, neg_add_eq_sub, add_comm x, mul_comm, ← sq_sub_sq, sq_sqrt, add_sub_cancel]
@[simp]
theorem arsinh_neg (x : ℝ) : arsinh (-x) = -arsinh x := by
  rw [← exp_eq_exp, exp_arsinh, exp_neg, exp_arsinh]
  apply eq_inv_of_mul_eq_one_left
  rw [neg_sq, neg_add_eq_sub, add_comm x, mul_comm, ← sq_sub_sq, sq_sqrt, add_sub_cancel]
  

Proof state:
case h
x✝ y x : ℝ
⊢ 0 ≤ 1 + x ^ 2

Next tactic:
exact add_nonneg zero_le_one (sq_nonneg _)
/-- `arsinh` is the right inverse of `sinh`. -/
@[simp]
theorem sinh_arsinh (x : ℝ) : sinh (arsinh x) = x := by
  

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

Next tactic:
rw [sinh_eq, ← arsinh_neg, exp_arsinh, exp_arsinh, neg_sq]
/-- `arsinh` is the right inverse of `sinh`. -/
@[simp]
theorem sinh_arsinh (x : ℝ) : sinh (arsinh x) = x := by
  rw [sinh_eq, ← arsinh_neg, exp_arsinh, exp_arsinh, neg_sq]; 

Proof state:
x✝ y x : ℝ
⊢ (x + sqrt (1 + x ^ 2) - (-x + sqrt (1 + x ^ 2))) / 2 = x

Next tactic:
field_simp
@[simp]
theorem cosh_arsinh (x : ℝ) : cosh (arsinh x) = sqrt (1 + x ^ 2) := by
  

Proof state:
x✝ y x : ℝ
⊢ cosh (arsinh x) = sqrt (1 + x ^ 2)

Next tactic:
rw [← sqrt_sq (cosh_pos _).le, cosh_sq', sinh_arsinh]
@[simp]
theorem arsinh_nonneg_iff : 0 ≤ arsinh x ↔ 0 ≤ x := by 

Proof state:
x y : ℝ
⊢ 0 ≤ arsinh x ↔ 0 ≤ x

Next tactic:
rw [← sinh_le_sinh, sinh_zero, sinh_arsinh]
@[simp]
theorem arsinh_nonpos_iff : arsinh x ≤ 0 ↔ x ≤ 0 := by 

Proof state:
x y : ℝ
⊢ arsinh x ≤ 0 ↔ x ≤ 0

Next tactic:
rw [← sinh_le_sinh, sinh_zero, sinh_arsinh]
theorem hasStrictDerivAt_arsinh (x : ℝ) : HasStrictDerivAt arsinh (sqrt (1 + x ^ 2))⁻¹ x := by
  

Proof state:
x✝ y x : ℝ
⊢ HasStrictDerivAt arsinh (sqrt (1 + x ^ 2))⁻¹ x

Next tactic:
convert sinhHomeomorph.toPartialHomeomorph.hasStrictDerivAt_symm (mem_univ x) (cosh_pos _).ne'
    (hasStrictDerivAt_sinh _) using 2
theorem hasStrictDerivAt_arsinh (x : ℝ) : HasStrictDerivAt arsinh (sqrt (1 + x ^ 2))⁻¹ x := by
  convert sinhHomeomorph.toPartialHomeomorph.hasStrictDerivAt_symm (mem_univ x) (cosh_pos _).ne'
    (hasStrictDerivAt_sinh _) using 2
  

Proof state:
case h.e'_7.h.e'_3
x✝ y x : ℝ
⊢ sqrt (1 + x ^ 2) = cosh (↑(PartialHomeomorph.symm (Homeomorph.toPartialHomeomorph sinhHomeomorph)) x)

Next tactic:
exact (cosh_arsinh _).symm
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
⊢ IsJacobson R ↔ ∀ (P : Ideal R), IsPrime P → jacobson P = P

Next tactic:
refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
⊢ (∀ (P : Ideal R), IsPrime P → jacobson P = P) → ∀ (I : Ideal R), IsRadical I → jacobson I = I

Next tactic:
refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
  refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ : Ideal R
h : ∀ (P : Ideal R), IsPrime P → jacobson P = P
I : Ideal R
hI : IsRadical I
x : R
hx : x ∈ jacobson I
⊢ x ∈ I

Next tactic:
rw [← hI.radical, radical_eq_sInf I, mem_sInf]
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
  refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
  rw [← hI.radical, radical_eq_sInf I, mem_sInf]
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ : Ideal R
h : ∀ (P : Ideal R), IsPrime P → jacobson P = P
I : Ideal R
hI : IsRadical I
x : R
hx : x ∈ jacobson I
⊢ ∀ ⦃I_1 : Ideal R⦄, I_1 ∈ {J | I ≤ J ∧ IsPrime J} → x ∈ I_1

Next tactic:
intro P hP
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
  refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
  rw [← hI.radical, radical_eq_sInf I, mem_sInf]
  intro P hP
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ : Ideal R
h : ∀ (P : Ideal R), IsPrime P → jacobson P = P
I : Ideal R
hI : IsRadical I
x : R
hx : x ∈ jacobson I
P : Ideal R
hP : P ∈ {J | I ≤ J ∧ IsPrime J}
⊢ x ∈ P

Next tactic:
rw [Set.mem_setOf_eq] at hP
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
  refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
  rw [← hI.radical, radical_eq_sInf I, mem_sInf]
  intro P hP
  rw [Set.mem_setOf_eq] at hP
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ : Ideal R
h : ∀ (P : Ideal R), IsPrime P → jacobson P = P
I : Ideal R
hI : IsRadical I
x : R
hx : x ∈ jacobson I
P : Ideal R
hP : I ≤ P ∧ IsPrime P
⊢ x ∈ P

Next tactic:
erw [mem_sInf] at hx
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
  refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
  rw [← hI.radical, radical_eq_sInf I, mem_sInf]
  intro P hP
  rw [Set.mem_setOf_eq] at hP
  erw [mem_sInf] at hx
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ : Ideal R
h : ∀ (P : Ideal R), IsPrime P → jacobson P = P
I : Ideal R
hI : IsRadical I
x : R
hx : ∀ ⦃I_1 : Ideal R⦄, I_1 ∈ {J | I ≤ J ∧ IsMaximal J} → x ∈ I_1
P : Ideal R
hP : I ≤ P ∧ IsPrime P
⊢ x ∈ P

Next tactic:
erw [← h P hP.right, mem_sInf]