l3lab/ntp-mathlib huggingface dataset:
/-- Composition of `PseudoEpimorphism`s as a `PseudoEpimorphism`. -/
def comp (g : PseudoEpimorphism β γ) (f : PseudoEpimorphism α β) : PseudoEpimorphism α γ :=
  ⟨g.toOrderHom.comp f.toOrderHom, fun a b h₀ => by
    obtain ⟨b, h₁, rfl⟩ := g.exists_map_eq_of_map_le' h₀
    obtain ⟨b, h₂, rfl⟩ := f.exists_map_eq_of_map_le' h₁
    

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : Preorder α
inst✝² : Preorder β
inst✝¹ : Preorder γ
inst✝ : Preorder δ
g : PseudoEpimorphism β γ
f : PseudoEpimorphism α β
a b : α
h₂ : a ≤ b
h₁ : f.toOrderHom a ≤ OrderHom.toFun f.toOrderHom b
h₀ :
  OrderHom.toFun (OrderHom.comp g.toOrderHom f.toOrderHom) a ≤
    OrderHom.toFun g.toOrderHom (OrderHom.toFun f.toOrderHom b)
⊢ ∃ c,
    a ≤ c ∧
      OrderHom.toFun (OrderHom.comp g.toOrderHom f.toOrderHom) c =
        OrderHom.toFun g.toOrderHom (OrderHom.toFun f.toOrderHom b)

Next tactic:
exact ⟨b, h₂, rfl⟩
@[simp]
theorem cancel_left {g : PseudoEpimorphism β γ} {f₁ f₂ : PseudoEpimorphism α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ :=
  ⟨fun h => ext fun a => hg <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝³ : Preorder α
inst✝² : Preorder β
inst✝¹ : Preorder γ
inst✝ : Preorder δ
g : PseudoEpimorphism β γ
f₁ f₂ : PseudoEpimorphism α β
hg : Injective ⇑g
h : comp g f₁ = comp g f₂
a : α
⊢ g (f₁ a) = g (f₂ a)

Next tactic:
rw [← comp_apply, h, comp_apply]
instance : EsakiaHomClass (EsakiaHom α β) α β where
  coe f := f.toFun
  coe_injective' f g h := by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
f g : EsakiaHom α β
h : (fun f => f.toFun) f = (fun f => f.toFun) g
⊢ f = g

Next tactic:
obtain ⟨⟨⟨_, _⟩, _⟩, _⟩ := f
instance : EsakiaHomClass (EsakiaHom α β) α β where
  coe f := f.toFun
  coe_injective' f g h := by
    obtain ⟨⟨⟨_, _⟩, _⟩, _⟩ := f
    

Proof state:
case mk.mk.mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
g : EsakiaHom α β
toFun✝ : α → β
monotone'✝ : Monotone toFun✝
continuous_toFun✝ : Continuous { toFun := toFun✝, monotone' := monotone'✝ }.toFun
exists_map_eq_of_map_le'✝ :
  ∀ ⦃a : α⦄ ⦃b : β⦄,
    OrderHom.toFun
          { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ },
              continuous_toFun := continuous_toFun✝ }.toOrderHom
          a ≤
        b →
      ∃ c,
        a ≤ c ∧
          OrderHom.toFun
              { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ },
                  continuous_toFun := continuous_toFun✝ }.toOrderHom
              c =
            b
h :
  (fun f => f.toFun)
      {
        toContinuousOrderHom :=
          { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ }, continuous_toFun := continuous_toFun✝ },
        exists_map_eq_of_map_le' := exists_map_eq_of_map_le'✝ } =
    (fun f => f.toFun) g
⊢ {
      toContinuousOrderHom :=
        { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ }, continuous_toFun := continuous_toFun✝ },
      exists_map_eq_of_map_le' := exists_map_eq_of_map_le'✝ } =
    g

Next tactic:
obtain ⟨⟨⟨_, _⟩, _⟩, _⟩ := g
instance : EsakiaHomClass (EsakiaHom α β) α β where
  coe f := f.toFun
  coe_injective' f g h := by
    obtain ⟨⟨⟨_, _⟩, _⟩, _⟩ := f
    obtain ⟨⟨⟨_, _⟩, _⟩, _⟩ := g
    

Proof state:
case mk.mk.mk.mk.mk.mk
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
toFun✝¹ : α → β
monotone'✝¹ : Monotone toFun✝¹
continuous_toFun✝¹ : Continuous { toFun := toFun✝¹, monotone' := monotone'✝¹ }.toFun
exists_map_eq_of_map_le'✝¹ :
  ∀ ⦃a : α⦄ ⦃b : β⦄,
    OrderHom.toFun
          { toOrderHom := { toFun := toFun✝¹, monotone' := monotone'✝¹ },
              continuous_toFun := continuous_toFun✝¹ }.toOrderHom
          a ≤
        b →
      ∃ c,
        a ≤ c ∧
          OrderHom.toFun
              { toOrderHom := { toFun := toFun✝¹, monotone' := monotone'✝¹ },
                  continuous_toFun := continuous_toFun✝¹ }.toOrderHom
              c =
            b
toFun✝ : α → β
monotone'✝ : Monotone toFun✝
continuous_toFun✝ : Continuous { toFun := toFun✝, monotone' := monotone'✝ }.toFun
exists_map_eq_of_map_le'✝ :
  ∀ ⦃a : α⦄ ⦃b : β⦄,
    OrderHom.toFun
          { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ },
              continuous_toFun := continuous_toFun✝ }.toOrderHom
          a ≤
        b →
      ∃ c,
        a ≤ c ∧
          OrderHom.toFun
              { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ },
                  continuous_toFun := continuous_toFun✝ }.toOrderHom
              c =
            b
h :
  (fun f => f.toFun)
      {
        toContinuousOrderHom :=
          { toOrderHom := { toFun := toFun✝¹, monotone' := monotone'✝¹ }, continuous_toFun := continuous_toFun✝¹ },
        exists_map_eq_of_map_le' := exists_map_eq_of_map_le'✝¹ } =
    (fun f => f.toFun)
      {
        toContinuousOrderHom :=
          { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ }, continuous_toFun := continuous_toFun✝ },
        exists_map_eq_of_map_le' := exists_map_eq_of_map_le'✝ }
⊢ {
      toContinuousOrderHom :=
        { toOrderHom := { toFun := toFun✝¹, monotone' := monotone'✝¹ }, continuous_toFun := continuous_toFun✝¹ },
      exists_map_eq_of_map_le' := exists_map_eq_of_map_le'✝¹ } =
    {
      toContinuousOrderHom :=
        { toOrderHom := { toFun := toFun✝, monotone' := monotone'✝ }, continuous_toFun := continuous_toFun✝ },
      exists_map_eq_of_map_le' := exists_map_eq_of_map_le'✝ }

Next tactic:
congr
/-- Copy of an `EsakiaHom` with a new `toFun` equal to the old one. Useful to fix definitional
equalities. -/
protected def copy (f : EsakiaHom α β) (f' : α → β) (h : f' = f) : EsakiaHom α β :=
  ⟨f.toContinuousOrderHom.copy f' h, by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
f : EsakiaHom α β
f' : α → β
h : f' = ⇑f
⊢ ∀ ⦃a : α⦄ ⦃b : β⦄,
    OrderHom.toFun (ContinuousOrderHom.copy f.toContinuousOrderHom f' h).toOrderHom a ≤ b →
      ∃ c, a ≤ c ∧ OrderHom.toFun (ContinuousOrderHom.copy f.toContinuousOrderHom f' h).toOrderHom c = b

Next tactic:
simpa only [h.symm, toFun_eq_coe] using f.exists_map_eq_of_map_le'
/-- Composition of `EsakiaHom`s as an `EsakiaHom`. -/
def comp (g : EsakiaHom β γ) (f : EsakiaHom α β) : EsakiaHom α γ :=
  ⟨g.toContinuousOrderHom.comp f.toContinuousOrderHom, fun a b h₀ => by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
g : EsakiaHom β γ
f : EsakiaHom α β
a : α
b : γ
h₀ : OrderHom.toFun (ContinuousOrderHom.comp g.toContinuousOrderHom f.toContinuousOrderHom).toOrderHom a ≤ b
⊢ ∃ c, a ≤ c ∧ OrderHom.toFun (ContinuousOrderHom.comp g.toContinuousOrderHom f.toContinuousOrderHom).toOrderHom c = b

Next tactic:
obtain ⟨b, h₁, rfl⟩ := g.exists_map_eq_of_map_le' h₀
/-- Composition of `EsakiaHom`s as an `EsakiaHom`. -/
def comp (g : EsakiaHom β γ) (f : EsakiaHom α β) : EsakiaHom α γ :=
  ⟨g.toContinuousOrderHom.comp f.toContinuousOrderHom, fun a b h₀ => by
    obtain ⟨b, h₁, rfl⟩ := g.exists_map_eq_of_map_le' h₀
    

Proof state:
case intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
g : EsakiaHom β γ
f : EsakiaHom α β
a : α
b : β
h₁ : f.toOrderHom a ≤ b
h₀ :
  OrderHom.toFun (ContinuousOrderHom.comp g.toContinuousOrderHom f.toContinuousOrderHom).toOrderHom a ≤
    OrderHom.toFun g.toOrderHom b
⊢ ∃ c,
    a ≤ c ∧
      OrderHom.toFun (ContinuousOrderHom.comp g.toContinuousOrderHom f.toContinuousOrderHom).toOrderHom c =
        OrderHom.toFun g.toOrderHom b

Next tactic:
obtain ⟨b, h₂, rfl⟩ := f.exists_map_eq_of_map_le' h₁
/-- Composition of `EsakiaHom`s as an `EsakiaHom`. -/
def comp (g : EsakiaHom β γ) (f : EsakiaHom α β) : EsakiaHom α γ :=
  ⟨g.toContinuousOrderHom.comp f.toContinuousOrderHom, fun a b h₀ => by
    obtain ⟨b, h₁, rfl⟩ := g.exists_map_eq_of_map_le' h₀
    obtain ⟨b, h₂, rfl⟩ := f.exists_map_eq_of_map_le' h₁
    

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
g : EsakiaHom β γ
f : EsakiaHom α β
a b : α
h₂ : a ≤ b
h₁ : f.toOrderHom a ≤ OrderHom.toFun f.toOrderHom b
h₀ :
  OrderHom.toFun (ContinuousOrderHom.comp g.toContinuousOrderHom f.toContinuousOrderHom).toOrderHom a ≤
    OrderHom.toFun g.toOrderHom (OrderHom.toFun f.toOrderHom b)
⊢ ∃ c,
    a ≤ c ∧
      OrderHom.toFun (ContinuousOrderHom.comp g.toContinuousOrderHom f.toContinuousOrderHom).toOrderHom c =
        OrderHom.toFun g.toOrderHom (OrderHom.toFun f.toOrderHom b)

Next tactic:
exact ⟨b, h₂, rfl⟩
@[simp]
theorem cancel_left {g : EsakiaHom β γ} {f₁ f₂ : EsakiaHom α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ :=
  ⟨fun h => ext fun a => hg <| by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
δ : Type u_5
inst✝⁷ : TopologicalSpace α
inst✝⁶ : Preorder α
inst✝⁵ : TopologicalSpace β
inst✝⁴ : Preorder β
inst✝³ : TopologicalSpace γ
inst✝² : Preorder γ
inst✝¹ : TopologicalSpace δ
inst✝ : Preorder δ
g : EsakiaHom β γ
f₁ f₂ : EsakiaHom α β
hg : Injective ⇑g
h : comp g f₁ = comp g f₂
a : α
⊢ g (f₁ a) = g (f₂ a)

Next tactic:
rw [← comp_apply, h, comp_apply]
instance [UniformSpace α] [MonoidWithZero M] [Zero α] [MulActionWithZero M α]
    [UniformContinuousConstSMul M α] : MulActionWithZero M (Completion α) :=
  { (inferInstance : MulAction M $ Completion α) with
    smul_zero := fun r ↦ by 

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝⁴ : UniformSpace α
inst✝³ : MonoidWithZero M
inst✝² : Zero α
inst✝¹ : MulActionWithZero M α
inst✝ : UniformContinuousConstSMul M α
src✝ : MulAction M (Completion α) := inferInstance
r : M
⊢ r • 0 = 0

Next tactic:
rw [← coe_zero, ← coe_smul, MulActionWithZero.smul_zero r]
instance [UniformSpace α] [MonoidWithZero M] [Zero α] [MulActionWithZero M α]
    [UniformContinuousConstSMul M α] : MulActionWithZero M (Completion α) :=
  { (inferInstance : MulAction M $ Completion α) with
    smul_zero := fun r ↦ by rw [← coe_zero, ← coe_smul, MulActionWithZero.smul_zero r]
    zero_smul :=
      ext' (continuous_const_smul _) continuous_const fun a ↦ by
        

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝⁴ : UniformSpace α
inst✝³ : MonoidWithZero M
inst✝² : Zero α
inst✝¹ : MulActionWithZero M α
inst✝ : UniformContinuousConstSMul M α
src✝ : MulAction M (Completion α) := inferInstance
a : α
⊢ 0 • ↑α a = 0

Next tactic:
rw [← coe_smul, zero_smul, coe_zero]
instance : AddMonoid (Completion α) :=
  { (inferInstance : Zero $ Completion α),
    (inferInstance : Add $ Completion α) with
    zero_add := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_const continuous_id) continuous_id) fun a ↦
        show 0 + (a : Completion α) = a by rw [← coe_zero, ← coe_add, zero_add]
    add_zero := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_id continuous_const) continuous_id) fun a ↦
        show (a : Completion α) + 0 = a by rw [← coe_zero, ← coe_add, add_zero]
    add_assoc := fun a b c ↦
      Completion.induction_on₃ a b c
        (isClosed_eq
          (continuous_map₂ (continuous_map₂ continuous_fst (continuous_fst.comp continuous_snd))
            (continuous_snd.comp continuous_snd))
          (continuous_map₂ continuous_fst
            (continuous_map₂ (continuous_fst.comp continuous_snd)
              (continuous_snd.comp continuous_snd))))
        fun a b c ↦
        show (a : Completion α) + b + c = a + (b + c) by 

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝¹ : Zero (Completion α) := inferInstance
src✝ : Add (Completion α) := inferInstance
a✝ b✝ c✝ : Completion α
a b c : α
⊢ ↑α a + ↑α b + ↑α c = ↑α a + (↑α b + ↑α c)

Next tactic:
repeat' rw_mod_cast [add_assoc]
instance : AddMonoid (Completion α) :=
  { (inferInstance : Zero $ Completion α),
    (inferInstance : Add $ Completion α) with
    zero_add := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_const continuous_id) continuous_id) fun a ↦
        show 0 + (a : Completion α) = a by rw [← coe_zero, ← coe_add, zero_add]
    add_zero := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_id continuous_const) continuous_id) fun a ↦
        show (a : Completion α) + 0 = a by rw [← coe_zero, ← coe_add, add_zero]
    add_assoc := fun a b c ↦
      Completion.induction_on₃ a b c
        (isClosed_eq
          (continuous_map₂ (continuous_map₂ continuous_fst (continuous_fst.comp continuous_snd))
            (continuous_snd.comp continuous_snd))
          (continuous_map₂ continuous_fst
            (continuous_map₂ (continuous_fst.comp continuous_snd)
              (continuous_snd.comp continuous_snd))))
        fun a b c ↦
        show (a : Completion α) + b + c = a + (b + c) by repeat' 

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝¹ : Zero (Completion α) := inferInstance
src✝ : Add (Completion α) := inferInstance
a✝ b✝ c✝ : Completion α
a b c : α
⊢ ↑α a + ↑α b + ↑α c = ↑α a + (↑α b + ↑α c)

Next tactic:
rw_mod_cast [add_assoc]
instance : AddMonoid (Completion α) :=
  { (inferInstance : Zero $ Completion α),
    (inferInstance : Add $ Completion α) with
    zero_add := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_const continuous_id) continuous_id) fun a ↦
        show 0 + (a : Completion α) = a by 

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝¹ : Zero (Completion α) := inferInstance
src✝ : Add (Completion α) := inferInstance
a✝ : Completion α
a : α
⊢ 0 + ↑α a = ↑α a

Next tactic:
rw [← coe_zero, ← coe_add, zero_add]
instance : AddMonoid (Completion α) :=
  { (inferInstance : Zero $ Completion α),
    (inferInstance : Add $ Completion α) with
    zero_add := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_const continuous_id) continuous_id) fun a ↦
        show 0 + (a : Completion α) = a by rw [← coe_zero, ← coe_add, zero_add]
    add_zero := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_id continuous_const) continuous_id) fun a ↦
        show (a : Completion α) + 0 = a by 

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝¹ : Zero (Completion α) := inferInstance
src✝ : Add (Completion α) := inferInstance
a✝ : Completion α
a : α
⊢ ↑α a + 0 = ↑α a

Next tactic:
rw [← coe_zero, ← coe_add, add_zero]
instance : AddMonoid (Completion α) :=
  { (inferInstance : Zero $ Completion α),
    (inferInstance : Add $ Completion α) with
    zero_add := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_const continuous_id) continuous_id) fun a ↦
        show 0 + (a : Completion α) = a by rw [← coe_zero, ← coe_add, zero_add]
    add_zero := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_id continuous_const) continuous_id) fun a ↦
        show (a : Completion α) + 0 = a by rw [← coe_zero, ← coe_add, add_zero]
    add_assoc := fun a b c ↦
      Completion.induction_on₃ a b c
        (isClosed_eq
          (continuous_map₂ (continuous_map₂ continuous_fst (continuous_fst.comp continuous_snd))
            (continuous_snd.comp continuous_snd))
          (continuous_map₂ continuous_fst
            (continuous_map₂ (continuous_fst.comp continuous_snd)
              (continuous_snd.comp continuous_snd))))
        fun a b c ↦
        show (a : Completion α) + b + c = a + (b + c) by repeat' rw_mod_cast [add_assoc]
    nsmul := (· • ·)
    nsmul_zero := fun a ↦
      Completion.induction_on a (isClosed_eq continuous_map continuous_const) fun a ↦
        show 0 • (a : Completion α) = 0 by 

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝¹ : Zero (Completion α) := inferInstance
src✝ : Add (Completion α) := inferInstance
a✝ : Completion α
a : α
⊢ 0 • ↑α a = 0

Next tactic:
rw [← coe_smul, ← coe_zero, zero_smul]
instance : AddMonoid (Completion α) :=
  { (inferInstance : Zero $ Completion α),
    (inferInstance : Add $ Completion α) with
    zero_add := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_const continuous_id) continuous_id) fun a ↦
        show 0 + (a : Completion α) = a by rw [← coe_zero, ← coe_add, zero_add]
    add_zero := fun a ↦
      Completion.induction_on a
        (isClosed_eq (continuous_map₂ continuous_id continuous_const) continuous_id) fun a ↦
        show (a : Completion α) + 0 = a by rw [← coe_zero, ← coe_add, add_zero]
    add_assoc := fun a b c ↦
      Completion.induction_on₃ a b c
        (isClosed_eq
          (continuous_map₂ (continuous_map₂ continuous_fst (continuous_fst.comp continuous_snd))
            (continuous_snd.comp continuous_snd))
          (continuous_map₂ continuous_fst
            (continuous_map₂ (continuous_fst.comp continuous_snd)
              (continuous_snd.comp continuous_snd))))
        fun a b c ↦
        show (a : Completion α) + b + c = a + (b + c) by repeat' rw_mod_cast [add_assoc]
    nsmul := (· • ·)
    nsmul_zero := fun a ↦
      Completion.induction_on a (isClosed_eq continuous_map continuous_const) fun a ↦
        show 0 • (a : Completion α) = 0 by rw [← coe_smul, ← coe_zero, zero_smul]
    nsmul_succ := fun n a ↦
      Completion.induction_on a
        (isClosed_eq continuous_map <| continuous_map₂ continuous_id continuous_map) fun a ↦
        show (n + 1) • (a : Completion α) = (a : Completion α) + n • (a : Completion α) by
          

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝¹ : Zero (Completion α) := inferInstance
src✝ : Add (Completion α) := inferInstance
n : ℕ
a✝ : Completion α
a : α
⊢ (n + 1) • ↑α a = ↑α a + n • ↑α a

Next tactic:
rw [← coe_smul, succ_nsmul, coe_add, coe_smul]
instance : SubNegMonoid (Completion α) :=
  { (inferInstance : AddMonoid $ Completion α),
    (inferInstance : Neg $ Completion α),
    (inferInstance : Sub $ Completion α) with
    sub_eq_add_neg := fun a b ↦
      Completion.induction_on₂ a b
        (isClosed_eq (continuous_map₂ continuous_fst continuous_snd)
          (continuous_map₂ continuous_fst (Completion.continuous_map.comp continuous_snd)))
        fun a b ↦ mod_cast congr_arg ((↑) : α → Completion α) (sub_eq_add_neg a b)
    zsmul := (· • ·)
    zsmul_zero' := fun a ↦
      Completion.induction_on a (isClosed_eq continuous_map continuous_const) fun a ↦
        show (0 : ℤ) • (a : Completion α) = 0 by 

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝² : AddMonoid (Completion α) := inferInstance
src✝¹ : Neg (Completion α) := inferInstance
src✝ : Sub (Completion α) := inferInstance
a✝ : Completion α
a : α
⊢ 0 • ↑α a = 0

Next tactic:
rw [← coe_smul, ← coe_zero, zero_smul]
instance : SubNegMonoid (Completion α) :=
  { (inferInstance : AddMonoid $ Completion α),
    (inferInstance : Neg $ Completion α),
    (inferInstance : Sub $ Completion α) with
    sub_eq_add_neg := fun a b ↦
      Completion.induction_on₂ a b
        (isClosed_eq (continuous_map₂ continuous_fst continuous_snd)
          (continuous_map₂ continuous_fst (Completion.continuous_map.comp continuous_snd)))
        fun a b ↦ mod_cast congr_arg ((↑) : α → Completion α) (sub_eq_add_neg a b)
    zsmul := (· • ·)
    zsmul_zero' := fun a ↦
      Completion.induction_on a (isClosed_eq continuous_map continuous_const) fun a ↦
        show (0 : ℤ) • (a : Completion α) = 0 by rw [← coe_smul, ← coe_zero, zero_smul]
    zsmul_succ' := fun n a ↦
      Completion.induction_on a
        (isClosed_eq continuous_map <| continuous_map₂ continuous_id continuous_map) fun a ↦
          show Int.ofNat n.succ • (a : Completion α) = _ by
            

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝² : AddMonoid (Completion α) := inferInstance
src✝¹ : Neg (Completion α) := inferInstance
src✝ : Sub (Completion α) := inferInstance
n : ℕ
a✝ : Completion α
a : α
⊢ Int.ofNat (Nat.succ n) • ↑α a = ↑α a + (fun x x_1 => x • x_1) (Int.ofNat n) (↑α a)

Next tactic:
rw [← coe_smul, show Int.ofNat n.succ • a = a + Int.ofNat n • a from
              SubNegMonoid.zsmul_succ' n a, coe_add, coe_smul]
instance : SubNegMonoid (Completion α) :=
  { (inferInstance : AddMonoid $ Completion α),
    (inferInstance : Neg $ Completion α),
    (inferInstance : Sub $ Completion α) with
    sub_eq_add_neg := fun a b ↦
      Completion.induction_on₂ a b
        (isClosed_eq (continuous_map₂ continuous_fst continuous_snd)
          (continuous_map₂ continuous_fst (Completion.continuous_map.comp continuous_snd)))
        fun a b ↦ mod_cast congr_arg ((↑) : α → Completion α) (sub_eq_add_neg a b)
    zsmul := (· • ·)
    zsmul_zero' := fun a ↦
      Completion.induction_on a (isClosed_eq continuous_map continuous_const) fun a ↦
        show (0 : ℤ) • (a : Completion α) = 0 by rw [← coe_smul, ← coe_zero, zero_smul]
    zsmul_succ' := fun n a ↦
      Completion.induction_on a
        (isClosed_eq continuous_map <| continuous_map₂ continuous_id continuous_map) fun a ↦
          show Int.ofNat n.succ • (a : Completion α) = _ by
            rw [← coe_smul, show Int.ofNat n.succ • a = a + Int.ofNat n • a from
              SubNegMonoid.zsmul_succ' n a, coe_add, coe_smul]
    zsmul_neg' := fun n a ↦
      Completion.induction_on a
        (isClosed_eq continuous_map <| Completion.continuous_map.comp continuous_map) fun a ↦
          show (Int.negSucc n) • (a : Completion α) = _ by
            

Proof state:
M : Type u_1
R : Type u_2
α : Type u_3
β : Type u_4
inst✝² : UniformSpace α
inst✝¹ : AddGroup α
inst✝ : UniformAddGroup α
src✝² : AddMonoid (Completion α) := inferInstance
src✝¹ : Neg (Completion α) := inferInstance
src✝ : Sub (Completion α) := inferInstance
n : ℕ
a✝ : Completion α
a : α
⊢ Int.negSucc n • ↑α a = -(fun x x_1 => x • x_1) (↑(Nat.succ n)) (↑α a)

Next tactic:
rw [← coe_smul, show (Int.negSucc n) • a = -((n.succ : ℤ) • a) from
              SubNegMonoid.zsmul_neg' n a, coe_neg, coe_smul]