File: Mathlib/CategoryTheory/Galois/Decomposition.lean

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.has_decomp_connected_components_aux_conn
code: /-- The trivial case if `X` is connected. -/
private lemma has_decomp_connected_components_aux_conn (X : C) [IsConnected X] :
    ∃ (ι : Type) (f : ι → C) (g : (i : ι) → (f i) ⟶ X) (_ : IsColimit (Cofan.mk X g)),
    (∀ i, IsConnected (f i)) ∧ Finite ι 
goal: ∃ ι f g x, (∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)) ∧ Finite ι

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.has_decomp_connected_components_aux_initial
code: /-- The trivial case if `X` is initial. -/
private lemma has_decomp_connected_components_aux_initial (X : C) (h : IsInitial X) :
    ∃ (ι : Type) (f : ι → C) (g : (i : ι) → (f i) ⟶ X) (_ : IsColimit (Cofan.mk X g)),
    (∀ i, IsConnected (f i)) ∧ Finite ι 
goal: ∃ ι f g x, (∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)) ∧ Finite ι

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.has_decomp_connected_components_aux
code: private lemma has_decomp_connected_components_aux (F : C ⥤ FintypeCat.{w}) [FiberFunctor F]
    (n : ℕ) : ∀ (X : C), n = Nat.card (F.obj X) → ∃ (ι : Type) (f : ι → C)
    (g : (i : ι) → (f i) ⟶ X) (_ : IsColimit (Cofan.mk X g)),
    (∀ i, IsConnected (f i)) ∧ Finite ι 
goal: n = Nat.card ↑(F.obj X) → ∃ ι f g x, (∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)) ∧ Finite ι

full_name: CategoryTheory.PreGaloisCategory.has_decomp_connected_components
code: /-- In a Galois category, every object is the sum of connected objects. -/
theorem has_decomp_connected_components (X : C) :
    ∃ (ι : Type) (f : ι → C) (g : (i : ι) → f i ⟶ X) (_ : IsColimit (Cofan.mk X g)),
      (∀ i, IsConnected (f i)) ∧ Finite ι 
goal: ∃ ι f g x, (∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)) ∧ Finite ι

full_name: CategoryTheory.PreGaloisCategory.has_decomp_connected_components'
code: /-- In a Galois category, every object is the sum of connected objects. -/
theorem has_decomp_connected_components' (X : C) :
    ∃ (ι : Type) (_ : Finite ι) (f : ι → C) (_ : ∐ f ≅ X), ∀ i, IsConnected (f i) 
goal: ∃ ι, ∃ (x : Finite ι), ∃ f x, ∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)

full_name: CategoryTheory.PreGaloisCategory.fiber_in_connected_component
code: /-- Every element in the fiber of `X` lies in some connected component of `X`. -/
lemma fiber_in_connected_component (X : C) (x : F.obj X) : ∃ (Y : C) (i : Y ⟶ X) (y : F.obj Y),
    F.map i y = x ∧ IsConnected Y ∧ Mono i 
goal: ∃ Y i y, F.map i y = x ∧ CategoryTheory.PreGaloisCategory.IsConnected Y ∧ CategoryTheory.Mono i

full_name: CategoryTheory.PreGaloisCategory.connected_component_unique
code: /-- Up to isomorphism an element of the fiber of `X` only lies in one connected component. -/
lemma connected_component_unique {X A B : C} [IsConnected A] [IsConnected B] (a : F.obj A)
    (b : F.obj B) (i : A ⟶ X) (j : B ⟶ X) (h : F.map i a = F.map j b) [Mono i] [Mono j] :
    ∃ (f : A ≅ B), F.map f.hom a = b 
goal: ∃ f, F.map f.hom a = b

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.selfProd
code: /-- The self product of `X` indexed by its fiber. -/
@[simp]
private noncomputable def selfProd : C 
goal: C

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.mkSelfProdFib
code: /-- For `g : F.obj X → F.obj X`, this is the element in the fiber of the self product,
which has at index `x : F.obj X` the element `g x`. -/
private noncomputable def mkSelfProdFib : F.obj (selfProd F X) 
goal: ↑(F.obj (CategoryTheory.PreGaloisCategory.selfProd F X))

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.mkSelfProdFib_map_π
code: @[simp]
private lemma mkSelfProdFib_map_π (t : F.obj X) : F.map (Pi.π _ t) (mkSelfProdFib F X) = t 
goal: F.map (CategoryTheory.Limits.Pi.π (fun x => X) t) (CategoryTheory.PreGaloisCategory.mkSelfProdFib F X) = t

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.selfProdProj
code: /-- For each `x : F.obj X`, this is the composition of `u` with the projection at `x`. -/
@[simp]
private noncomputable def selfProdProj (x : F.obj X) : A ⟶ X 
goal: A ⟶ X

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.selfProdProj_fiber
code: private lemma selfProdProj_fiber (x : F.obj X) :
    F.map (selfProdProj u x) a = x 
goal: F.map (CategoryTheory.PreGaloisCategory.selfProdProj u x) a = x

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.fiberPerm
code: /-- An element `b : F.obj A` defines a permutation of the fiber of `X` by projecting onto the
`F.map u b` factor. -/
private noncomputable def fiberPerm (b : F.obj A) : F.obj X ≃ F.obj X 
goal: ↑(F.obj X) ≃ ↑(F.obj X)

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.selfProdPermIncl
code: /-- Twisting `u` by `fiberPerm h b` yields an inclusion of `A` into `selfProd F X`. -/
private noncomputable def selfProdPermIncl (b : F.obj A) : A ⟶ selfProd F X 
goal: A ⟶ CategoryTheory.PreGaloisCategory.selfProd F X

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.instMonoSelfProdPermIncl
code: private instance (b : F.obj A) : Mono (selfProdPermIncl h b) 
goal: CategoryTheory.Mono (CategoryTheory.PreGaloisCategory.selfProdPermIncl h b)

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.selfProdTermIncl_fib_eq
code: /-- Key technical lemma: the twisted inclusion `selfProdPermIncl h b` maps `a` to `F.map u b`. -/
private lemma selfProdTermIncl_fib_eq (b : F.obj A) :
    F.map u b = F.map (selfProdPermIncl h b) a 
goal: F.map u b = F.map (CategoryTheory.PreGaloisCategory.selfProdPermIncl h b) a

full_name: _private.Mathlib.CategoryTheory.Galois.Decomposition.0.CategoryTheory.PreGaloisCategory.subobj_selfProd_trans
code: /-- There exists an automorphism `f` of `A` that maps `b` to `a`.
`f` is obtained by considering `u` and `selfProdPermIncl h b`.
Both are inclusions of `A` into `selfProd F X` mapping `b` respectively `a` to the same element
in the fiber of `selfProd F X`. Applying `connected_component_unique` yields the result. -/
private lemma subobj_selfProd_trans (b : F.obj A) : ∃ (f : A ≅ A), F.map f.hom b = a 
goal: ∃ f, F.map f.hom b = a

full_name: CategoryTheory.PreGaloisCategory.exists_galois_representative
code: /-- The fiber of any object in a Galois category is represented by a Galois object. -/
lemma exists_galois_representative (X : C) : ∃ (A : C) (a : F.obj A),
    IsGalois A ∧ Function.Bijective (fun (f : A ⟶ X) ↦ F.map f a) 
goal: ∃ A a, CategoryTheory.PreGaloisCategory.IsGalois A ∧ Function.Bijective fun f => F.map f a

full_name: CategoryTheory.PreGaloisCategory.exists_hom_from_galois_of_fiber
code: /-- Any element in the fiber of an object `X` is the evaluation of a morphism from a
Galois object. -/
lemma exists_hom_from_galois_of_fiber (X : C) (x : F.obj X) :
    ∃ (A : C) (f : A ⟶ X) (a : F.obj A), IsGalois A ∧ F.map f a = x 
goal: ∃ A f a, CategoryTheory.PreGaloisCategory.IsGalois A ∧ F.map f a = x

full_name: CategoryTheory.PreGaloisCategory.exists_hom_from_galois_of_fiber_nonempty
code: /-- Any object with non-empty fiber admits a hom from a Galois object. -/
lemma exists_hom_from_galois_of_fiber_nonempty (X : C) (h : Nonempty (F.obj X)) :
    ∃ (A : C) (_ : A ⟶ X), IsGalois A 
goal: ∃ A x, CategoryTheory.PreGaloisCategory.IsGalois A

full_name: CategoryTheory.PreGaloisCategory.exists_hom_from_galois_of_connected
code: /-- Any connected object admits a hom from a Galois object. -/
lemma exists_hom_from_galois_of_connected (X : C) [IsConnected X] :
    ∃ (A : C) (_ : A ⟶ X), IsGalois A 
goal: ∃ A x, CategoryTheory.PreGaloisCategory.IsGalois A