l3lab/ntp-mathlib huggingface dataset:
theorem le_mk_of_forall_le {f : CauSeq ℚ abs} : (∃ i, ∀ j ≥ i, x ≤ f j) → x ≤ mk f := by
  intro h
  induction' x using Real.ind_mk with x
  apply le_of_not_lt
  rw [mk_lt]
  rintro ⟨K, K0, hK⟩
  obtain ⟨i, H⟩ := exists_forall_ge_and h (exists_forall_ge_and hK (f.cauchy₃ <| half_pos K0))
  apply not_lt_of_le (H _ le_rfl).1
  

Proof state:
case h.h.intro.intro.intro
x✝ y : ℝ
f x : CauSeq ℚ abs
h : ∃ i, ∀ j ≥ i, mk x ≤ ↑(↑f j)
K : ℚ
K0 : K > 0
hK : ∃ i, ∀ j ≥ i, K ≤ ↑(x - f) j
i : ℕ
H : ∀ j ≥ i, mk x ≤ ↑(↑f j) ∧ K ≤ ↑(x - f) j ∧ ∀ k ≥ j, |↑f k - ↑f j| < K / 2
⊢ ↑(↑f i) < mk x

Next tactic:
erw [mk_lt]
theorem le_mk_of_forall_le {f : CauSeq ℚ abs} : (∃ i, ∀ j ≥ i, x ≤ f j) → x ≤ mk f := by
  intro h
  induction' x using Real.ind_mk with x
  apply le_of_not_lt
  rw [mk_lt]
  rintro ⟨K, K0, hK⟩
  obtain ⟨i, H⟩ := exists_forall_ge_and h (exists_forall_ge_and hK (f.cauchy₃ <| half_pos K0))
  apply not_lt_of_le (H _ le_rfl).1
  erw [mk_lt]
  

Proof state:
case h.h.intro.intro.intro
x✝ y : ℝ
f x : CauSeq ℚ abs
h : ∃ i, ∀ j ≥ i, mk x ≤ ↑(↑f j)
K : ℚ
K0 : K > 0
hK : ∃ i, ∀ j ≥ i, K ≤ ↑(x - f) j
i : ℕ
H : ∀ j ≥ i, mk x ≤ ↑(↑f j) ∧ K ≤ ↑(x - f) j ∧ ∀ k ≥ j, |↑f k - ↑f j| < K / 2
⊢ const abs ↑(↑f i) < x

Next tactic:
refine' ⟨_, half_pos K0, i, fun j ij => _⟩
theorem le_mk_of_forall_le {f : CauSeq ℚ abs} : (∃ i, ∀ j ≥ i, x ≤ f j) → x ≤ mk f := by
  intro h
  induction' x using Real.ind_mk with x
  apply le_of_not_lt
  rw [mk_lt]
  rintro ⟨K, K0, hK⟩
  obtain ⟨i, H⟩ := exists_forall_ge_and h (exists_forall_ge_and hK (f.cauchy₃ <| half_pos K0))
  apply not_lt_of_le (H _ le_rfl).1
  erw [mk_lt]
  refine' ⟨_, half_pos K0, i, fun j ij => _⟩
  

Proof state:
case h.h.intro.intro.intro
x✝ y : ℝ
f x : CauSeq ℚ abs
h : ∃ i, ∀ j ≥ i, mk x ≤ ↑(↑f j)
K : ℚ
K0 : K > 0
hK : ∃ i, ∀ j ≥ i, K ≤ ↑(x - f) j
i : ℕ
H : ∀ j ≥ i, mk x ≤ ↑(↑f j) ∧ K ≤ ↑(x - f) j ∧ ∀ k ≥ j, |↑f k - ↑f j| < K / 2
j : ℕ
ij : j ≥ i
⊢ K / 2 ≤ ↑(x - const abs ↑(↑f i)) j

Next tactic:
have := add_le_add (H _ ij).2.1 (le_of_lt (abs_lt.1 <| (H _ le_rfl).2.2 _ ij).1)
theorem le_mk_of_forall_le {f : CauSeq ℚ abs} : (∃ i, ∀ j ≥ i, x ≤ f j) → x ≤ mk f := by
  intro h
  induction' x using Real.ind_mk with x
  apply le_of_not_lt
  rw [mk_lt]
  rintro ⟨K, K0, hK⟩
  obtain ⟨i, H⟩ := exists_forall_ge_and h (exists_forall_ge_and hK (f.cauchy₃ <| half_pos K0))
  apply not_lt_of_le (H _ le_rfl).1
  erw [mk_lt]
  refine' ⟨_, half_pos K0, i, fun j ij => _⟩
  have := add_le_add (H _ ij).2.1 (le_of_lt (abs_lt.1 <| (H _ le_rfl).2.2 _ ij).1)
  

Proof state:
case h.h.intro.intro.intro
x✝ y : ℝ
f x : CauSeq ℚ abs
h : ∃ i, ∀ j ≥ i, mk x ≤ ↑(↑f j)
K : ℚ
K0 : K > 0
hK : ∃ i, ∀ j ≥ i, K ≤ ↑(x - f) j
i : ℕ
H : ∀ j ≥ i, mk x ≤ ↑(↑f j) ∧ K ≤ ↑(x - f) j ∧ ∀ k ≥ j, |↑f k - ↑f j| < K / 2
j : ℕ
ij : j ≥ i
this : K + -(K / 2) ≤ ↑(x - f) j + (↑f j - ↑f i)
⊢ K / 2 ≤ ↑(x - const abs ↑(↑f i)) j

Next tactic:
rwa [← sub_eq_add_neg, sub_self_div_two, sub_apply, sub_add_sub_cancel] at this
theorem mk_le_of_forall_le {f : CauSeq ℚ abs} {x : ℝ} (h : ∃ i, ∀ j ≥ i, (f j : ℝ) ≤ x) :
    mk f ≤ x := by
  

Proof state:
x✝ y : ℝ
f : CauSeq ℚ abs
x : ℝ
h : ∃ i, ∀ j ≥ i, ↑(↑f j) ≤ x
⊢ mk f ≤ x

Next tactic:
cases' h with i H
theorem mk_le_of_forall_le {f : CauSeq ℚ abs} {x : ℝ} (h : ∃ i, ∀ j ≥ i, (f j : ℝ) ≤ x) :
    mk f ≤ x := by
  cases' h with i H
  

Proof state:
case intro
x✝ y : ℝ
f : CauSeq ℚ abs
x : ℝ
i : ℕ
H : ∀ j ≥ i, ↑(↑f j) ≤ x
⊢ mk f ≤ x

Next tactic:
rw [← neg_le_neg_iff, ← mk_neg]
theorem mk_le_of_forall_le {f : CauSeq ℚ abs} {x : ℝ} (h : ∃ i, ∀ j ≥ i, (f j : ℝ) ≤ x) :
    mk f ≤ x := by
  cases' h with i H
  rw [← neg_le_neg_iff, ← mk_neg]
  

Proof state:
case intro
x✝ y : ℝ
f : CauSeq ℚ abs
x : ℝ
i : ℕ
H : ∀ j ≥ i, ↑(↑f j) ≤ x
⊢ -x ≤ mk (-f)

Next tactic:
exact le_mk_of_forall_le ⟨i, fun j ij => by simp [H _ ij]⟩
theorem mk_le_of_forall_le {f : CauSeq ℚ abs} {x : ℝ} (h : ∃ i, ∀ j ≥ i, (f j : ℝ) ≤ x) :
    mk f ≤ x := by
  cases' h with i H
  rw [← neg_le_neg_iff, ← mk_neg]
  exact le_mk_of_forall_le ⟨i, fun j ij => by 

Proof state:
x✝ y : ℝ
f : CauSeq ℚ abs
x : ℝ
i : ℕ
H : ∀ j ≥ i, ↑(↑f j) ≤ x
j : ℕ
ij : j ≥ i
⊢ -x ≤ ↑(↑(-f) j)

Next tactic:
simp [H _ ij]
@[simp]
lemma equivShrink_symm_add [Add α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x + y) = (equivShrink α).symm x + (equivShrink α).symm y := by
  

Proof state:
α : Type u_1
inst✝¹ : Add α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm (x + y) = (equivShrink α).symm x + (equivShrink α).symm y

Next tactic:
rw [Equiv.add_def]
@[simp]
lemma equivShrink_symm_add [Add α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x + y) = (equivShrink α).symm x + (equivShrink α).symm y := by
  rw [Equiv.add_def]
  

Proof state:
α : Type u_1
inst✝¹ : Add α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm ((equivShrink α).symm.symm ((equivShrink α).symm x + (equivShrink α).symm y)) =
    (equivShrink α).symm x + (equivShrink α).symm y

Next tactic:
simp
@[simp]
lemma equivShrink_add [Add α] [Small α] (x y : α) :
    equivShrink α (x + y) = equivShrink α x + equivShrink α y := by
  

Proof state:
α : Type u_1
inst✝¹ : Add α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x + y) = (equivShrink α) x + (equivShrink α) y

Next tactic:
rw [Equiv.add_def]
@[simp]
lemma equivShrink_add [Add α] [Small α] (x y : α) :
    equivShrink α (x + y) = equivShrink α x + equivShrink α y := by
  rw [Equiv.add_def]
  

Proof state:
α : Type u_1
inst✝¹ : Add α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x + y) =
    (equivShrink α).symm.symm ((equivShrink α).symm ((equivShrink α) x) + (equivShrink α).symm ((equivShrink α) y))

Next tactic:
simp
@[to_additive existing (attr := simp)]
lemma equivShrink_symm_mul [Mul α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x * y) = (equivShrink α).symm x * (equivShrink α).symm y := by
  

Proof state:
α : Type u_1
inst✝¹ : Mul α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm (x * y) = (equivShrink α).symm x * (equivShrink α).symm y

Next tactic:
rw [Equiv.mul_def]
@[to_additive existing (attr := simp)]
lemma equivShrink_symm_mul [Mul α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x * y) = (equivShrink α).symm x * (equivShrink α).symm y := by
  rw [Equiv.mul_def]
  

Proof state:
α : Type u_1
inst✝¹ : Mul α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm ((equivShrink α).symm.symm ((equivShrink α).symm x * (equivShrink α).symm y)) =
    (equivShrink α).symm x * (equivShrink α).symm y

Next tactic:
simp
@[to_additive existing (attr := simp)]
lemma equivShrink_mul [Mul α] [Small α] (x y : α) :
    equivShrink α (x * y) = equivShrink α x * equivShrink α y := by
  

Proof state:
α : Type u_1
inst✝¹ : Mul α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x * y) = (equivShrink α) x * (equivShrink α) y

Next tactic:
rw [Equiv.mul_def]
@[to_additive existing (attr := simp)]
lemma equivShrink_mul [Mul α] [Small α] (x y : α) :
    equivShrink α (x * y) = equivShrink α x * equivShrink α y := by
  rw [Equiv.mul_def]
  

Proof state:
α : Type u_1
inst✝¹ : Mul α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x * y) =
    (equivShrink α).symm.symm ((equivShrink α).symm ((equivShrink α) x) * (equivShrink α).symm ((equivShrink α) y))

Next tactic:
simp
@[simp]
lemma equivShrink_symm_sub [Sub α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x - y) = (equivShrink α).symm x - (equivShrink α).symm y := by
  

Proof state:
α : Type u_1
inst✝¹ : Sub α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm (x - y) = (equivShrink α).symm x - (equivShrink α).symm y

Next tactic:
rw [Equiv.sub_def]
@[simp]
lemma equivShrink_symm_sub [Sub α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x - y) = (equivShrink α).symm x - (equivShrink α).symm y := by
  rw [Equiv.sub_def]
  

Proof state:
α : Type u_1
inst✝¹ : Sub α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm ((equivShrink α).symm.symm ((equivShrink α).symm x - (equivShrink α).symm y)) =
    (equivShrink α).symm x - (equivShrink α).symm y

Next tactic:
simp
@[simp]
lemma equivShrink_sub [Sub α] [Small α] (x y : α) :
    equivShrink α (x - y) = equivShrink α x - equivShrink α y := by
  

Proof state:
α : Type u_1
inst✝¹ : Sub α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x - y) = (equivShrink α) x - (equivShrink α) y

Next tactic:
rw [Equiv.sub_def]
@[simp]
lemma equivShrink_sub [Sub α] [Small α] (x y : α) :
    equivShrink α (x - y) = equivShrink α x - equivShrink α y := by
  rw [Equiv.sub_def]
  

Proof state:
α : Type u_1
inst✝¹ : Sub α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x - y) =
    (equivShrink α).symm.symm ((equivShrink α).symm ((equivShrink α) x) - (equivShrink α).symm ((equivShrink α) y))

Next tactic:
simp
@[to_additive existing (attr := simp)]
lemma equivShrink_symm_div [Div α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x / y) = (equivShrink α).symm x / (equivShrink α).symm y := by
  

Proof state:
α : Type u_1
inst✝¹ : Div α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm (x / y) = (equivShrink α).symm x / (equivShrink α).symm y

Next tactic:
rw [Equiv.div_def]
@[to_additive existing (attr := simp)]
lemma equivShrink_symm_div [Div α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x / y) = (equivShrink α).symm x / (equivShrink α).symm y := by
  rw [Equiv.div_def]
  

Proof state:
α : Type u_1
inst✝¹ : Div α
inst✝ : Small.{u_2, u_1} α
x y : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm ((equivShrink α).symm.symm ((equivShrink α).symm x / (equivShrink α).symm y)) =
    (equivShrink α).symm x / (equivShrink α).symm y

Next tactic:
simp
@[to_additive existing (attr := simp)]
lemma equivShrink_div [Div α] [Small α] (x y : α) :
    equivShrink α (x / y) = equivShrink α x / equivShrink α y := by
  

Proof state:
α : Type u_1
inst✝¹ : Div α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x / y) = (equivShrink α) x / (equivShrink α) y

Next tactic:
rw [Equiv.div_def]
@[to_additive existing (attr := simp)]
lemma equivShrink_div [Div α] [Small α] (x y : α) :
    equivShrink α (x / y) = equivShrink α x / equivShrink α y := by
  rw [Equiv.div_def]
  

Proof state:
α : Type u_1
inst✝¹ : Div α
inst✝ : Small.{u_2, u_1} α
x y : α
⊢ (equivShrink α) (x / y) =
    (equivShrink α).symm.symm ((equivShrink α).symm ((equivShrink α) x) / (equivShrink α).symm ((equivShrink α) y))

Next tactic:
simp
@[simp]
lemma equivShrink_symm_neg [Neg α] [Small α] (x : Shrink α) :
    (equivShrink α).symm (-x) = -(equivShrink α).symm x := by
  

Proof state:
α : Type u_1
inst✝¹ : Neg α
inst✝ : Small.{u_2, u_1} α
x : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm (-x) = -(equivShrink α).symm x

Next tactic:
rw [Equiv.neg_def]
@[simp]
lemma equivShrink_symm_neg [Neg α] [Small α] (x : Shrink α) :
    (equivShrink α).symm (-x) = -(equivShrink α).symm x := by
  rw [Equiv.neg_def]
  

Proof state:
α : Type u_1
inst✝¹ : Neg α
inst✝ : Small.{u_2, u_1} α
x : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm ((equivShrink α).symm.symm (-(equivShrink α).symm x)) = -(equivShrink α).symm x

Next tactic:
simp
@[simp]
lemma equivShrink_neg [Neg α] [Small α] (x : α) :
    equivShrink α (-x) = -equivShrink α x := by
  

Proof state:
α : Type u_1
inst✝¹ : Neg α
inst✝ : Small.{u_2, u_1} α
x : α
⊢ (equivShrink α) (-x) = -(equivShrink α) x

Next tactic:
rw [Equiv.neg_def]
@[simp]
lemma equivShrink_neg [Neg α] [Small α] (x : α) :
    equivShrink α (-x) = -equivShrink α x := by
  rw [Equiv.neg_def]
  

Proof state:
α : Type u_1
inst✝¹ : Neg α
inst✝ : Small.{u_2, u_1} α
x : α
⊢ (equivShrink α) (-x) = (equivShrink α).symm.symm (-(equivShrink α).symm ((equivShrink α) x))

Next tactic:
simp
@[to_additive existing (attr := simp)]
lemma equivShrink_symm_inv [Inv α] [Small α] (x : Shrink α) :
    (equivShrink α).symm x⁻¹ = ((equivShrink α).symm x)⁻¹ := by
  

Proof state:
α : Type u_1
inst✝¹ : Inv α
inst✝ : Small.{u_2, u_1} α
x : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm x⁻¹ = ((equivShrink α).symm x)⁻¹

Next tactic:
rw [Equiv.inv_def]
@[to_additive existing (attr := simp)]
lemma equivShrink_symm_inv [Inv α] [Small α] (x : Shrink α) :
    (equivShrink α).symm x⁻¹ = ((equivShrink α).symm x)⁻¹ := by
  rw [Equiv.inv_def]
  

Proof state:
α : Type u_1
inst✝¹ : Inv α
inst✝ : Small.{u_2, u_1} α
x : Shrink.{u_2, u_1} α
⊢ (equivShrink α).symm ((equivShrink α).symm.symm ((equivShrink α).symm x)⁻¹) = ((equivShrink α).symm x)⁻¹

Next tactic:
simp
@[to_additive existing (attr := simp)]
lemma equivShrink_inv [Inv α] [Small α] (x : α) :
    equivShrink α x⁻¹ = (equivShrink α x)⁻¹ := by
  

Proof state:
α : Type u_1
inst✝¹ : Inv α
inst✝ : Small.{u_2, u_1} α
x : α
⊢ (equivShrink α) x⁻¹ = ((equivShrink α) x)⁻¹

Next tactic:
rw [Equiv.inv_def]
@[to_additive existing (attr := simp)]
lemma equivShrink_inv [Inv α] [Small α] (x : α) :
    equivShrink α x⁻¹ = (equivShrink α x)⁻¹ := by
  rw [Equiv.inv_def]
  

Proof state:
α : Type u_1
inst✝¹ : Inv α
inst✝ : Small.{u_2, u_1} α
x : α
⊢ (equivShrink α) x⁻¹ = (equivShrink α).symm.symm ((equivShrink α).symm ((equivShrink α) x))⁻¹

Next tactic:
simp
/-- (Impl) Given a cone in the base category, raise it to a cone in the over category. Note this is
where the connected assumption is used.
-/
@[simps]
def raiseCone [IsConnected J] {B : C} {F : J ⥤ Over B} (c : Cone (F ⋙ forget B)) :
    Cone F where
  pt := Over.mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom)
  π :=
    { app := fun j =>
        Over.homMk (c.π.app j) (nat_trans_from_is_connected (c.π ≫ natTransInOver F) j _)
      naturality := by
        

Proof state:
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
⊢ ∀ ⦃X Y : J⦄ (f : X ⟶ Y),
    ((Functor.const J).obj (mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom))).map f ≫
        (fun j => homMk (c.π.app j)) Y =
      (fun j => homMk (c.π.app j)) X ≫ F.map f

Next tactic:
intro X Y f
/-- (Impl) Given a cone in the base category, raise it to a cone in the over category. Note this is
where the connected assumption is used.
-/
@[simps]
def raiseCone [IsConnected J] {B : C} {F : J ⥤ Over B} (c : Cone (F ⋙ forget B)) :
    Cone F where
  pt := Over.mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom)
  π :=
    { app := fun j =>
        Over.homMk (c.π.app j) (nat_trans_from_is_connected (c.π ≫ natTransInOver F) j _)
      naturality := by
        intro X Y f
        

Proof state:
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X✝ : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
X Y : J
f : X ⟶ Y
⊢ ((Functor.const J).obj (mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom))).map f ≫
      (fun j => homMk (c.π.app j)) Y =
    (fun j => homMk (c.π.app j)) X ≫ F.map f

Next tactic:
apply CommaMorphism.ext
/-- (Impl) Given a cone in the base category, raise it to a cone in the over category. Note this is
where the connected assumption is used.
-/
@[simps]
def raiseCone [IsConnected J] {B : C} {F : J ⥤ Over B} (c : Cone (F ⋙ forget B)) :
    Cone F where
  pt := Over.mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom)
  π :=
    { app := fun j =>
        Over.homMk (c.π.app j) (nat_trans_from_is_connected (c.π ≫ natTransInOver F) j _)
      naturality := by
        intro X Y f
        apply CommaMorphism.ext
        · 

Proof state:
case left
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X✝ : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
X Y : J
f : X ⟶ Y
⊢ (((Functor.const J).obj (mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom))).map f ≫
        (fun j => homMk (c.π.app j)) Y).left =
    ((fun j => homMk (c.π.app j)) X ≫ F.map f).left

Next tactic:
simpa using (c.w f).symm
/-- (Impl) Given a cone in the base category, raise it to a cone in the over category. Note this is
where the connected assumption is used.
-/
@[simps]
def raiseCone [IsConnected J] {B : C} {F : J ⥤ Over B} (c : Cone (F ⋙ forget B)) :
    Cone F where
  pt := Over.mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom)
  π :=
    { app := fun j =>
        Over.homMk (c.π.app j) (nat_trans_from_is_connected (c.π ≫ natTransInOver F) j _)
      naturality := by
        intro X Y f
        apply CommaMorphism.ext
        · simpa using (c.w f).symm
        · 

Proof state:
case right
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X✝ : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
X Y : J
f : X ⟶ Y
⊢ (((Functor.const J).obj (mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom))).map f ≫
        (fun j => homMk (c.π.app j)) Y).right =
    ((fun j => homMk (c.π.app j)) X ≫ F.map f).right

Next tactic:
simp
theorem raised_cone_lowers_to_original [IsConnected J] {B : C} {F : J ⥤ Over B}
    (c : Cone (F ⋙ forget B)) :
    (forget B).mapCone (raiseCone c) = c := by 

Proof state:
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
⊢ (forget B).mapCone (raiseCone c) = c

Next tactic:
aesop_cat
/-- (Impl) Show that the raised cone is a limit. -/
def raisedConeIsLimit [IsConnected J] {B : C} {F : J ⥤ Over B} {c : Cone (F ⋙ forget B)}
    (t : IsLimit c) : IsLimit (raiseCone c) where
  lift s :=
    Over.homMk (t.lift ((forget B).mapCone s))
  uniq s m K := by
    

Proof state:
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
t : IsLimit c
s : Cone F
m : s.pt ⟶ (raiseCone c).pt
K : ∀ (j : J), m ≫ (raiseCone c).π.app j = s.π.app j
⊢ m = (fun s => homMk (IsLimit.lift t ((forget B).mapCone s))) s

Next tactic:
ext1
/-- (Impl) Show that the raised cone is a limit. -/
def raisedConeIsLimit [IsConnected J] {B : C} {F : J ⥤ Over B} {c : Cone (F ⋙ forget B)}
    (t : IsLimit c) : IsLimit (raiseCone c) where
  lift s :=
    Over.homMk (t.lift ((forget B).mapCone s))
  uniq s m K := by
    ext1
    

Proof state:
case h
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
t : IsLimit c
s : Cone F
m : s.pt ⟶ (raiseCone c).pt
K : ∀ (j : J), m ≫ (raiseCone c).π.app j = s.π.app j
⊢ m.left = ((fun s => homMk (IsLimit.lift t ((forget B).mapCone s))) s).left

Next tactic:
apply t.hom_ext
/-- (Impl) Show that the raised cone is a limit. -/
def raisedConeIsLimit [IsConnected J] {B : C} {F : J ⥤ Over B} {c : Cone (F ⋙ forget B)}
    (t : IsLimit c) : IsLimit (raiseCone c) where
  lift s :=
    Over.homMk (t.lift ((forget B).mapCone s))
  uniq s m K := by
    ext1
    apply t.hom_ext
    

Proof state:
case h
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
t : IsLimit c
s : Cone F
m : s.pt ⟶ (raiseCone c).pt
K : ∀ (j : J), m ≫ (raiseCone c).π.app j = s.π.app j
⊢ ∀ (j : J), m.left ≫ c.π.app j = ((fun s => homMk (IsLimit.lift t ((forget B).mapCone s))) s).left ≫ c.π.app j

Next tactic:
intro j
/-- (Impl) Show that the raised cone is a limit. -/
def raisedConeIsLimit [IsConnected J] {B : C} {F : J ⥤ Over B} {c : Cone (F ⋙ forget B)}
    (t : IsLimit c) : IsLimit (raiseCone c) where
  lift s :=
    Over.homMk (t.lift ((forget B).mapCone s))
  uniq s m K := by
    ext1
    apply t.hom_ext
    intro j
    

Proof state:
case h
J : Type v
inst✝² : SmallCategory J
C : Type u
inst✝¹ : Category.{v, u} C
X : C
inst✝ : IsConnected J
B : C
F : J ⥤ Over B
c : Cone (F ⋙ forget B)
t : IsLimit c
s : Cone F
m : s.pt ⟶ (raiseCone c).pt
K : ∀ (j : J), m ≫ (raiseCone c).π.app j = s.π.app j
j : J
⊢ m.left ≫ c.π.app j = ((fun s => homMk (IsLimit.lift t ((forget B).mapCone s))) s).left ≫ c.π.app j

Next tactic:
simp [← K j]
/-- The embedding of the Gaussian integers into the complex numbers, as a ring homomorphism. -/
def toComplex : ℤ[i] →+* ℂ :=
  Zsqrtd.lift ⟨I, by 

Proof state:
⊢ I * I = ↑(-1)

Next tactic:
simp
theorem toComplex_def' (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ) = x + y * I := by 

Proof state:
x y : ℤ
⊢ toComplex { re := x, im := y } = ↑x + ↑y * I

Next tactic:
simp [toComplex_def]
theorem toComplex_def₂ (x : ℤ[i]) : (x : ℂ) = ⟨x.re, x.im⟩ := by
  

Proof state:
x : ℤ[i]
⊢ toComplex x = { re := ↑x.re, im := ↑x.im }

Next tactic:
apply Complex.ext
theorem toComplex_def₂ (x : ℤ[i]) : (x : ℂ) = ⟨x.re, x.im⟩ := by
  apply Complex.ext <;> 

Proof state:
case a
x : ℤ[i]
⊢ (toComplex x).re = { re := ↑x.re, im := ↑x.im }.re

Next tactic:
simp [toComplex_def]
theorem toComplex_def₂ (x : ℤ[i]) : (x : ℂ) = ⟨x.re, x.im⟩ := by
  apply Complex.ext <;> 

Proof state:
case a
x : ℤ[i]
⊢ (toComplex x).im = { re := ↑x.re, im := ↑x.im }.im

Next tactic:
simp [toComplex_def]
@[simp]
theorem to_real_re (x : ℤ[i]) : ((x.re : ℤ) : ℝ) = (x : ℂ).re := by 

Proof state:
x : ℤ[i]
⊢ ↑x.re = (toComplex x).re

Next tactic:
simp [toComplex_def]
@[simp]
theorem to_real_im (x : ℤ[i]) : ((x.im : ℤ) : ℝ) = (x : ℂ).im := by 

Proof state:
x : ℤ[i]
⊢ ↑x.im = (toComplex x).im

Next tactic:
simp [toComplex_def]
@[simp]
theorem toComplex_re (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ).re = x := by 

Proof state:
x y : ℤ
⊢ (toComplex { re := x, im := y }).re = ↑x

Next tactic:
simp [toComplex_def]
@[simp]
theorem toComplex_im (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ).im = y := by 

Proof state:
x y : ℤ
⊢ (toComplex { re := x, im := y }).im = ↑y

Next tactic:
simp [toComplex_def]
@[simp]
theorem toComplex_star (x : ℤ[i]) : ((star x : ℤ[i]) : ℂ) = conj (x : ℂ) := by
  

Proof state:
x : ℤ[i]
⊢ toComplex (star x) = (starRingEnd ℂ) (toComplex x)

Next tactic:
rw [toComplex_def₂, toComplex_def₂]
@[simp]
theorem toComplex_star (x : ℤ[i]) : ((star x : ℤ[i]) : ℂ) = conj (x : ℂ) := by
  rw [toComplex_def₂, toComplex_def₂]
  

Proof state:
x : ℤ[i]
⊢ { re := ↑(star x).re, im := ↑(star x).im } = (starRingEnd ℂ) { re := ↑x.re, im := ↑x.im }

Next tactic:
exact congr_arg₂ _ rfl (Int.cast_neg _)
@[simp]
theorem toComplex_inj {x y : ℤ[i]} : (x : ℂ) = y ↔ x = y := by
  

Proof state:
x y : ℤ[i]
⊢ toComplex x = toComplex y ↔ x = y

Next tactic:
cases x
@[simp]
theorem toComplex_inj {x y : ℤ[i]} : (x : ℂ) = y ↔ x = y := by
  cases x; 

Proof state:
case mk
y : ℤ[i]
re✝ im✝ : ℤ
⊢ toComplex { re := re✝, im := im✝ } = toComplex y ↔ { re := re✝, im := im✝ } = y

Next tactic:
cases y
@[simp]
theorem toComplex_inj {x y : ℤ[i]} : (x : ℂ) = y ↔ x = y := by
  cases x; cases y; 

Proof state:
case mk.mk
re✝¹ im✝¹ re✝ im✝ : ℤ
⊢ toComplex { re := re✝¹, im := im✝¹ } = toComplex { re := re✝, im := im✝ } ↔
    { re := re✝¹, im := im✝¹ } = { re := re✝, im := im✝ }

Next tactic:
simp [toComplex_def₂]
@[simp]
theorem toComplex_eq_zero {x : ℤ[i]} : (x : ℂ) = 0 ↔ x = 0 := by
  

Proof state:
x : ℤ[i]
⊢ toComplex x = 0 ↔ x = 0

Next tactic:
rw [← toComplex_zero, toComplex_inj]
@[simp]
theorem int_cast_real_norm (x : ℤ[i]) : (x.norm : ℝ) = Complex.normSq (x : ℂ) := by
  

Proof state:
x : ℤ[i]
⊢ ↑(norm x) = normSq (toComplex x)

Next tactic:
rw [Zsqrtd.norm, normSq]
@[simp]
theorem int_cast_real_norm (x : ℤ[i]) : (x.norm : ℝ) = Complex.normSq (x : ℂ) := by
  rw [Zsqrtd.norm, normSq]; 

Proof state:
x : ℤ[i]
⊢ ↑(x.re * x.re - -1 * x.im * x.im) =
    { toZeroHom := { toFun := fun z => z.re * z.re + z.im * z.im, map_zero' := normSq.proof_1 },
        map_one' := normSq.proof_2, map_mul' := normSq.proof_3 }
      (toComplex x)

Next tactic:
simp
@[simp]
theorem int_cast_complex_norm (x : ℤ[i]) : (x.norm : ℂ) = Complex.normSq (x : ℂ) := by
  

Proof state:
x : ℤ[i]
⊢ ↑(norm x) = ↑(normSq (toComplex x))

Next tactic:
cases x
@[simp]
theorem int_cast_complex_norm (x : ℤ[i]) : (x.norm : ℂ) = Complex.normSq (x : ℂ) := by
  cases x; 

Proof state:
case mk
re✝ im✝ : ℤ
⊢ ↑(norm { re := re✝, im := im✝ }) = ↑(normSq (toComplex { re := re✝, im := im✝ }))

Next tactic:
rw [Zsqrtd.norm, normSq]