l3lab/ntp-mathlib huggingface dataset:
/-- A `DistribMulAction` by a product monoid is equivalent to
  commuting `DistribMulAction`s by the factors. -/
def DistribMulAction.prodEquiv : DistribMulAction (M × N) α ≃
    Σ' (_ : DistribMulAction M α) (_ : DistribMulAction N α), SMulCommClass M N α where
  toFun _ :=
    letI instM := DistribMulAction.compHom α (.inl M N)
    letI instN := DistribMulAction.compHom α (.inr M N)
    ⟨instM, instN, (MulAction.prodEquiv M N α inferInstance).2.2⟩
  invFun _insts :=
    letI := _insts.1; letI := _insts.2.1; have := _insts.2.2
    DistribMulAction.prodOfSMulCommClass M N α
  left_inv _ := by
    dsimp only; congr; ext ⟨m, n⟩ a
    change (m, (1 : N)) • ((1 : M), n) • a = _
    rw [smul_smul, Prod.mk_mul_mk, mul_one, one_mul]; rfl
  right_inv := by
    rintro ⟨_, x, _⟩
    dsimp only; congr 1
    · ext m a; conv_rhs => rw [← one_smul N a]; rfl
    congr 1
    · funext i; congr; ext m a; clear i; conv_rhs => rw [← one_smul N a]; rfl
    · congr 1; ext n a; conv_rhs => rw [← one_smul M (SMul.smul n a)]; rfl
    · 

Proof state:
case mk.mk.h.e_4.e_4
M : Type u_1
N : Type u_2
P : Type u_3
E : Type u_4
α : Type u_5
β : Type u_6
inst✝² : Monoid M
inst✝¹ : Monoid N
inst✝ : AddMonoid α
fst✝ : DistribMulAction M α
x : DistribMulAction N α
snd✝ : SMulCommClass M N α
⊢ HEq (_ : SMulCommClass M N α) snd✝

Next tactic:
apply heq_prop
@[reassoc]
lemma pullback.condition : pullback.fst f g ≫ f = pullback.snd f g ≫ g := by
  

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
⊢ fst f g ≫ f = snd f g ≫ g

Next tactic:
ext ⟨_,h⟩
@[reassoc]
lemma pullback.condition : pullback.fst f g ≫ f = pullback.snd f g ≫ g := by
  ext ⟨_,h⟩; 

Proof state:
case w.mk
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
val✝ : ↑X.toTop × ↑Y.toTop
h : val✝ ∈ {xy | f xy.1 = g xy.2}
⊢ (fst f g ≫ f) { val := val✝, property := h } = (snd f g ≫ g) { val := val✝, property := h }

Next tactic:
exact h
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {Z : CompHaus.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    Z ⟶ pullback f g where
  toFun := fun z => ⟨⟨a z, b z⟩, by 

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a : Z ⟶ X
b : Z ⟶ Y
w : a ≫ f = b ≫ g
z : ↑Z.toTop
⊢ (a z, b z) ∈ {xy | f xy.1 = g xy.2}

Next tactic:
apply_fun (fun q => q z) at w
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {Z : CompHaus.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    Z ⟶ pullback f g where
  toFun := fun z => ⟨⟨a z, b z⟩, by apply_fun (fun q => q z) at w; 

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a : Z ⟶ X
b : Z ⟶ Y
z : ↑Z.toTop
w : (a ≫ f) z = (b ≫ g) z
⊢ (a z, b z) ∈ {xy | f xy.1 = g xy.2}

Next tactic:
exact w
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {Z : CompHaus.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    Z ⟶ pullback f g where
  toFun := fun z => ⟨⟨a z, b z⟩, by apply_fun (fun q => q z) at w; exact w⟩
  continuous_toFun := by
    

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a : Z ⟶ X
b : Z ⟶ Y
w : a ≫ f = b ≫ g
⊢ Continuous fun z => { val := (a z, b z), property := (_ : (a ≫ f) z = (b ≫ g) z) }

Next tactic:
apply Continuous.subtype_mk
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {Z : CompHaus.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    Z ⟶ pullback f g where
  toFun := fun z => ⟨⟨a z, b z⟩, by apply_fun (fun q => q z) at w; exact w⟩
  continuous_toFun := by
    apply Continuous.subtype_mk
    

Proof state:
case h
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a : Z ⟶ X
b : Z ⟶ Y
w : a ≫ f = b ≫ g
⊢ Continuous fun x => (a x, b x)

Next tactic:
rw [continuous_prod_mk]
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {Z : CompHaus.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    Z ⟶ pullback f g where
  toFun := fun z => ⟨⟨a z, b z⟩, by apply_fun (fun q => q z) at w; exact w⟩
  continuous_toFun := by
    apply Continuous.subtype_mk
    rw [continuous_prod_mk]
    

Proof state:
case h
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a : Z ⟶ X
b : Z ⟶ Y
w : a ≫ f = b ≫ g
⊢ (Continuous fun x => a x) ∧ Continuous fun x => b x

Next tactic:
exact ⟨a.continuous, b.continuous⟩
lemma pullback.hom_ext {Z : CompHaus.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b := by
  

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a b : Z ⟶ pullback f g
hfst : a ≫ fst f g = b ≫ fst f g
hsnd : a ≫ snd f g = b ≫ snd f g
⊢ a = b

Next tactic:
ext z
lemma pullback.hom_ext {Z : CompHaus.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b := by
  ext z
  

Proof state:
case w
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a b : Z ⟶ pullback f g
hfst : a ≫ fst f g = b ≫ fst f g
hsnd : a ≫ snd f g = b ≫ snd f g
z : (forget CompHaus).obj Z
⊢ a z = b z

Next tactic:
apply_fun (fun q => q z) at hfst hsnd
lemma pullback.hom_ext {Z : CompHaus.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b := by
  ext z
  apply_fun (fun q => q z) at hfst hsnd
  

Proof state:
case w
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a b : Z ⟶ pullback f g
z : (forget CompHaus).obj Z
hfst : (a ≫ fst f g) z = (b ≫ fst f g) z
hsnd : (a ≫ snd f g) z = (b ≫ snd f g) z
⊢ a z = b z

Next tactic:
apply Subtype.ext
lemma pullback.hom_ext {Z : CompHaus.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b := by
  ext z
  apply_fun (fun q => q z) at hfst hsnd
  apply Subtype.ext
  

Proof state:
case w.a
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a b : Z ⟶ pullback f g
z : (forget CompHaus).obj Z
hfst : (a ≫ fst f g) z = (b ≫ fst f g) z
hsnd : (a ≫ snd f g) z = (b ≫ snd f g) z
⊢ ↑(a z) = ↑(b z)

Next tactic:
apply Prod.ext
lemma pullback.hom_ext {Z : CompHaus.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b := by
  ext z
  apply_fun (fun q => q z) at hfst hsnd
  apply Subtype.ext
  apply Prod.ext
  · 

Proof state:
case w.a.a
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a b : Z ⟶ pullback f g
z : (forget CompHaus).obj Z
hfst : (a ≫ fst f g) z = (b ≫ fst f g) z
hsnd : (a ≫ snd f g) z = (b ≫ snd f g) z
⊢ (↑(a z)).1 = (↑(b z)).1

Next tactic:
exact hfst
lemma pullback.hom_ext {Z : CompHaus.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b := by
  ext z
  apply_fun (fun q => q z) at hfst hsnd
  apply Subtype.ext
  apply Prod.ext
  · exact hfst
  · 

Proof state:
case w.a.a
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
Z : CompHaus
a b : Z ⟶ pullback f g
z : (forget CompHaus).obj Z
hfst : (a ≫ fst f g) z = (b ≫ fst f g) z
hsnd : (a ≫ snd f g) z = (b ≫ snd f g) z
⊢ (↑(a z)).2 = (↑(b z)).2

Next tactic:
exact hsnd
theorem pullback_fst_eq :
    CompHaus.pullback.fst f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.fst := by
  

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
⊢ pullback.fst f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.fst

Next tactic:
dsimp [pullbackIsoPullback]
theorem pullback_fst_eq :
    CompHaus.pullback.fst f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.fst := by
  dsimp [pullbackIsoPullback]
  

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
⊢ pullback.fst f g =
    (IsLimit.conePointUniqueUpToIso (pullback.isLimit f g) (limit.isLimit (cospan f g))).hom ≫ Limits.pullback.fst

Next tactic:
simp only [Limits.limit.conePointUniqueUpToIso_hom_comp, pullback.cone_pt, pullback.cone_π]
theorem pullback_snd_eq :
    CompHaus.pullback.snd f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.snd := by
  

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
⊢ pullback.snd f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.snd

Next tactic:
dsimp [pullbackIsoPullback]
theorem pullback_snd_eq :
    CompHaus.pullback.snd f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.snd := by
  dsimp [pullbackIsoPullback]
  

Proof state:
X Y B : CompHaus
f : X ⟶ B
g : Y ⟶ B
⊢ pullback.snd f g =
    (IsLimit.conePointUniqueUpToIso (pullback.isLimit f g) (limit.isLimit (cospan f g))).hom ≫ Limits.pullback.snd

Next tactic:
simp only [Limits.limit.conePointUniqueUpToIso_hom_comp, pullback.cone_pt, pullback.cone_π]
/--
To construct a morphism from the explicit finite coproduct, it suffices to
specify a morphism from each of its factors.
This is essentially the universal property of the coproduct.
-/
def finiteCoproduct.desc {B : CompHaus.{u}} (e : (a : α) → (X a ⟶ B)) :
    finiteCoproduct X ⟶ B where
  toFun := fun ⟨a,x⟩ => e a x
  continuous_toFun := by
    

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
e : (a : α) → X a ⟶ B
⊢ Continuous fun x =>
    match x with
    | { fst := a, snd := x } => (e a) x

Next tactic:
apply continuous_sigma
/--
To construct a morphism from the explicit finite coproduct, it suffices to
specify a morphism from each of its factors.
This is essentially the universal property of the coproduct.
-/
def finiteCoproduct.desc {B : CompHaus.{u}} (e : (a : α) → (X a ⟶ B)) :
    finiteCoproduct X ⟶ B where
  toFun := fun ⟨a,x⟩ => e a x
  continuous_toFun := by
    apply continuous_sigma
    

Proof state:
case hf
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
e : (a : α) → X a ⟶ B
⊢ ∀ (i : α),
    Continuous fun a =>
      match { fst := i, snd := a } with
      | { fst := a, snd := x } => (e a) x

Next tactic:
intro a
/--
To construct a morphism from the explicit finite coproduct, it suffices to
specify a morphism from each of its factors.
This is essentially the universal property of the coproduct.
-/
def finiteCoproduct.desc {B : CompHaus.{u}} (e : (a : α) → (X a ⟶ B)) :
    finiteCoproduct X ⟶ B where
  toFun := fun ⟨a,x⟩ => e a x
  continuous_toFun := by
    apply continuous_sigma
    intro a; 

Proof state:
case hf
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
e : (a : α) → X a ⟶ B
a : α
⊢ Continuous fun a_1 =>
    match { fst := a, snd := a_1 } with
    | { fst := a, snd := x } => (e a) x

Next tactic:
exact (e a).continuous
lemma finiteCoproduct.hom_ext {B : CompHaus.{u}} (f g : finiteCoproduct X ⟶ B)
    (h : ∀ a : α, finiteCoproduct.ι X a ≫ f = finiteCoproduct.ι X a ≫ g) : f = g := by
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
f g : finiteCoproduct X ⟶ B
h : ∀ (a : α), ι X a ≫ f = ι X a ≫ g
⊢ f = g

Next tactic:
ext ⟨a,x⟩
lemma finiteCoproduct.hom_ext {B : CompHaus.{u}} (f g : finiteCoproduct X ⟶ B)
    (h : ∀ a : α, finiteCoproduct.ι X a ≫ f = finiteCoproduct.ι X a ≫ g) : f = g := by
  ext ⟨a,x⟩
  

Proof state:
case w.mk
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
f g : finiteCoproduct X ⟶ B
h : ∀ (a : α), ι X a ≫ f = ι X a ≫ g
a : α
x : ↑(X a).toTop
⊢ f { fst := a, snd := x } = g { fst := a, snd := x }

Next tactic:
specialize h a
lemma finiteCoproduct.hom_ext {B : CompHaus.{u}} (f g : finiteCoproduct X ⟶ B)
    (h : ∀ a : α, finiteCoproduct.ι X a ≫ f = finiteCoproduct.ι X a ≫ g) : f = g := by
  ext ⟨a,x⟩
  specialize h a
  

Proof state:
case w.mk
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
f g : finiteCoproduct X ⟶ B
a : α
x : ↑(X a).toTop
h : ι X a ≫ f = ι X a ≫ g
⊢ f { fst := a, snd := x } = g { fst := a, snd := x }

Next tactic:
apply_fun (fun q => q x) at h
lemma finiteCoproduct.hom_ext {B : CompHaus.{u}} (f g : finiteCoproduct X ⟶ B)
    (h : ∀ a : α, finiteCoproduct.ι X a ≫ f = finiteCoproduct.ι X a ≫ g) : f = g := by
  ext ⟨a,x⟩
  specialize h a
  apply_fun (fun q => q x) at h
  

Proof state:
case w.mk
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
f g : finiteCoproduct X ⟶ B
a : α
x : ↑(X a).toTop
h : (ι X a ≫ f) x = (ι X a ≫ g) x
⊢ f { fst := a, snd := x } = g { fst := a, snd := x }

Next tactic:
exact h
/--
The explicit finite coproduct cocone is a colimit cocone.
-/
@[simps]
def finiteCoproduct.isColimit : Limits.IsColimit (finiteCoproduct.cocone X) where
  desc := fun s => finiteCoproduct.desc _ fun a => s.ι.app ⟨a⟩
  fac := fun s ⟨a⟩ => finiteCoproduct.ι_desc _ _ _
  uniq := fun s m hm => finiteCoproduct.hom_ext _ _ _ fun a => by
    

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
s : Cocone (Discrete.functor X)
m : (cocone X).pt ⟶ s.pt
hm : ∀ (j : Discrete α), (cocone X).ι.app j ≫ m = s.ι.app j
a : α
⊢ ι (fun a => X a) a ≫ m = ι (fun a => X a) a ≫ (fun s => desc (fun a => X a) fun a => s.ι.app { as := a }) s

Next tactic:
specialize hm ⟨a⟩
/--
The explicit finite coproduct cocone is a colimit cocone.
-/
@[simps]
def finiteCoproduct.isColimit : Limits.IsColimit (finiteCoproduct.cocone X) where
  desc := fun s => finiteCoproduct.desc _ fun a => s.ι.app ⟨a⟩
  fac := fun s ⟨a⟩ => finiteCoproduct.ι_desc _ _ _
  uniq := fun s m hm => finiteCoproduct.hom_ext _ _ _ fun a => by
    specialize hm ⟨a⟩
    

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
s : Cocone (Discrete.functor X)
m : (cocone X).pt ⟶ s.pt
a : α
hm : (cocone X).ι.app { as := a } ≫ m = s.ι.app { as := a }
⊢ ι (fun a => X a) a ≫ m = ι (fun a => X a) a ≫ (fun s => desc (fun a => X a) fun a => s.ι.app { as := a }) s

Next tactic:
ext t
/--
The explicit finite coproduct cocone is a colimit cocone.
-/
@[simps]
def finiteCoproduct.isColimit : Limits.IsColimit (finiteCoproduct.cocone X) where
  desc := fun s => finiteCoproduct.desc _ fun a => s.ι.app ⟨a⟩
  fac := fun s ⟨a⟩ => finiteCoproduct.ι_desc _ _ _
  uniq := fun s m hm => finiteCoproduct.hom_ext _ _ _ fun a => by
    specialize hm ⟨a⟩
    ext t
    

Proof state:
case w
α : Type
inst✝ : Fintype α
X : α → CompHaus
s : Cocone (Discrete.functor X)
m : (cocone X).pt ⟶ s.pt
a : α
hm : (cocone X).ι.app { as := a } ≫ m = s.ι.app { as := a }
t : (forget CompHaus).obj (X a)
⊢ (ι (fun a => X a) a ≫ m) t = (ι (fun a => X a) a ≫ (fun s => desc (fun a => X a) fun a => s.ι.app { as := a }) s) t

Next tactic:
apply_fun (fun q => q t) at hm
/--
The explicit finite coproduct cocone is a colimit cocone.
-/
@[simps]
def finiteCoproduct.isColimit : Limits.IsColimit (finiteCoproduct.cocone X) where
  desc := fun s => finiteCoproduct.desc _ fun a => s.ι.app ⟨a⟩
  fac := fun s ⟨a⟩ => finiteCoproduct.ι_desc _ _ _
  uniq := fun s m hm => finiteCoproduct.hom_ext _ _ _ fun a => by
    specialize hm ⟨a⟩
    ext t
    apply_fun (fun q => q t) at hm
    

Proof state:
case w
α : Type
inst✝ : Fintype α
X : α → CompHaus
s : Cocone (Discrete.functor X)
m : (cocone X).pt ⟶ s.pt
a : α
t : (forget CompHaus).obj (X a)
hm : ((cocone X).ι.app { as := a } ≫ m) t = (s.ι.app { as := a }) t
⊢ (ι (fun a => X a) a ≫ m) t = (ι (fun a => X a) a ≫ (fun s => desc (fun a => X a) fun a => s.ι.app { as := a }) s) t

Next tactic:
exact hm
theorem Sigma.ι_comp_toFiniteCoproduct (a : α) :
    (Limits.Sigma.ι X a) ≫ (coproductIsoCoproduct X).inv = finiteCoproduct.ι X a := by
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
a : α
⊢ Sigma.ι X a ≫ (coproductIsoCoproduct X).inv = finiteCoproduct.ι X a

Next tactic:
dsimp [coproductIsoCoproduct]
theorem Sigma.ι_comp_toFiniteCoproduct (a : α) :
    (Limits.Sigma.ι X a) ≫ (coproductIsoCoproduct X).inv = finiteCoproduct.ι X a := by
  dsimp [coproductIsoCoproduct]
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
a : α
⊢ Sigma.ι X a ≫
      (IsColimit.coconePointUniqueUpToIso (finiteCoproduct.isColimit X) (colimit.isColimit (Discrete.functor X))).inv =
    finiteCoproduct.ι X a

Next tactic:
simp only [Limits.colimit.comp_coconePointUniqueUpToIso_inv, finiteCoproduct.cocone_pt,
    finiteCoproduct.cocone_ι, Discrete.natTrans_app]
lemma finiteCoproduct.ι_injective (a : α) : Function.Injective (finiteCoproduct.ι X a) := by
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
a : α
⊢ Function.Injective ⇑(ι X a)

Next tactic:
intro x y hxy
lemma finiteCoproduct.ι_injective (a : α) : Function.Injective (finiteCoproduct.ι X a) := by
  intro x y hxy
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
a : α
x y : (forget CompHaus).obj (X a)
hxy : (ι X a) x = (ι X a) y
⊢ x = y

Next tactic:
exact eq_of_heq (Sigma.ext_iff.mp hxy).2
lemma finiteCoproduct.ι_desc_apply {B : CompHaus} {π : (a : α) → X a ⟶ B} (a : α) :
    ∀ x, finiteCoproduct.desc X π (finiteCoproduct.ι X a x) = π a x := by
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
π : (a : α) → X a ⟶ B
a : α
⊢ ∀ (x : (forget CompHaus).obj (X a)), (desc X π) ((ι X a) x) = (π a) x

Next tactic:
intro x
lemma finiteCoproduct.ι_desc_apply {B : CompHaus} {π : (a : α) → X a ⟶ B} (a : α) :
    ∀ x, finiteCoproduct.desc X π (finiteCoproduct.ι X a x) = π a x := by
  intro x
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
π : (a : α) → X a ⟶ B
a : α
x : (forget CompHaus).obj (X a)
⊢ (desc X π) ((ι X a) x) = (π a) x

Next tactic:
change (ι X a ≫ desc X π) _ = _
lemma finiteCoproduct.ι_desc_apply {B : CompHaus} {π : (a : α) → X a ⟶ B} (a : α) :
    ∀ x, finiteCoproduct.desc X π (finiteCoproduct.ι X a x) = π a x := by
  intro x
  change (ι X a ≫ desc X π) _ = _
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
B : CompHaus
π : (a : α) → X a ⟶ B
a : α
x : (forget CompHaus).obj (X a)
⊢ (ι X a ≫ desc X π) x = (π a) x

Next tactic:
simp only [ι_desc]
instance : PreservesFiniteCoproducts compHausToTop := by
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
⊢ PreservesFiniteCoproducts compHausToTop

Next tactic:
refine ⟨fun J hJ ↦ ⟨fun {F} ↦ ?_⟩⟩
instance : PreservesFiniteCoproducts compHausToTop := by
  refine ⟨fun J hJ ↦ ⟨fun {F} ↦ ?_⟩⟩
  

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
J : Type
hJ : Fintype J
F : Discrete J ⥤ CompHaus
⊢ PreservesColimit F compHausToTop

Next tactic:
suffices : PreservesColimit (Discrete.functor (F.obj ∘ Discrete.mk)) compHausToTop
instance : PreservesFiniteCoproducts compHausToTop := by
  refine ⟨fun J hJ ↦ ⟨fun {F} ↦ ?_⟩⟩
  suffices : PreservesColimit (Discrete.functor (F.obj ∘ Discrete.mk)) compHausToTop
  · 

Proof state:
α : Type
inst✝ : Fintype α
X : α → CompHaus
J : Type
hJ : Fintype J
F : Discrete J ⥤ CompHaus
this : PreservesColimit (Discrete.functor (F.obj ∘ Discrete.mk)) compHausToTop
⊢ PreservesColimit F compHausToTop

Next tactic:
exact preservesColimitOfIsoDiagram _ Discrete.natIsoFunctor.symm
instance : PreservesFiniteCoproducts compHausToTop := by
  refine ⟨fun J hJ ↦ ⟨fun {F} ↦ ?_⟩⟩
  suffices : PreservesColimit (Discrete.functor (F.obj ∘ Discrete.mk)) compHausToTop
  · exact preservesColimitOfIsoDiagram _ Discrete.natIsoFunctor.symm
  

Proof state:
case this
α : Type
inst✝ : Fintype α
X : α → CompHaus
J : Type
hJ : Fintype J
F : Discrete J ⥤ CompHaus
⊢ PreservesColimit (Discrete.functor (F.obj ∘ Discrete.mk)) compHausToTop

Next tactic:
apply preservesColimitOfPreservesColimitCocone (CompHaus.finiteCoproduct.isColimit _)
instance : PreservesFiniteCoproducts compHausToTop := by
  refine ⟨fun J hJ ↦ ⟨fun {F} ↦ ?_⟩⟩
  suffices : PreservesColimit (Discrete.functor (F.obj ∘ Discrete.mk)) compHausToTop
  · exact preservesColimitOfIsoDiagram _ Discrete.natIsoFunctor.symm
  apply preservesColimitOfPreservesColimitCocone (CompHaus.finiteCoproduct.isColimit _)
  

Proof state:
case this
α : Type
inst✝ : Fintype α
X : α → CompHaus
J : Type
hJ : Fintype J
F : Discrete J ⥤ CompHaus
⊢ IsColimit (compHausToTop.mapCocone (finiteCoproduct.cocone (F.obj ∘ Discrete.mk)))

Next tactic:
exact TopCat.sigmaCofanIsColimit _
/-- A complete nontrivially normed field has cardinality at least continuum. -/
theorem continuum_le_cardinal_of_nontriviallyNormedField
    (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] : 𝔠 ≤ #𝕜 := by
  

Proof state:
𝕜 : Type u_1
inst✝¹ : NontriviallyNormedField 𝕜
inst✝ : CompleteSpace 𝕜
⊢ 𝔠 ≤ #𝕜

Next tactic:
suffices ∃ f : (ℕ → Bool) → 𝕜, range f ⊆ univ ∧ Continuous f ∧ Injective f by
    rcases this with ⟨f, -, -, f_inj⟩
    simpa using lift_mk_le_lift_mk_of_injective f_inj
/-- A complete nontrivially normed field has cardinality at least continuum. -/
theorem continuum_le_cardinal_of_nontriviallyNormedField
    (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] : 𝔠 ≤ #𝕜 := by
  suffices ∃ f : (ℕ → Bool) → 𝕜, range f ⊆ univ ∧ Continuous f ∧ Injective f by
    

Proof state:
𝕜 : Type u_1
inst✝¹ : NontriviallyNormedField 𝕜
inst✝ : CompleteSpace 𝕜
this : ∃ f, range f ⊆ Set.univ ∧ Continuous f ∧ Injective f
⊢ 𝔠 ≤ #𝕜

Next tactic:
rcases this with ⟨f, -, -, f_inj⟩
/-- A complete nontrivially normed field has cardinality at least continuum. -/
theorem continuum_le_cardinal_of_nontriviallyNormedField
    (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] : 𝔠 ≤ #𝕜 := by
  suffices ∃ f : (ℕ → Bool) → 𝕜, range f ⊆ univ ∧ Continuous f ∧ Injective f by
    rcases this with ⟨f, -, -, f_inj⟩
    

Proof state:
case intro.intro.intro
𝕜 : Type u_1
inst✝¹ : NontriviallyNormedField 𝕜
inst✝ : CompleteSpace 𝕜
f : (ℕ → Bool) → 𝕜
f_inj : Injective f
⊢ 𝔠 ≤ #𝕜

Next tactic:
simpa using lift_mk_le_lift_mk_of_injective f_inj
/-- A complete nontrivially normed field has cardinality at least continuum. -/
theorem continuum_le_cardinal_of_nontriviallyNormedField
    (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] : 𝔠 ≤ #𝕜 := by
  suffices ∃ f : (ℕ → Bool) → 𝕜, range f ⊆ univ ∧ Continuous f ∧ Injective f by
    rcases this with ⟨f, -, -, f_inj⟩
    simpa using lift_mk_le_lift_mk_of_injective f_inj
  

Proof state:
𝕜 : Type u_1
inst✝¹ : NontriviallyNormedField 𝕜
inst✝ : CompleteSpace 𝕜
⊢ ∃ f, range f ⊆ Set.univ ∧ Continuous f ∧ Injective f

Next tactic:
apply Perfect.exists_nat_bool_injection _ univ_nonempty
/-- A complete nontrivially normed field has cardinality at least continuum. -/
theorem continuum_le_cardinal_of_nontriviallyNormedField
    (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] : 𝔠 ≤ #𝕜 := by
  suffices ∃ f : (ℕ → Bool) → 𝕜, range f ⊆ univ ∧ Continuous f ∧ Injective f by
    rcases this with ⟨f, -, -, f_inj⟩
    simpa using lift_mk_le_lift_mk_of_injective f_inj
  apply Perfect.exists_nat_bool_injection _ univ_nonempty
  

Proof state:
𝕜 : Type u_1
inst✝¹ : NontriviallyNormedField 𝕜
inst✝ : CompleteSpace 𝕜
⊢ Perfect Set.univ

Next tactic:
refine ⟨isClosed_univ, preperfect_iff_nhds.2 (fun x _ U hU ↦ ?_)⟩
/-- A complete nontrivially normed field has cardinality at least continuum. -/
theorem continuum_le_cardinal_of_nontriviallyNormedField
    (𝕜 : Type*) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] : 𝔠 ≤ #𝕜 := by
  suffices ∃ f : (ℕ → Bool) → 𝕜, range f ⊆ univ ∧ Continuous f ∧ Injective f by
    rcases this with ⟨f, -, -, f_inj⟩
    simpa using lift_mk_le_lift_mk_of_injective f_inj
  apply Perfect.exists_nat_bool_injection _ univ_nonempty
  refine ⟨isClosed_univ, preperfect_iff_nhds.2 (fun x _ U hU ↦ ?_)⟩
  

Proof state:
𝕜 : Type u_1
inst✝¹ : NontriviallyNormedField 𝕜
inst✝ : CompleteSpace 𝕜
x : 𝕜
x✝ : x ∈ Set.univ
U : Set 𝕜
hU : U ∈ 𝓝 x
⊢ ∃ y ∈ U ∩ Set.univ, y ≠ x

Next tactic:
rcases NormedField.exists_norm_lt_one 𝕜 with ⟨c, c_pos, hc⟩