File: Mathlib/Algebra/DirectLimit.lean

full_name: DirectedSystem.map_self'
code: /-- A directed system is a functor from a category (directed poset) to another category. -/
class DirectedSystem (f : ∀ i j, i ≤ j → G i → G j) : Prop where
  map_self' : ∀ i x h, f i i h x = x
  map_map' : ∀ {i j k} (hij hjk x), f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x
goal: f i i h x = x

full_name: DirectedSystem.map_map'
code: /-- A directed system is a functor from a category (directed poset) to another category. -/
class DirectedSystem (f : ∀ i j, i ≤ j → G i → G j) : Prop where
  map_self' : ∀ i x h, f i i h x = x
  map_map' : ∀ {i j k} (hij hjk x), f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x
goal: f j k hjk (f i j hij x) = f i k ⋯ x

full_name: DirectedSystem
code: /-- A directed system is a functor from a category (directed poset) to another category. -/
class DirectedSystem (f : ∀ i j, i ≤ j → G i → G j) : Prop where
  map_self' : ∀ i x h, f i i h x = x
  map_map' : ∀ {i j k} (hij hjk x), f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x
goal: Prop

full_name: DirectedSystem.map_self
code: theorem DirectedSystem.map_self i x h : f i i h x = x 
goal: f i i h x = x

full_name: DirectedSystem.map_map
code: theorem DirectedSystem.map_map {i j k} (hij hjk x) :
    f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x 
goal: f j k hjk (f i j hij x) = f i k ⋯ x

full_name: Module.DirectedSystem.map_self
code: /-- A copy of `DirectedSystem.map_self` specialized to linear maps, as otherwise the
`fun i j h ↦ f i j h` can confuse the simplifier. -/
nonrec theorem DirectedSystem.map_self [DirectedSystem G fun i j h => f i j h] (i x h) :
    f i i h x = x 
goal: (f i i h) x = x

full_name: Module.DirectedSystem.map_map
code: /-- A copy of `DirectedSystem.map_map` specialized to linear maps, as otherwise the
`fun i j h ↦ f i j h` can confuse the simplifier. -/
nonrec theorem DirectedSystem.map_map [DirectedSystem G fun i j h => f i j h] {i j k} (hij hjk x) :
    f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x 
goal: (f j k hjk) ((f i j hij) x) = (f i k ⋯) x

full_name: Module.DirectLimit
code: /-- The direct limit of a directed system is the modules glued together along the maps. -/
def DirectLimit : Type max v w 
goal: Type (max v w)

full_name: Module.DirectLimit.addCommGroup
code: instance addCommGroup : AddCommGroup (DirectLimit G f) 
goal: AddCommGroup (Module.DirectLimit G f)

full_name: Module.DirectLimit.module
code: instance module : Module R (DirectLimit G f) 
goal: Module R (Module.DirectLimit G f)

full_name: Module.DirectLimit.inhabited
code: instance inhabited : Inhabited (DirectLimit G f) 
goal: Inhabited (Module.DirectLimit G f)

full_name: Module.DirectLimit.unique
code: instance unique [IsEmpty ι] : Unique (DirectLimit G f) 
goal: Unique (Module.DirectLimit G f)

full_name: Module.DirectLimit.of
code: /-- The canonical map from a component to the direct limit. -/
def of (i) : G i →ₗ[R] DirectLimit G f 
goal: G i →ₗ[R] Module.DirectLimit G f

full_name: Module.DirectLimit.of_f
code: @[simp]
theorem of_f {i j hij x} : of R ι G f j (f i j hij x) = of R ι G f i x 
goal: (Module.DirectLimit.of R ι G f j) ((f i j hij) x) = (Module.DirectLimit.of R ι G f i) x

full_name: Module.DirectLimit.exists_of
code: /-- Every element of the direct limit corresponds to some element in
some component of the directed system. -/
theorem exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)] (z : DirectLimit G f) :
    ∃ i x, of R ι G f i x = z 
goal: ∃ i x, (Module.DirectLimit.of R ι G f i) x = z

full_name: Module.DirectLimit.induction_on
code: @[elab_as_elim]
protected theorem induction_on [Nonempty ι] [IsDirected ι (· ≤ ·)] {C : DirectLimit G f → Prop}
    (z : DirectLimit G f) (ih : ∀ i x, C (of R ι G f i x)) : C z 
goal: C z

full_name: Module.DirectLimit.lift
code: /-- The universal property of the direct limit: maps from the components to another module
that respect the directed system structure (i.e. make some diagram commute) give rise
to a unique map out of the direct limit. -/
def lift : DirectLimit G f →ₗ[R] P 
goal: Module.DirectLimit G f →ₗ[R] P

full_name: Module.DirectLimit.lift_of
code: theorem lift_of {i} (x) : lift R ι G f g Hg (of R ι G f i x) = g i x 
goal: (Module.DirectLimit.lift R ι G f g Hg) ((Module.DirectLimit.of R ι G f i) x) = (g i) x

full_name: Module.DirectLimit.lift_unique
code: theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →ₗ[R] P) (x) :
    F x =
      lift R ι G f (fun i => F.comp <| of R ι G f i)
        (fun i j hij x => by rw [LinearMap.comp_apply, of_f]; rfl) x 
goal: F x = (Module.DirectLimit.lift R ι G f (fun i => F ∘ₗ Module.DirectLimit.of R ι G f i) ⋯) x

full_name: Module.DirectLimit.lift_injective
code: lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift R ι G f g Hg) 
goal: Function.Injective ⇑(Module.DirectLimit.lift R ι G f g Hg)

full_name: Module.DirectLimit.map
code: /--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of linear maps `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a linear map
`lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →ₗ[R] G' i) (hg : ∀ i j h, g j ∘ₗ f i j h = f' i j h ∘ₗ g i) :
    DirectLimit G f →ₗ[R] DirectLimit G' f' 
goal: Module.DirectLimit G f →ₗ[R] Module.DirectLimit G' f'

full_name: Module.DirectLimit.map_apply_of
code: @[simp] lemma map_apply_of (g : (i : ι) → G i →ₗ[R] G' i)
    (hg : ∀ i j h, g j ∘ₗ f i j h = f' i j h ∘ₗ g i)
    {i : ι} (x : G i) :
    map g hg (of _ _ G f _ x) = of R ι G' f' i (g i x) 
goal: (Module.DirectLimit.map g hg) ((Module.DirectLimit.of R ι G f i) x) = (Module.DirectLimit.of R ι G' f' i) ((g i) x)

full_name: Module.DirectLimit.map_id
code: @[simp] lemma map_id [IsDirected ι (· ≤ ·)] :
    map (fun i ↦ LinearMap.id) (fun _ _ _ ↦ rfl) = LinearMap.id (R := R) (M := DirectLimit G f) 
goal: Module.DirectLimit.map (fun i => LinearMap.id) ⋯ = LinearMap.id

full_name: Module.DirectLimit.map_comp
code: lemma map_comp [IsDirected ι (· ≤ ·)]
    (g₁ : (i : ι) → G i →ₗ[R] G' i) (g₂ : (i : ι) → G' i →ₗ[R] G'' i)
    (hg₁ : ∀ i j h, g₁ j ∘ₗ f i j h = f' i j h ∘ₗ g₁ i)
    (hg₂ : ∀ i j h, g₂ j ∘ₗ f' i j h = f'' i j h ∘ₗ g₂ i) :
    (map g₂ hg₂ ∘ₗ map g₁ hg₁ :
      DirectLimit G f →ₗ[R] DirectLimit G'' f'') =
    (map (fun i ↦ g₂ i ∘ₗ g₁ i) fun i j h ↦ by
        rw [LinearMap.comp_assoc, hg₁ i, ← LinearMap.comp_assoc, hg₂ i, LinearMap.comp_assoc] :
      DirectLimit G f →ₗ[R] DirectLimit G'' f'') 
goal: Module.DirectLimit.map g₂ hg₂ ∘ₗ Module.DirectLimit.map g₁ hg₁ = Module.DirectLimit.map (fun i => g₂ i ∘ₗ g₁ i) ⋯

full_name: Module.DirectLimit.congr
code: /--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of equivalences `eᵢ : Gᵢ ≅ G'ᵢ` such that `e ∘ f = f' ∘ e` induces an equivalence
`lim G ≅ lim G'`.
-/
def congr [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃ₗ[R] G' i) (he : ∀ i j h, e j ∘ₗ f i j h = f' i j h ∘ₗ e i) :
    DirectLimit G f ≃ₗ[R] DirectLimit G' f' 
goal: Module.DirectLimit G f ≃ₗ[R] Module.DirectLimit G' f'

full_name: Module.DirectLimit.congr_apply_of
code: lemma congr_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃ₗ[R] G' i) (he : ∀ i j h, e j ∘ₗ f i j h = f' i j h ∘ₗ e i)
    {i : ι} (g : G i) :
    congr e he (of _ _ G f i g) = of _ _ G' f' i (e i g) 
goal: (Module.DirectLimit.congr e he) ((Module.DirectLimit.of R ι G f i) g) = (Module.DirectLimit.of R ι G' f' i) ((e i) g)

full_name: Module.DirectLimit.congr_symm_apply_of
code: lemma congr_symm_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃ₗ[R] G' i) (he : ∀ i j h, e j ∘ₗ f i j h = f' i j h ∘ₗ e i)
    {i : ι} (g : G' i) :
    (congr e he).symm (of _ _ G' f' i g) = of _ _ G f i ((e i).symm g) 
goal: (Module.DirectLimit.congr e he).symm ((Module.DirectLimit.of R ι G' f' i) g) =
  (Module.DirectLimit.of R ι G f i) ((e i).symm g)

full_name: Module.DirectLimit.totalize
code: /-- `totalize G f i j` is a linear map from `G i` to `G j`, for *every* `i` and `j`.
If `i ≤ j`, then it is the map `f i j` that comes with the directed system `G`,
and otherwise it is the zero map. -/
noncomputable def totalize (i j) : G i →ₗ[R] G j 
goal: G i →ₗ[R] G j

full_name: Module.DirectLimit.totalize_of_le
code: theorem totalize_of_le {i j} (h : i ≤ j) : totalize G f i j = f i j h 
goal: Module.DirectLimit.totalize G f i j = f i j h

full_name: Module.DirectLimit.totalize_of_not_le
code: theorem totalize_of_not_le {i j} (h : ¬i ≤ j) : totalize G f i j = 0 
goal: Module.DirectLimit.totalize G f i j = 0

full_name: Module.DirectLimit.toModule_totalize_of_le
code: theorem toModule_totalize_of_le [∀ i (k : G i), Decidable (k ≠ 0)] {x : DirectSum ι G} {i j : ι}
    (hij : i ≤ j) (hx : ∀ k ∈ x.support, k ≤ i) :
    DirectSum.toModule R ι (G j) (fun k => totalize G f k j) x =
      f i j hij (DirectSum.toModule R ι (G i) (fun k => totalize G f k i) x) 
goal: (DirectSum.toModule R ι (G j) fun k => Module.DirectLimit.totalize G f k j) x =
  (f i j hij) ((DirectSum.toModule R ι (G i) fun k => Module.DirectLimit.totalize G f k i) x)

full_name: Module.DirectLimit.of.zero_exact_aux
code: theorem of.zero_exact_aux [∀ i (k : G i), Decidable (k ≠ 0)] [Nonempty ι] [IsDirected ι (· ≤ ·)]
    {x : DirectSum ι G} (H : (Submodule.Quotient.mk x : DirectLimit G f) = (0 : DirectLimit G f)) :
    ∃ j,
      (∀ k ∈ x.support, k ≤ j) ∧
        DirectSum.toModule R ι (G j) (fun i => totalize G f i j) x = (0 : G j) 
goal: ∃ j,
  (∀ k ∈ DFinsupp.support x, k ≤ j) ∧ (DirectSum.toModule R ι (G j) fun i => Module.DirectLimit.totalize G f i j) x = 0

full_name: Module.DirectLimit.of.zero_exact
code: /-- A component that corresponds to zero in the direct limit is already zero in some
bigger module in the directed system. -/
theorem of.zero_exact [IsDirected ι (· ≤ ·)] {i x} (H : of R ι G f i x = 0) :
    ∃ j hij, f i j hij x = (0 : G j) 
goal: ∃ j, ∃ (hij : i ≤ j), (f i j hij) x = 0

full_name: AddCommGroup.DirectLimit
code: /-- The direct limit of a directed system is the abelian groups glued together along the maps. -/
def DirectLimit (f : ∀ i j, i ≤ j → G i →+ G j) : Type _ 
goal: Type (max w v)

full_name: AddCommGroup.DirectLimit.directedSystem
code: protected theorem directedSystem [h : DirectedSystem G fun i j h => f i j h] :
    DirectedSystem G fun i j hij => (f i j hij).toIntLinearMap 
goal: DirectedSystem G fun i j hij => ⇑(f i j hij).toIntLinearMap

full_name: AddCommGroup.DirectLimit.inst
code: instance : AddCommGroup (DirectLimit G f) 
goal: AddCommGroup (AddCommGroup.DirectLimit G f)

full_name: AddCommGroup.DirectLimit.instInhabited
code: instance : Inhabited (DirectLimit G f) 
goal: Inhabited (AddCommGroup.DirectLimit G f)

full_name: AddCommGroup.DirectLimit.instUniqueOfIsEmpty
code: instance [IsEmpty ι] : Unique (DirectLimit G f) 
goal: Unique (AddCommGroup.DirectLimit G f)

full_name: AddCommGroup.DirectLimit.of
code: /-- The canonical map from a component to the direct limit. -/
def of (i) : G i →+ DirectLimit G f 
goal: G i →+ AddCommGroup.DirectLimit G f

full_name: AddCommGroup.DirectLimit.of_f
code: @[simp]
theorem of_f {i j} (hij) (x) : of G f j (f i j hij x) = of G f i x 
goal: (AddCommGroup.DirectLimit.of G f j) ((f i j hij) x) = (AddCommGroup.DirectLimit.of G f i) x

full_name: AddCommGroup.DirectLimit.induction_on
code: @[elab_as_elim]
protected theorem induction_on [Nonempty ι] [IsDirected ι (· ≤ ·)] {C : DirectLimit G f → Prop}
    (z : DirectLimit G f) (ih : ∀ i x, C (of G f i x)) : C z 
goal: C z

full_name: AddCommGroup.DirectLimit.of.zero_exact
code: /-- A component that corresponds to zero in the direct limit is already zero in some
bigger module in the directed system. -/
theorem of.zero_exact [IsDirected ι (· ≤ ·)] [DirectedSystem G fun i j h => f i j h] (i x)
    (h : of G f i x = 0) : ∃ j hij, f i j hij x = 0 
goal: ∃ j, ∃ (hij : i ≤ j), (f i j hij) x = 0

full_name: AddCommGroup.DirectLimit.lift
code: /-- The universal property of the direct limit: maps from the components to another abelian group
that respect the directed system structure (i.e. make some diagram commute) give rise
to a unique map out of the direct limit. -/
def lift : DirectLimit G f →+ P 
goal: AddCommGroup.DirectLimit G f →+ P

full_name: AddCommGroup.DirectLimit.lift_of
code: @[simp]
theorem lift_of (i x) : lift G f P g Hg (of G f i x) = g i x 
goal: (AddCommGroup.DirectLimit.lift G f P g Hg) ((AddCommGroup.DirectLimit.of G f i) x) = (g i) x

full_name: AddCommGroup.DirectLimit.lift_unique
code: theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →+ P) (x) :
    F x = lift G f P (fun i => F.comp (of G f i)) (fun i j hij x => by simp) x 
goal: F x = (AddCommGroup.DirectLimit.lift G f P (fun i => F.comp (AddCommGroup.DirectLimit.of G f i)) ⋯) x

full_name: AddCommGroup.DirectLimit.lift_injective
code: lemma lift_injective [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift G f P g Hg) 
goal: Function.Injective ⇑(AddCommGroup.DirectLimit.lift G f P g Hg)

full_name: AddCommGroup.DirectLimit.map
code: /--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of group homomorphisms `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a group
homomorphism `lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →+ G' i)
    (hg : ∀ i j h, (g j).comp (f i j h) = (f' i j h).comp (g i)) :
    DirectLimit G f →+ DirectLimit G' f' 
goal: AddCommGroup.DirectLimit G f →+ AddCommGroup.DirectLimit G' f'

full_name: AddCommGroup.DirectLimit.map_apply_of
code: @[simp] lemma map_apply_of (g : (i : ι) → G i →+ G' i)
    (hg : ∀ i j h, (g j).comp (f i j h) = (f' i j h).comp (g i))
    {i : ι} (x : G i) :
    map g hg (of G f _ x) = of G' f' i (g i x) 
goal: (AddCommGroup.DirectLimit.map g hg) ((AddCommGroup.DirectLimit.of G f i) x) =
  (AddCommGroup.DirectLimit.of G' f' i) ((g i) x)

full_name: AddCommGroup.DirectLimit.map_id
code: @[simp] lemma map_id [IsDirected ι (· ≤ ·)] :
    map (fun i ↦ AddMonoidHom.id _) (fun _ _ _ ↦ rfl) = AddMonoidHom.id (DirectLimit G f) 
goal: AddCommGroup.DirectLimit.map (fun i => AddMonoidHom.id (G i)) ⋯ = AddMonoidHom.id (AddCommGroup.DirectLimit G f)

full_name: AddCommGroup.DirectLimit.map_comp
code: lemma map_comp [IsDirected ι (· ≤ ·)]
    (g₁ : (i : ι) → G i →+ G' i) (g₂ : (i : ι) → G' i →+ G'' i)
    (hg₁ : ∀ i j h, (g₁ j).comp (f i j h) = (f' i j h).comp (g₁ i))
    (hg₂ : ∀ i j h, (g₂ j).comp (f' i j h) = (f'' i j h).comp (g₂ i)) :
    ((map g₂ hg₂).comp (map g₁ hg₁) :
      DirectLimit G f →+ DirectLimit G'' f'') =
    (map (fun i ↦ (g₂ i).comp (g₁ i)) fun i j h ↦ by
      rw [AddMonoidHom.comp_assoc, hg₁ i, ← AddMonoidHom.comp_assoc, hg₂ i,
        AddMonoidHom.comp_assoc] :
      DirectLimit G f →+ DirectLimit G'' f'') 
goal: (AddCommGroup.DirectLimit.map g₂ hg₂).comp (AddCommGroup.DirectLimit.map g₁ hg₁) =
  AddCommGroup.DirectLimit.map (fun i => (g₂ i).comp (g₁ i)) ⋯

full_name: AddCommGroup.DirectLimit.congr
code: /--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of equivalences `eᵢ : Gᵢ ≅ G'ᵢ` such that `e ∘ f = f' ∘ e` induces an equivalence
`lim G ⟶ lim G'`.
-/
def congr [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+ G' i)
    (he : ∀ i j h, (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp (e i)) :
    DirectLimit G f ≃+ DirectLimit G' f' 
goal: AddCommGroup.DirectLimit G f ≃+ AddCommGroup.DirectLimit G' f'

full_name: AddCommGroup.DirectLimit.congr_apply_of
code: lemma congr_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+ G' i)
    (he : ∀ i j h, (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp (e i))
    {i : ι} (g : G i) :
    congr e he (of G f i g) = of G' f' i (e i g) 
goal: (AddCommGroup.DirectLimit.congr e he) ((AddCommGroup.DirectLimit.of G f i) g) =
  (AddCommGroup.DirectLimit.of G' f' i) ((e i) g)

full_name: AddCommGroup.DirectLimit.congr_symm_apply_of
code: lemma congr_symm_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+ G' i)
    (he : ∀ i j h, (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp (e i))
    {i : ι} (g : G' i) :
    (congr e he).symm (of G' f' i g) = of G f i ((e i).symm g) 
goal: (AddCommGroup.DirectLimit.congr e he).symm ((AddCommGroup.DirectLimit.of G' f' i) g) =
  (AddCommGroup.DirectLimit.of G f i) ((e i).symm g)

full_name: Ring.DirectLimit
code: /-- The direct limit of a directed system is the rings glued together along the maps. -/
def DirectLimit : Type max v w 
goal: Type (max v w)

full_name: Ring.DirectLimit.commRing
code: instance commRing : CommRing (DirectLimit G f) 
goal: CommRing (Ring.DirectLimit G f)

full_name: Ring.DirectLimit.ring
code: instance ring : Ring (DirectLimit G f) 
goal: Ring (Ring.DirectLimit G f)

full_name: Ring.DirectLimit.zero
code: instance zero : Zero (DirectLimit G f) 
goal: Zero (Ring.DirectLimit G f)

full_name: Ring.DirectLimit.instInhabited
code: instance : Inhabited (DirectLimit G f) 
goal: Inhabited (Ring.DirectLimit G f)

full_name: Ring.DirectLimit.of
code: /-- The canonical map from a component to the direct limit. -/
nonrec def of (i) : G i →+* DirectLimit G f 
goal: G i →+* Ring.DirectLimit G f

full_name: Ring.DirectLimit.of_f
code: theorem of_f {i j} (hij) (x) : of G f j (f i j hij x) = of G f i x 
goal: (Ring.DirectLimit.of G f j) (f i j hij x) = (Ring.DirectLimit.of G f i) x

full_name: Ring.DirectLimit.exists_of
code: /-- Every element of the direct limit corresponds to some element in
some component of the directed system. -/
theorem exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)] (z : DirectLimit G f) :
    ∃ i x, of G f i x = z 
goal: ∃ i x, (Ring.DirectLimit.of G f i) x = z

full_name: Ring.DirectLimit.Polynomial.exists_of
code: nonrec theorem Polynomial.exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)]
    (q : Polynomial (DirectLimit G fun i j h => f' i j h)) :
    ∃ i p, Polynomial.map (of G (fun i j h => f' i j h) i) p = q 
goal: ∃ i p, Polynomial.map (Ring.DirectLimit.of G (fun i j h => ⇑(f' i j h)) i) p = q

full_name: Ring.DirectLimit.induction_on
code: @[elab_as_elim]
theorem induction_on [Nonempty ι] [IsDirected ι (· ≤ ·)] {C : DirectLimit G f → Prop}
    (z : DirectLimit G f) (ih : ∀ i x, C (of G f i x)) : C z 
goal: C z

full_name: Ring.DirectLimit.of.zero_exact_aux2
code: theorem of.zero_exact_aux2 {x : FreeCommRing (Σi, G i)} {s t} [DecidablePred (· ∈ s)]
    [DecidablePred (· ∈ t)] (hxs : IsSupported x s) {j k} (hj : ∀ z : Σi, G i, z ∈ s → z.1 ≤ j)
    (hk : ∀ z : Σi, G i, z ∈ t → z.1 ≤ k) (hjk : j ≤ k) (hst : s ⊆ t) :
    f' j k hjk (lift (fun ix : s => f' ix.1.1 j (hj ix ix.2) ix.1.2) (restriction s x)) =
      lift (fun ix : t => f' ix.1.1 k (hk ix ix.2) ix.1.2) (restriction t x) 
goal: (f' j k hjk) ((FreeCommRing.lift fun ix => (f' (↑ix).fst j ⋯) (↑ix).snd) ((FreeCommRing.restriction s) x)) =
  (FreeCommRing.lift fun ix => (f' (↑ix).fst k ⋯) (↑ix).snd) ((FreeCommRing.restriction t) x)

full_name: Ring.DirectLimit.of.zero_exact_aux
code: theorem of.zero_exact_aux [Nonempty ι] [IsDirected ι (· ≤ ·)] {x : FreeCommRing (Σi, G i)}
    (H : (Ideal.Quotient.mk _ x : DirectLimit G fun i j h => f' i j h)
        = (0 : DirectLimit G fun i j h => f' i j h)) :
    ∃ j s, ∃ H : ∀ k : Σ i, G i, k ∈ s → k.1 ≤ j,
        IsSupported x s ∧
          ∀ [DecidablePred (· ∈ s)],
            lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) 
goal: ∃ j s,
  ∃ (H : ∀ k ∈ s, k.fst ≤ j),
    x.IsSupported s ∧
      ∀ [inst : DecidablePred fun x => x ∈ s],
        (FreeCommRing.lift fun ix => (f' (↑ix).fst j ⋯) (↑ix).snd) ((FreeCommRing.restriction s) x) = 0

full_name: Ring.DirectLimit.of.zero_exact
code: /-- A component that corresponds to zero in the direct limit is already zero in some
bigger module in the directed system. -/
theorem of.zero_exact [IsDirected ι (· ≤ ·)] {i x} (hix : of G (fun i j h => f' i j h) i x = 0) :
    ∃ (j : _) (hij : i ≤ j), f' i j hij x = 0 
goal: ∃ j, ∃ (hij : i ≤ j), (f' i j hij) x = 0

full_name: Ring.DirectLimit.of_injective
code: /-- If the maps in the directed system are injective, then the canonical maps
from the components to the direct limits are injective. -/
theorem of_injective [IsDirected ι (· ≤ ·)] [DirectedSystem G fun i j h => f' i j h]
    (hf : ∀ i j hij, Function.Injective (f' i j hij)) (i) :
    Function.Injective (of G (fun i j h => f' i j h) i) 
goal: Function.Injective ⇑(Ring.DirectLimit.of G (fun i j h => ⇑(f' i j h)) i)

full_name: Ring.DirectLimit.lift
code: /-- The universal property of the direct limit: maps from the components to another ring
that respect the directed system structure (i.e. make some diagram commute) give rise
to a unique map out of the direct limit.
-/
def lift : DirectLimit G f →+* P 
goal: Ring.DirectLimit G f →+* P

full_name: Ring.DirectLimit.lift_of
code: theorem lift_of (i x) : lift G f P g Hg (of G f i x) = g i x 
goal: (Ring.DirectLimit.lift G f P g Hg) ((Ring.DirectLimit.of G f i) x) = (g i) x

full_name: Ring.DirectLimit.lift_unique
code: theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →+* P) (x) :
    F x = lift G f P (fun i => F.comp <| of G f i) (fun i j hij x => by simp [of_f]) x 
goal: F x = (Ring.DirectLimit.lift G f P (fun i => F.comp (Ring.DirectLimit.of G f i)) ⋯) x

full_name: Ring.DirectLimit.lift_injective
code: lemma lift_injective [Nonempty ι] [IsDirected ι (· ≤ ·)]
    (injective : ∀ i, Function.Injective <| g i) :
    Function.Injective (lift G f P g Hg) 
goal: Function.Injective ⇑(Ring.DirectLimit.lift G f P g Hg)

full_name: Ring.DirectLimit.map
code: /--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of ring homomorphisms `gᵢ : Gᵢ ⟶ G'ᵢ` such that `g ∘ f = f' ∘ g` induces a ring
homomorphism `lim G ⟶ lim G'`.
-/
def map (g : (i : ι) → G i →+* G' i)
    (hg : ∀ i j h, (g j).comp (f i j h) = (f' i j h).comp (g i)) :
    DirectLimit G (fun _ _ h ↦ f _ _ h) →+* DirectLimit G' fun _ _ h ↦ f' _ _ h 
goal: (Ring.DirectLimit G fun x x_1 h => ⇑(f x x_1 h)) →+* Ring.DirectLimit G' fun x x_1 h => ⇑(f' x x_1 h)

full_name: Ring.DirectLimit.map_apply_of
code: @[simp] lemma map_apply_of (g : (i : ι) → G i →+* G' i)
    (hg : ∀ i j h, (g j).comp (f i j h) = (f' i j h).comp (g i))
    {i : ι} (x : G i) :
    map g hg (of G _ _ x) = of G' (fun _ _ h ↦ f' _ _ h) i (g i x) 
goal: (Ring.DirectLimit.map g hg) ((Ring.DirectLimit.of G (fun x x_1 h => ⇑(f x x_1 h)) i) x) =
  (Ring.DirectLimit.of G' (fun x x_1 h => ⇑(f' x x_1 h)) i) ((g i) x)

full_name: Ring.DirectLimit.map_id
code: @[simp] lemma map_id [IsDirected ι (· ≤ ·)] :
    map (fun i ↦ RingHom.id _) (fun _ _ _ ↦ rfl) =
    RingHom.id (DirectLimit G fun _ _ h ↦ f _ _ h) 
goal: Ring.DirectLimit.map (fun i => RingHom.id (G i)) ⋯ = RingHom.id (Ring.DirectLimit G fun x x_1 h => ⇑(f x x_1 h))

full_name: Ring.DirectLimit.map_comp
code: lemma map_comp [IsDirected ι (· ≤ ·)]
    (g₁ : (i : ι) → G i →+* G' i) (g₂ : (i : ι) → G' i →+* G'' i)
    (hg₁ : ∀ i j h, (g₁ j).comp (f i j h) = (f' i j h).comp (g₁ i))
    (hg₂ : ∀ i j h, (g₂ j).comp (f' i j h) = (f'' i j h).comp (g₂ i)) :
    ((map g₂ hg₂).comp (map g₁ hg₁) :
      DirectLimit G (fun _ _ h ↦ f _ _ h) →+* DirectLimit G'' fun _ _ h ↦ f'' _ _ h) =
    (map (fun i ↦ (g₂ i).comp (g₁ i)) fun i j h ↦ by
      rw [RingHom.comp_assoc, hg₁ i, ← RingHom.comp_assoc, hg₂ i, RingHom.comp_assoc] :
      DirectLimit G (fun _ _ h ↦ f _ _ h) →+* DirectLimit G'' fun _ _ h ↦ f'' _ _ h) 
goal: (Ring.DirectLimit.map g₂ hg₂).comp (Ring.DirectLimit.map g₁ hg₁) = Ring.DirectLimit.map (fun i => (g₂ i).comp (g₁ i)) ⋯

full_name: Ring.DirectLimit.congr
code: /--
Consider direct limits `lim G` and `lim G'` with direct system `f` and `f'` respectively, any
family of equivalences `eᵢ : Gᵢ ≅ G'ᵢ` such that `e ∘ f = f' ∘ e` induces an equivalence
`lim G ⟶ lim G'`.
-/
def congr [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+* G' i)
    (he : ∀ i j h, (e j).toRingHom.comp (f i j h) = (f' i j h).comp (e i)) :
    DirectLimit G (fun _ _ h ↦ f _ _ h) ≃+* DirectLimit G' fun _ _ h ↦ f' _ _ h 
goal: (Ring.DirectLimit G fun x x_1 h => ⇑(f x x_1 h)) ≃+* Ring.DirectLimit G' fun x x_1 h => ⇑(f' x x_1 h)

full_name: Ring.DirectLimit.congr_apply_of
code: lemma congr_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+* G' i)
    (he : ∀ i j h, (e j).toRingHom.comp (f i j h) = (f' i j h).comp (e i))
    {i : ι} (g : G i) :
    congr e he (of G _ i g) = of G' (fun _ _ h ↦ f' _ _ h) i (e i g) 
goal: (Ring.DirectLimit.congr e he) ((Ring.DirectLimit.of G (fun x x_1 h => ⇑(f x x_1 h)) i) g) =
  (Ring.DirectLimit.of G' (fun x x_1 h => ⇑(f' x x_1 h)) i) ((e i) g)

full_name: Ring.DirectLimit.congr_symm_apply_of
code: lemma congr_symm_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+* G' i)
    (he : ∀ i j h, (e j).toRingHom.comp (f i j h) = (f' i j h).comp (e i))
    {i : ι} (g : G' i) :
    (congr e he).symm (of G' _ i g) = of G (fun _ _ h ↦ f _ _ h) i ((e i).symm g) 
goal: (Ring.DirectLimit.congr e he).symm ((Ring.DirectLimit.of G' (fun x x_1 h => ⇑(f' x x_1 h)) i) g) =
  (Ring.DirectLimit.of G (fun x x_1 h => ⇑(f x x_1 h)) i) ((e i).symm g)

full_name: Field.DirectLimit.nontrivial
code: instance nontrivial [DirectedSystem G fun i j h => f' i j h] :
    Nontrivial (Ring.DirectLimit G fun i j h => f' i j h) 
goal: Nontrivial (Ring.DirectLimit G fun i j h => ⇑(f' i j h))

full_name: Field.DirectLimit.exists_inv
code: theorem exists_inv {p : Ring.DirectLimit G f} : p ≠ 0 → ∃ y, p * y = 1 
goal: p ≠ 0 → ∃ y, p * y = 1

full_name: Field.DirectLimit.inv
code: /-- Noncomputable multiplicative inverse in a direct limit of fields. -/
noncomputable def inv (p : Ring.DirectLimit G f) : Ring.DirectLimit G f 
goal: Ring.DirectLimit G f

full_name: Field.DirectLimit.mul_inv_cancel
code: protected theorem mul_inv_cancel {p : Ring.DirectLimit G f} (hp : p ≠ 0) : p * inv G f p = 1 
goal: p * Field.DirectLimit.inv G f p = 1

full_name: Field.DirectLimit.inv_mul_cancel
code: protected theorem inv_mul_cancel {p : Ring.DirectLimit G f} (hp : p ≠ 0) : inv G f p * p = 1 
goal: Field.DirectLimit.inv G f p * p = 1

full_name: Field.DirectLimit.field
code: /-- Noncomputable field structure on the direct limit of fields.
See note [reducible non-instances]. -/
protected noncomputable abbrev field [DirectedSystem G fun i j h => f' i j h] :
    Field (Ring.DirectLimit G fun i j h => f' i j h) 
goal: Field (Ring.DirectLimit G fun i j h => ⇑(f' i j h))