l3lab/ntp-mathlib huggingface dataset:
/-- The limit cone on `spanFunctor` with point `C`. -/
noncomputable
def spanCone [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] : Cone (spanFunctor hC) where
  pt := @Profinite.of C _ (by rwa [← isCompact_iff_compactSpace]) _ _
  π :=
  { app := fun s ↦ ⟨ProjRestrict C (· ∈ unop s), continuous_projRestrict _ _⟩
    naturality := by
      intro X Y h
      simp only [Functor.const_obj_obj, Homeomorph.setCongr, Homeomorph.homeomorph_mk_coe,
        Functor.const_obj_map, Category.id_comp, ← projRestricts_comp_projRestrict C
        (leOfHom h.unop)]
      

Proof state:
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
X Y : (Finset I)ᵒᵖ
h : X ⟶ Y
⊢ ContinuousMap.mk (ProjRestricts C (_ : Y.unop ≤ X.unop) ∘ ProjRestrict C fun i => i ∈ X.unop) =
    ContinuousMap.mk (ProjRestrict C fun x => x ∈ X.unop) ≫ (spanFunctor hC).map h

Next tactic:
rfl
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  

Proof state:
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
⊢ IsLimit (spanCone hC)

Next tactic:
refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · 

Proof state:
case refine_1
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
⊢ ∀ {X Y : (Finset I)ᵒᵖ} (f : X ⟶ Y),
    (spanFunctor hC).map f ≫
        ((fun s =>
              isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
            Y).hom =
      ((fun s =>
              isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
            X).hom ≫
        (indexFunctor hC).map f

Next tactic:
intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    

Proof state:
case refine_1
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s t : Finset I
f : { unop := t }.unop ≤ { unop := s }.unop
⊢ (spanFunctor hC).map { unop := { down := { down := f } } } ≫
      ((fun s =>
            isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
          { unop := t }).hom =
    ((fun s => isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
          { unop := s }).hom ≫
      (indexFunctor hC).map { unop := { down := { down := f } } }

Next tactic:
ext x
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    

Proof state:
case refine_1.w
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s t : Finset I
f : { unop := t }.unop ≤ { unop := s }.unop
x : (forget Profinite).obj ((spanFunctor hC).obj { unop := s })
⊢ ((spanFunctor hC).map { unop := { down := { down := f } } } ≫
        ((fun s =>
              isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
            { unop := t }).hom)
      x =
    (((fun s =>
              isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
            { unop := s }).hom ≫
        (indexFunctor hC).map { unop := { down := { down := f } } })
      x

Next tactic:
have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      

Proof state:
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s t : Finset I
f : { unop := t }.unop ≤ { unop := s }.unop
x : (forget Profinite).obj ((spanFunctor hC).obj { unop := s })
⊢ ⇑(iso_map C fun x => x ∈ t) ∘ ProjRestricts C f = ⇑(IndexFunctor.map C f) ∘ ⇑(iso_map C fun x => x ∈ s)

Next tactic:
ext _ i
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; 

Proof state:
case h.a.h
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s t : Finset I
f : { unop := t }.unop ≤ { unop := s }.unop
x : (forget Profinite).obj ((spanFunctor hC).obj { unop := s })
x✝ : ↑(π C fun i => i ∈ { unop := s }.unop)
i : { i // i ∈ t }
⊢ ↑((⇑(iso_map C fun x => x ∈ t) ∘ ProjRestricts C f) x✝) i =
    ↑((⇑(IndexFunctor.map C f) ∘ ⇑(iso_map C fun x => x ∈ s)) x✝) i

Next tactic:
exact dif_pos i.prop
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    

Proof state:
case refine_1.w
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s t : Finset I
f : { unop := t }.unop ≤ { unop := s }.unop
x : (forget Profinite).obj ((spanFunctor hC).obj { unop := s })
this : ⇑(iso_map C fun x => x ∈ t) ∘ ProjRestricts C f = ⇑(IndexFunctor.map C f) ∘ ⇑(iso_map C fun x => x ∈ s)
⊢ ((spanFunctor hC).map { unop := { down := { down := f } } } ≫
        ((fun s =>
              isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
            { unop := t }).hom)
      x =
    (((fun s =>
              isoOfBijective (iso_map C fun x => x ∈ s.unop) (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop)))
            { unop := s }).hom ≫
        (indexFunctor hC).map { unop := { down := { down := f } } })
      x

Next tactic:
exact congr_fun this x
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    exact congr_fun this x
  · 

Proof state:
case refine_2
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
⊢ ∀ (j : (Finset I)ᵒᵖ),
    (indexCone hC).π.app j =
      (Iso.refl (indexCone hC).pt).hom ≫
        ((Cones.postcompose
                    (NatIso.ofComponents fun s =>
                        isoOfBijective (iso_map C fun x => x ∈ s.unop)
                          (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop))).hom).obj
                (spanCone hC)).π.app
          j

Next tactic:
intro ⟨s⟩
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    exact congr_fun this x
  · intro ⟨s⟩
    

Proof state:
case refine_2
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s : Finset I
⊢ (indexCone hC).π.app { unop := s } =
    (Iso.refl (indexCone hC).pt).hom ≫
      ((Cones.postcompose
                  (NatIso.ofComponents fun s =>
                      isoOfBijective (iso_map C fun x => x ∈ s.unop)
                        (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop))).hom).obj
              (spanCone hC)).π.app
        { unop := s }

Next tactic:
ext x
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    exact congr_fun this x
  · intro ⟨s⟩
    ext x
    

Proof state:
case refine_2.w
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s : Finset I
x : (forget Profinite).obj (((Functor.const (Finset I)ᵒᵖ).obj (indexCone hC).pt).obj { unop := s })
⊢ ((indexCone hC).π.app { unop := s }) x =
    ((Iso.refl (indexCone hC).pt).hom ≫
        ((Cones.postcompose
                    (NatIso.ofComponents fun s =>
                        isoOfBijective (iso_map C fun x => x ∈ s.unop)
                          (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop))).hom).obj
                (spanCone hC)).π.app
          { unop := s })
      x

Next tactic:
have : iso_map C (· ∈ s) ∘ ProjRestrict C (· ∈ s) = IndexFunctor.π_app C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    exact congr_fun this x
  · intro ⟨s⟩
    ext x
    have : iso_map C (· ∈ s) ∘ ProjRestrict C (· ∈ s) = IndexFunctor.π_app C (· ∈ s) := by
      

Proof state:
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s : Finset I
x : (forget Profinite).obj (((Functor.const (Finset I)ᵒᵖ).obj (indexCone hC).pt).obj { unop := s })
⊢ (⇑(iso_map C fun x => x ∈ s) ∘ ProjRestrict C fun x => x ∈ s) = ⇑(IndexFunctor.π_app C fun x => x ∈ s)

Next tactic:
ext _ i
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    exact congr_fun this x
  · intro ⟨s⟩
    ext x
    have : iso_map C (· ∈ s) ∘ ProjRestrict C (· ∈ s) = IndexFunctor.π_app C (· ∈ s) := by
      ext _ i; 

Proof state:
case h.a.h
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s : Finset I
x : (forget Profinite).obj (((Functor.const (Finset I)ᵒᵖ).obj (indexCone hC).pt).obj { unop := s })
x✝ : ↑C
i : { i // i ∈ s }
⊢ ↑((⇑(iso_map C fun x => x ∈ s) ∘ ProjRestrict C fun x => x ∈ s) x✝) i = ↑((IndexFunctor.π_app C fun x => x ∈ s) x✝) i

Next tactic:
exact dif_pos i.prop
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    exact congr_fun this x
  · intro ⟨s⟩
    ext x
    have : iso_map C (· ∈ s) ∘ ProjRestrict C (· ∈ s) = IndexFunctor.π_app C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    

Proof state:
case refine_2.w
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s : Finset I
x : (forget Profinite).obj (((Functor.const (Finset I)ᵒᵖ).obj (indexCone hC).pt).obj { unop := s })
this : (⇑(iso_map C fun x => x ∈ s) ∘ ProjRestrict C fun x => x ∈ s) = ⇑(IndexFunctor.π_app C fun x => x ∈ s)
⊢ ((indexCone hC).π.app { unop := s }) x =
    ((Iso.refl (indexCone hC).pt).hom ≫
        ((Cones.postcompose
                    (NatIso.ofComponents fun s =>
                        isoOfBijective (iso_map C fun x => x ∈ s.unop)
                          (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop))).hom).obj
                (spanCone hC)).π.app
          { unop := s })
      x

Next tactic:
erw [← this]
/-- `spanCone` is a limit cone. -/
noncomputable
def spanCone_isLimit [∀ (s : Finset I) (i : I), Decidable (i ∈ s)] :
    CategoryTheory.Limits.IsLimit (spanCone hC) := by
  refine (IsLimit.postcomposeHomEquiv (NatIso.ofComponents
    (fun s ↦ (Profinite.isoOfBijective _ (iso_map_bijective C (· ∈ unop s)))) ?_) (spanCone hC))
    (IsLimit.ofIsoLimit (indexCone_isLimit hC) (Cones.ext (Iso.refl _) ?_))
  · intro ⟨s⟩ ⟨t⟩ ⟨⟨⟨f⟩⟩⟩
    ext x
    have : iso_map C (· ∈ t) ∘ ProjRestricts C f = IndexFunctor.map C f ∘ iso_map C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    exact congr_fun this x
  · intro ⟨s⟩
    ext x
    have : iso_map C (· ∈ s) ∘ ProjRestrict C (· ∈ s) = IndexFunctor.π_app C (· ∈ s) := by
      ext _ i; exact dif_pos i.prop
    erw [← this]
    

Proof state:
case refine_2.w
I : Type u
inst✝⁶ : Inhabited I
inst✝⁵ : LinearOrder I
inst✝⁴ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
J K L : I → Prop
inst✝³ : (i : I) → Decidable (J i)
inst✝² : (i : I) → Decidable (K i)
inst✝¹ : (i : I) → Decidable (L i)
hC : IsCompact C
inst✝ : (s : Finset I) → (i : I) → Decidable (i ∈ s)
s : Finset I
x : (forget Profinite).obj (((Functor.const (Finset I)ᵒᵖ).obj (indexCone hC).pt).obj { unop := s })
this : (⇑(iso_map C fun x => x ∈ s) ∘ ProjRestrict C fun x => x ∈ s) = ⇑(IndexFunctor.π_app C fun x => x ∈ s)
⊢ (⇑(iso_map C fun x => x ∈ s) ∘ ProjRestrict C fun x => x ∈ s) x =
    ((Iso.refl (indexCone hC).pt).hom ≫
        ((Cones.postcompose
                    (NatIso.ofComponents fun s =>
                        isoOfBijective (iso_map C fun x => x ∈ s.unop)
                          (_ : Function.Bijective ⇑(iso_map C fun x => x ∈ s.unop))).hom).obj
                (spanCone hC)).π.app
          { unop := s })
      x

Next tactic:
rfl
/--
`e C i` is the locally constant map from `C : Set (I → Bool)` to `ℤ` sending `f` to 1 if
`f.val i = true`, and 0 otherwise.
-/
def e (i : I) : LocallyConstant C ℤ where
  toFun := fun f ↦ (if f.val i then 1 else 0)
  isLocallyConstant := by
    

Proof state:
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
i : I
⊢ IsLocallyConstant fun f => if ↑f i = true then 1 else 0

Next tactic:
rw [IsLocallyConstant.iff_continuous]
/--
`e C i` is the locally constant map from `C : Set (I → Bool)` to `ℤ` sending `f` to 1 if
`f.val i = true`, and 0 otherwise.
-/
def e (i : I) : LocallyConstant C ℤ where
  toFun := fun f ↦ (if f.val i then 1 else 0)
  isLocallyConstant := by
    rw [IsLocallyConstant.iff_continuous]
    

Proof state:
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
i : I
⊢ Continuous fun f => if ↑f i = true then 1 else 0

Next tactic:
exact (continuous_of_discreteTopology (f := fun (a : Bool) ↦ (if a then (1 : ℤ) else 0))).comp
      ((continuous_apply i).comp continuous_subtype_val)
@[simp]
theorem lt_iff_lex_lt (l m : Products I) : l < m ↔ List.Lex (·<·) l.val m.val := by
  

Proof state:
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
l m : Products I
⊢ l < m ↔ List.Lex (fun x x_1 => x < x_1) ↑l ↑m

Next tactic:
cases l
@[simp]
theorem lt_iff_lex_lt (l m : Products I) : l < m ↔ List.Lex (·<·) l.val m.val := by
  cases l; 

Proof state:
case mk
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
m : Products I
val✝ : List I
property✝ : List.Chain' (fun x x_1 => x > x_1) val✝
⊢ { val := val✝, property := property✝ } < m ↔
    List.Lex (fun x x_1 => x < x_1) ↑{ val := val✝, property := property✝ } ↑m

Next tactic:
cases m
@[simp]
theorem lt_iff_lex_lt (l m : Products I) : l < m ↔ List.Lex (·<·) l.val m.val := by
  cases l; cases m; 

Proof state:
case mk.mk
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
val✝¹ : List I
property✝¹ : List.Chain' (fun x x_1 => x > x_1) val✝¹
val✝ : List I
property✝ : List.Chain' (fun x x_1 => x > x_1) val✝
⊢ { val := val✝¹, property := property✝¹ } < { val := val✝, property := property✝ } ↔
    List.Lex (fun x x_1 => x < x_1) ↑{ val := val✝¹, property := property✝¹ } ↑{ val := val✝, property := property✝ }

Next tactic:
rw [Subtype.mk_lt_mk]
@[simp]
theorem lt_iff_lex_lt (l m : Products I) : l < m ↔ List.Lex (·<·) l.val m.val := by
  cases l; cases m; rw [Subtype.mk_lt_mk]; 

Proof state:
case mk.mk
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
val✝¹ : List I
property✝¹ : List.Chain' (fun x x_1 => x > x_1) val✝¹
val✝ : List I
property✝ : List.Chain' (fun x x_1 => x > x_1) val✝
⊢ val✝¹ < val✝ ↔
    List.Lex (fun x x_1 => x < x_1) ↑{ val := val✝¹, property := property✝¹ } ↑{ val := val✝, property := property✝ }

Next tactic:
exact Iff.rfl
instance : IsWellFounded (Products I) (·<·) := by
  

Proof state:
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
⊢ IsWellFounded (Products I) fun x x_1 => x < x_1

Next tactic:
have : (· < · : Products I → _ → _) = (fun l m ↦ List.Lex (·<·) l.val m.val) := by
    ext; exact lt_iff_lex_lt _ _
instance : IsWellFounded (Products I) (·<·) := by
  have : (· < · : Products I → _ → _) = (fun l m ↦ List.Lex (·<·) l.val m.val) := by
    

Proof state:
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
⊢ (fun x x_1 => x < x_1) = fun l m => List.Lex (fun x x_1 => x < x_1) ↑l ↑m

Next tactic:
ext