l3lab/ntp-mathlib huggingface dataset:
theorem closure.isSubfield : IsSubfield (closure S) :=
  { closure.isSubmonoid with
    add_mem := by
      intro a b ha hb
      rcases id ha with ⟨p, hp, q, hq, rfl⟩
      rcases id hb with ⟨r, hr, s, hs, rfl⟩
      by_cases hq0 : q = 0
      · rwa [hq0, div_zero, zero_add]
      by_cases hs0 : s = 0
      · rwa [hs0, div_zero, add_zero]
      exact ⟨p * s + q * r,
        IsAddSubmonoid.add_mem Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hp hs)
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hr),
        q * s, Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hs, (div_add_div p r hq0 hs0).symm⟩
    zero_mem := ring_closure_subset Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid.zero_mem
    neg_mem := by
      

Proof state:
F : Type u_1
inst✝ : Field F
S : Set F
src✝ : IsSubmonoid (closure S) := isSubmonoid
⊢ ∀ {a : F}, a ∈ closure S → -a ∈ closure S

Next tactic:
rintro _ ⟨p, hp, q, hq, rfl⟩
theorem closure.isSubfield : IsSubfield (closure S) :=
  { closure.isSubmonoid with
    add_mem := by
      intro a b ha hb
      rcases id ha with ⟨p, hp, q, hq, rfl⟩
      rcases id hb with ⟨r, hr, s, hs, rfl⟩
      by_cases hq0 : q = 0
      · rwa [hq0, div_zero, zero_add]
      by_cases hs0 : s = 0
      · rwa [hs0, div_zero, add_zero]
      exact ⟨p * s + q * r,
        IsAddSubmonoid.add_mem Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hp hs)
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hr),
        q * s, Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hs, (div_add_div p r hq0 hs0).symm⟩
    zero_mem := ring_closure_subset Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid.zero_mem
    neg_mem := by
      rintro _ ⟨p, hp, q, hq, rfl⟩
      

Proof state:
case intro.intro.intro.intro
F : Type u_1
inst✝ : Field F
S : Set F
src✝ : IsSubmonoid (closure S) := isSubmonoid
p : F
hp : p ∈ Ring.closure S
q : F
hq : q ∈ Ring.closure S
⊢ -(p / q) ∈ closure S

Next tactic:
exact ⟨-p, Ring.closure.isSubring.toIsAddSubgroup.neg_mem hp, q, hq, neg_div q p⟩
theorem closure.isSubfield : IsSubfield (closure S) :=
  { closure.isSubmonoid with
    add_mem := by
      intro a b ha hb
      rcases id ha with ⟨p, hp, q, hq, rfl⟩
      rcases id hb with ⟨r, hr, s, hs, rfl⟩
      by_cases hq0 : q = 0
      · rwa [hq0, div_zero, zero_add]
      by_cases hs0 : s = 0
      · rwa [hs0, div_zero, add_zero]
      exact ⟨p * s + q * r,
        IsAddSubmonoid.add_mem Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hp hs)
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hr),
        q * s, Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hs, (div_add_div p r hq0 hs0).symm⟩
    zero_mem := ring_closure_subset Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid.zero_mem
    neg_mem := by
      rintro _ ⟨p, hp, q, hq, rfl⟩
      exact ⟨-p, Ring.closure.isSubring.toIsAddSubgroup.neg_mem hp, q, hq, neg_div q p⟩
    inv_mem := by
      

Proof state:
F : Type u_1
inst✝ : Field F
S : Set F
src✝ : IsSubmonoid (closure S) := isSubmonoid
⊢ ∀ {x : F}, x ∈ closure S → x⁻¹ ∈ closure S

Next tactic:
rintro _ ⟨p, hp, q, hq, rfl⟩
theorem closure.isSubfield : IsSubfield (closure S) :=
  { closure.isSubmonoid with
    add_mem := by
      intro a b ha hb
      rcases id ha with ⟨p, hp, q, hq, rfl⟩
      rcases id hb with ⟨r, hr, s, hs, rfl⟩
      by_cases hq0 : q = 0
      · rwa [hq0, div_zero, zero_add]
      by_cases hs0 : s = 0
      · rwa [hs0, div_zero, add_zero]
      exact ⟨p * s + q * r,
        IsAddSubmonoid.add_mem Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hp hs)
          (Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hr),
        q * s, Ring.closure.isSubring.toIsSubmonoid.mul_mem hq hs, (div_add_div p r hq0 hs0).symm⟩
    zero_mem := ring_closure_subset Ring.closure.isSubring.toIsAddSubgroup.toIsAddSubmonoid.zero_mem
    neg_mem := by
      rintro _ ⟨p, hp, q, hq, rfl⟩
      exact ⟨-p, Ring.closure.isSubring.toIsAddSubgroup.neg_mem hp, q, hq, neg_div q p⟩
    inv_mem := by
      rintro _ ⟨p, hp, q, hq, rfl⟩
      

Proof state:
case intro.intro.intro.intro
F : Type u_1
inst✝ : Field F
S : Set F
src✝ : IsSubmonoid (closure S) := isSubmonoid
p : F
hp : p ∈ Ring.closure S
q : F
hq : q ∈ Ring.closure S
⊢ (p / q)⁻¹ ∈ closure S

Next tactic:
exact ⟨q, hq, p, hp, (inv_div _ _).symm⟩
theorem closure_subset {T : Set F} (hT : IsSubfield T) (H : S ⊆ T) : closure S ⊆ T := by
  

Proof state:
F : Type u_1
inst✝ : Field F
S T : Set F
hT : IsSubfield T
H : S ⊆ T
⊢ closure S ⊆ T

Next tactic:
rintro _ ⟨p, hp, q, hq, hq0, rfl⟩
theorem closure_subset {T : Set F} (hT : IsSubfield T) (H : S ⊆ T) : closure S ⊆ T := by
  rintro _ ⟨p, hp, q, hq, hq0, rfl⟩
  

Proof state:
case intro.intro.intro.intro.refl
F : Type u_1
inst✝ : Field F
S T : Set F
hT : IsSubfield T
H : S ⊆ T
p : F
hp : p ∈ Ring.closure S
q : F
hq : q ∈ Ring.closure S
⊢ p / q ∈ T

Next tactic:
exact hT.div_mem (Ring.closure_subset hT.toIsSubring H hp)
    (Ring.closure_subset hT.toIsSubring H hq)
instance (x : SimplexCategory) : Fintype (CategoryTheory.ConcreteCategory.forget.obj x) := by
  

Proof state:
x : SimplexCategory
⊢ Fintype (ConcreteCategory.forget.obj x)

Next tactic:
change (Fintype (Fin _))
instance (x : SimplexCategory) : Fintype (CategoryTheory.ConcreteCategory.forget.obj x) := by
  change (Fintype (Fin _))
  

Proof state:
x : SimplexCategory
⊢ Fintype (Fin (len x + 1))

Next tactic:
infer_instance
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
⊢ (fun i => ∑ j in Finset.filter (fun k => f k = i) Finset.univ, ↑g j) ∈ toTopObj y

Next tactic:
simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
⊢ ∑ i : (forget SimplexCategory).obj y, ∑ x_1 in Finset.filter (fun k => f k = i) Finset.univ, ↑g x_1 = 1

Next tactic:
rw [← Finset.sum_biUnion]
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
⊢ ∑ x_1 in Finset.biUnion Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ, ↑g x_1 = 1
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
⊢ Set.PairwiseDisjoint ↑Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ

Next tactic:
have hg := g.2
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
hg : ↑g ∈ toTopObj x
⊢ ∑ x_1 in Finset.biUnion Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ, ↑g x_1 = 1
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
⊢ Set.PairwiseDisjoint ↑Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ

Next tactic:
dsimp [toTopObj] at hg
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
hg : ∑ i : (forget SimplexCategory).obj x, ↑g i = 1
⊢ ∑ x_1 in Finset.biUnion Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ, ↑g x_1 = 1
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
⊢ Set.PairwiseDisjoint ↑Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ

Next tactic:
convert hg
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · 

Proof state:
case h.e'_2.h
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
hg : ∑ i : (forget SimplexCategory).obj x, ↑g i = 1
⊢ (Finset.biUnion Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ) = Finset.univ

Next tactic:
simp [Finset.eq_univ_iff_forall]
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · simp [Finset.eq_univ_iff_forall]
    · 

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
⊢ Set.PairwiseDisjoint ↑Finset.univ fun i => Finset.filter (fun k => f k = i) Finset.univ

Next tactic:
intro i _ j _ h
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · simp [Finset.eq_univ_iff_forall]
    · intro i _ j _ h
      

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
i : (forget SimplexCategory).obj y
a✝¹ : i ∈ ↑Finset.univ
j : (forget SimplexCategory).obj y
a✝ : j ∈ ↑Finset.univ
h : i ≠ j
⊢ (Disjoint on fun i => Finset.filter (fun k => f k = i) Finset.univ) i j

Next tactic:
rw [Function.onFun, disjoint_iff_inf_le]
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · simp [Finset.eq_univ_iff_forall]
    · intro i _ j _ h
      rw [Function.onFun, disjoint_iff_inf_le]
      

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
i : (forget SimplexCategory).obj y
a✝¹ : i ∈ ↑Finset.univ
j : (forget SimplexCategory).obj y
a✝ : j ∈ ↑Finset.univ
h : i ≠ j
⊢ Finset.filter (fun k => f k = i) Finset.univ ⊓ Finset.filter (fun k => f k = j) Finset.univ ≤ ⊥

Next tactic:
intro e he
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · simp [Finset.eq_univ_iff_forall]
    · intro i _ j _ h
      rw [Function.onFun, disjoint_iff_inf_le]
      intro e he
      

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
i : (forget SimplexCategory).obj y
a✝¹ : i ∈ ↑Finset.univ
j : (forget SimplexCategory).obj y
a✝ : j ∈ ↑Finset.univ
h : i ≠ j
e : (forget SimplexCategory).obj x
he : e ∈ Finset.filter (fun k => f k = i) Finset.univ ⊓ Finset.filter (fun k => f k = j) Finset.univ
⊢ e ∈ ⊥

Next tactic:
simp only [Finset.bot_eq_empty, Finset.not_mem_empty]
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · simp [Finset.eq_univ_iff_forall]
    · intro i _ j _ h
      rw [Function.onFun, disjoint_iff_inf_le]
      intro e he
      simp only [Finset.bot_eq_empty, Finset.not_mem_empty]
      

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
i : (forget SimplexCategory).obj y
a✝¹ : i ∈ ↑Finset.univ
j : (forget SimplexCategory).obj y
a✝ : j ∈ ↑Finset.univ
h : i ≠ j
e : (forget SimplexCategory).obj x
he : e ∈ Finset.filter (fun k => f k = i) Finset.univ ⊓ Finset.filter (fun k => f k = j) Finset.univ
⊢ False

Next tactic:
apply h
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · simp [Finset.eq_univ_iff_forall]
    · intro i _ j _ h
      rw [Function.onFun, disjoint_iff_inf_le]
      intro e he
      simp only [Finset.bot_eq_empty, Finset.not_mem_empty]
      apply h
      

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
i : (forget SimplexCategory).obj y
a✝¹ : i ∈ ↑Finset.univ
j : (forget SimplexCategory).obj y
a✝ : j ∈ ↑Finset.univ
h : i ≠ j
e : (forget SimplexCategory).obj x
he : e ∈ Finset.filter (fun k => f k = i) Finset.univ ⊓ Finset.filter (fun k => f k = j) Finset.univ
⊢ i = j

Next tactic:
simp only [Finset.mem_univ, forall_true_left,
        ge_iff_le, Finset.le_eq_subset, Finset.inf_eq_inter, Finset.mem_inter,
        Finset.mem_filter, true_and] at he
/-- A morphism in `SimplexCategory` induces a map on the associated topological spaces. -/
def toTopMap {x y : SimplexCategory} (f : x ⟶ y) : x.toTopObj → y.toTopObj := fun g =>
  ⟨fun i => ∑ j in Finset.univ.filter fun k => f k = i, g j, by
    simp only [Finset.sum_congr, toTopObj, Set.mem_setOf]
    rw [← Finset.sum_biUnion]
    have hg := g.2
    dsimp [toTopObj] at hg
    convert hg
    · simp [Finset.eq_univ_iff_forall]
    · intro i _ j _ h
      rw [Function.onFun, disjoint_iff_inf_le]
      intro e he
      simp only [Finset.bot_eq_empty, Finset.not_mem_empty]
      apply h
      simp only [Finset.mem_univ, forall_true_left,
        ge_iff_le, Finset.le_eq_subset, Finset.inf_eq_inter, Finset.mem_inter,
        Finset.mem_filter, true_and] at he
      

Proof state:
x y : SimplexCategory
f : x ⟶ y
g : ↑(toTopObj x)
i : (forget SimplexCategory).obj y
a✝¹ : i ∈ ↑Finset.univ
j : (forget SimplexCategory).obj y
a✝ : j ∈ ↑Finset.univ
h : i ≠ j
e : (forget SimplexCategory).obj x
he : f e = i ∧ f e = j
⊢ i = j

Next tactic:
rw [← he.1, he.2]
@[continuity]
theorem continuous_toTopMap {x y : SimplexCategory} (f : x ⟶ y) : Continuous (toTopMap f) := by
  

Proof state:
x y : SimplexCategory
f : x ⟶ y
⊢ Continuous (toTopMap f)

Next tactic:
refine' Continuous.subtype_mk (continuous_pi fun i => _) _
@[continuity]
theorem continuous_toTopMap {x y : SimplexCategory} (f : x ⟶ y) : Continuous (toTopMap f) := by
  refine' Continuous.subtype_mk (continuous_pi fun i => _) _
  

Proof state:
x y : SimplexCategory
f : x ⟶ y
i : (forget SimplexCategory).obj y
⊢ Continuous fun a => ∑ j in Finset.filter (fun k => f k = i) Finset.univ, ↑a j

Next tactic:
dsimp only [coe_toTopMap]
@[continuity]
theorem continuous_toTopMap {x y : SimplexCategory} (f : x ⟶ y) : Continuous (toTopMap f) := by
  refine' Continuous.subtype_mk (continuous_pi fun i => _) _
  dsimp only [coe_toTopMap]
  

Proof state:
x y : SimplexCategory
f : x ⟶ y
i : (forget SimplexCategory).obj y
⊢ Continuous fun a => ∑ j in Finset.filter (fun k => f k = i) Finset.univ, ↑a j

Next tactic:
exact continuous_finset_sum _ (fun j _ => (continuous_apply _).comp continuous_subtype_val)
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by 

Proof state:
X✝ Y✝ : SimplexCategory
f : X✝ ⟶ Y✝
⊢ Continuous (toTopMap f)

Next tactic:
continuity
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    

Proof state:
⊢ ∀ (X : SimplexCategory),
    { obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (𝟙 X) =
      𝟙 ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj X)

Next tactic:
intro Δ
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    

Proof state:
Δ : SimplexCategory
⊢ { obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (𝟙 Δ) =
    𝟙 ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)

Next tactic:
ext f
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    ext f
    

Proof state:
case w
Δ : SimplexCategory
f :
  (forget TopCat).obj
    ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)
⊢ ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (𝟙 Δ)) f =
    (𝟙 ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)) f

Next tactic:
apply toTopObj.ext
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    ext f
    apply toTopObj.ext
    

Proof state:
case w.a
Δ : SimplexCategory
f :
  (forget TopCat).obj
    ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)
⊢ ↑(({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (𝟙 Δ)) f) =
    ↑((𝟙 ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)) f)

Next tactic:
funext i
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    ext f
    apply toTopObj.ext
    funext i
    

Proof state:
case w.a.h
Δ : SimplexCategory
f :
  (forget TopCat).obj
    ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)
i : (forget SimplexCategory).obj Δ
⊢ ↑(({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (𝟙 Δ)) f) i =
    ↑((𝟙 ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)) f) i

Next tactic:
change (Finset.univ.filter fun k => k = i).sum _ = _
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    ext f
    apply toTopObj.ext
    funext i
    change (Finset.univ.filter fun k => k = i).sum _ = _
    

Proof state:
case w.a.h
Δ : SimplexCategory
f :
  (forget TopCat).obj
    ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)
i : (forget SimplexCategory).obj Δ
⊢ ∑ j in Finset.filter (fun k => k = i) Finset.univ, ↑f j =
    ↑((𝟙 ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj Δ)) f) i

Next tactic:
simp [Finset.sum_filter, CategoryTheory.id_apply]
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    ext f
    apply toTopObj.ext
    funext i
    change (Finset.univ.filter fun k => k = i).sum _ = _
    simp [Finset.sum_filter, CategoryTheory.id_apply]
  map_comp := fun f g => by
    

Proof state:
X✝ Y✝ Z✝ : SimplexCategory
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
⊢ { obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (f ≫ g) =
    { obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map f ≫
      { obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map g

Next tactic:
ext h
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    ext f
    apply toTopObj.ext
    funext i
    change (Finset.univ.filter fun k => k = i).sum _ = _
    simp [Finset.sum_filter, CategoryTheory.id_apply]
  map_comp := fun f g => by
    ext h
    

Proof state:
case w
X✝ Y✝ Z✝ : SimplexCategory
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
h :
  (forget TopCat).obj
    ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj X✝)
⊢ ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (f ≫ g)) h =
    ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map f ≫
        { obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map g)
      h

Next tactic:
apply toTopObj.ext
/-- The functor associating the topological `n`-simplex to `[n] : SimplexCategory`. -/
@[simps]
def toTop : SimplexCategory ⥤ TopCat where
  obj x := TopCat.of x.toTopObj
  map f := ⟨toTopMap f, by continuity⟩
  map_id := by
    intro Δ
    ext f
    apply toTopObj.ext
    funext i
    change (Finset.univ.filter fun k => k = i).sum _ = _
    simp [Finset.sum_filter, CategoryTheory.id_apply]
  map_comp := fun f g => by
    ext h
    apply toTopObj.ext
    

Proof state:
case w.a
X✝ Y✝ Z✝ : SimplexCategory
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
h :
  (forget TopCat).obj
    ({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.obj X✝)
⊢ ↑(({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map (f ≫ g)) h) =
    ↑(({ obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map f ≫
          { obj := fun x => TopCat.of ↑(toTopObj x), map := fun {X Y} f => ContinuousMap.mk (toTopMap f) }.map g)
        h)

Next tactic:
funext i