l3lab/ntp-mathlib huggingface dataset:
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        

Proof state:
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
this : Ideal.span ?m.4011449 ≤ Ideal.comap (FreeCommRing.lift fun x => (g x.fst) x.snd) ⊥
⊢ ∀
    a ∈
      Ideal.span
        {a |
          (∃ i j,
              ∃ (H : i ≤ j),
                ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
            (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
              (∃ i x y,
                  FreeCommRing.of { fst := i, snd := x + y } -
                      (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                    a) ∨
                ∃ i x y,
                  FreeCommRing.of { fst := i, snd := x * y } -
                      FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                    a},
    (FreeCommRing.lift fun x => (g x.fst) x.snd) a = 0

Next tactic:
intro x hx
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        

Proof state:
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
this : Ideal.span ?m.4011449 ≤ Ideal.comap (FreeCommRing.lift fun x => (g x.fst) x.snd) ⊥
x : FreeCommRing ((i : ι) × G i)
hx :
  x ∈
    Ideal.span
      {a |
        (∃ i j,
            ∃ (H : i ≤ j),
              ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
          (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
            (∃ i x y,
                FreeCommRing.of { fst := i, snd := x + y } -
                    (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                  a) ∨
              ∃ i x y,
                FreeCommRing.of { fst := i, snd := x * y } -
                    FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                  a}
⊢ (FreeCommRing.lift fun x => (g x.fst) x.snd) x = 0

Next tactic:
exact (mem_bot P).1 (this hx)
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      

Proof state:
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
⊢ Ideal.span
      {a |
        (∃ i j,
            ∃ (H : i ≤ j),
              ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
          (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
            (∃ i x y,
                FreeCommRing.of { fst := i, snd := x + y } -
                    (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                  a) ∨
              ∃ i x y,
                FreeCommRing.of { fst := i, snd := x * y } -
                    FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                  a} ≤
    Ideal.comap (FreeCommRing.lift fun x => (g x.fst) x.snd) ⊥

Next tactic:
rw [Ideal.span_le]
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      rw [Ideal.span_le]
      

Proof state:
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
⊢ {a |
      (∃ i j,
          ∃ (H : i ≤ j),
            ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
        (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
          (∃ i x y,
              FreeCommRing.of { fst := i, snd := x + y } -
                  (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                a) ∨
            ∃ i x y,
              FreeCommRing.of { fst := i, snd := x * y } -
                  FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                a} ⊆
    ↑(Ideal.comap (FreeCommRing.lift fun x => (g x.fst) x.snd) ⊥)

Next tactic:
intro x hx
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      rw [Ideal.span_le]
      intro x hx
      

Proof state:
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
x : FreeCommRing ((i : ι) × G i)
hx :
  x ∈
    {a |
      (∃ i j,
          ∃ (H : i ≤ j),
            ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
        (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
          (∃ i x y,
              FreeCommRing.of { fst := i, snd := x + y } -
                  (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                a) ∨
            ∃ i x y,
              FreeCommRing.of { fst := i, snd := x * y } -
                  FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                a}
⊢ x ∈ ↑(Ideal.comap (FreeCommRing.lift fun x => (g x.fst) x.snd) ⊥)

Next tactic:
rw [SetLike.mem_coe, Ideal.mem_comap, mem_bot]
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      rw [Ideal.span_le]
      intro x hx
      rw [SetLike.mem_coe, Ideal.mem_comap, mem_bot]
      

Proof state:
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
x : FreeCommRing ((i : ι) × G i)
hx :
  x ∈
    {a |
      (∃ i j,
          ∃ (H : i ≤ j),
            ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
        (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
          (∃ i x y,
              FreeCommRing.of { fst := i, snd := x + y } -
                  (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                a) ∨
            ∃ i x y,
              FreeCommRing.of { fst := i, snd := x * y } -
                  FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                a}
⊢ (FreeCommRing.lift fun x => (g x.fst) x.snd) x = 0

Next tactic:
rcases hx with (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      rw [Ideal.span_le]
      intro x hx
      rw [SetLike.mem_coe, Ideal.mem_comap, mem_bot]
      rcases hx with (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩) <;>
        

Proof state:
case inl.intro.intro.intro.intro
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
i j : ι
hij : i ≤ j
x : G i
⊢ (FreeCommRing.lift fun x => (g x.fst) x.snd)
      (FreeCommRing.of { fst := j, snd := f i j hij x } - FreeCommRing.of { fst := i, snd := x }) =
    0

Next tactic:
simp only [RingHom.map_sub, lift_of, Hg, RingHom.map_one, RingHom.map_add, RingHom.map_mul,
          (g i).map_one, (g i).map_add, (g i).map_mul, sub_self]
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      rw [Ideal.span_le]
      intro x hx
      rw [SetLike.mem_coe, Ideal.mem_comap, mem_bot]
      rcases hx with (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩) <;>
        

Proof state:
case inr.inl.intro
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
i : ι
⊢ (FreeCommRing.lift fun x => (g x.fst) x.snd) (FreeCommRing.of { fst := i, snd := 1 } - 1) = 0

Next tactic:
simp only [RingHom.map_sub, lift_of, Hg, RingHom.map_one, RingHom.map_add, RingHom.map_mul,
          (g i).map_one, (g i).map_add, (g i).map_mul, sub_self]
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      rw [Ideal.span_le]
      intro x hx
      rw [SetLike.mem_coe, Ideal.mem_comap, mem_bot]
      rcases hx with (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩) <;>
        

Proof state:
case inr.inr.inl.intro.intro.intro
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
i : ι
x y : G i
⊢ (FreeCommRing.lift fun x => (g x.fst) x.snd)
      (FreeCommRing.of { fst := i, snd := x + y } -
        (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y })) =
    0

Next tactic:
simp only [RingHom.map_sub, lift_of, Hg, RingHom.map_one, RingHom.map_add, RingHom.map_mul,
          (g i).map_one, (g i).map_add, (g i).map_mul, sub_self]
/-- 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 :=
  Ideal.Quotient.lift _ (FreeCommRing.lift fun x : Σi, G i => g x.1 x.2)
    (by
      suffices Ideal.span _ ≤
          Ideal.comap (FreeCommRing.lift fun x : Σi : ι, G i => g x.fst x.snd) ⊥ by
        intro x hx
        exact (mem_bot P).1 (this hx)
      rw [Ideal.span_le]
      intro x hx
      rw [SetLike.mem_coe, Ideal.mem_comap, mem_bot]
      rcases hx with (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩) <;>
        

Proof state:
case inr.inr.inr.intro.intro.intro
R : Type u
inst✝³ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝² : Preorder ι
G : ι → Type w
inst✝¹ : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
i : ι
x y : G i
⊢ (FreeCommRing.lift fun x => (g x.fst) x.snd)
      (FreeCommRing.of { fst := i, snd := x * y } -
        FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y }) =
    0

Next tactic:
simp only [RingHom.map_sub, lift_of, Hg, RingHom.map_one, RingHom.map_add, RingHom.map_mul,
          (g i).map_one, (g i).map_add, (g i).map_mul, sub_self]
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 

Proof state:
R : Type u
inst✝⁴ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type w
inst✝² : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝¹ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →+* P
x✝ : DirectLimit G f
i j : ι
hij : i ≤ j
x : G i
⊢ ((fun i => RingHom.comp F (of G f i)) j) (f i j hij x) = ((fun i => RingHom.comp F (of G f i)) i) x

Next tactic:
simp [of_f]
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 := by
  

Proof state:
R : Type u
inst✝⁴ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type w
inst✝² : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝¹ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →+* P
x : DirectLimit G f
⊢ F x =
    (lift G f P (fun i => RingHom.comp F (of G f i))
        (_ : ∀ (i j : ι) (hij : i ≤ j) (x : G i), F ((of G f j) (f i j hij x)) = F ((of G f i) x)))
      x

Next tactic:
cases isEmpty_or_nonempty ι
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 := by
  cases isEmpty_or_nonempty ι
  · 

Proof state:
case inl
R : Type u
inst✝⁴ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type w
inst✝² : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝¹ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →+* P
x : DirectLimit G f
h✝ : IsEmpty ι
⊢ F x =
    (lift G f P (fun i => RingHom.comp F (of G f i))
        (_ : ∀ (i j : ι) (hij : i ≤ j) (x : G i), F ((of G f j) (f i j hij x)) = F ((of G f i) x)))
      x

Next tactic:
apply FunLike.congr_fun
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 := by
  cases isEmpty_or_nonempty ι
  · apply FunLike.congr_fun
    

Proof state:
case inl.h₁
R : Type u
inst✝⁴ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type w
inst✝² : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝¹ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →+* P
x : DirectLimit G f
h✝ : IsEmpty ι
⊢ F =
    lift G f P (fun i => RingHom.comp F (of G f i))
      (_ : ∀ (i j : ι) (hij : i ≤ j) (x : G i), F ((of G f j) (f i j hij x)) = F ((of G f i) x))

Next tactic:
apply Ideal.Quotient.ringHom_ext
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 := by
  cases isEmpty_or_nonempty ι
  · apply FunLike.congr_fun
    apply Ideal.Quotient.ringHom_ext
    

Proof state:
case inl.h₁.h
R : Type u
inst✝⁴ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type w
inst✝² : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝¹ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →+* P
x : DirectLimit G f
h✝ : IsEmpty ι
⊢ RingHom.comp F
      (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
              (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
                (∃ i x y,
                    FreeCommRing.of { fst := i, snd := x + y } -
                        (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                      a) ∨
                  ∃ i x y,
                    FreeCommRing.of { fst := i, snd := x * y } -
                        FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                      a})) =
    RingHom.comp
      (lift G f P (fun i => RingHom.comp F (of G f i))
        (_ : ∀ (i j : ι) (hij : i ≤ j) (x : G i), F ((of G f j) (f i j hij x)) = F ((of G f i) x)))
      (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
              (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
                (∃ i x y,
                    FreeCommRing.of { fst := i, snd := x + y } -
                        (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                      a) ∨
                  ∃ i x y,
                    FreeCommRing.of { fst := i, snd := x * y } -
                        FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                      a}))

Next tactic:
refine FreeCommRing.hom_ext fun ⟨i, _⟩ ↦ ?_
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 := by
  cases isEmpty_or_nonempty ι
  · apply FunLike.congr_fun
    apply Ideal.Quotient.ringHom_ext
    refine FreeCommRing.hom_ext fun ⟨i, _⟩ ↦ ?_
    

Proof state:
case inl.h₁.h
R : Type u
inst✝⁴ : Ring R
ι : Type v
dec_ι : DecidableEq ι
inst✝³ : Preorder ι
G : ι → Type w
inst✝² : (i : ι) → CommRing (G i)
f : (i j : ι) → i ≤ j → G i → G j
f' : (i j : ι) → i ≤ j → G i →+* G j
P : Type u₁
inst✝¹ : CommRing P
g : (i : ι) → G i →+* P
Hg : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) (f i j hij x) = (g i) x
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
F : DirectLimit G f →+* P
x : DirectLimit G f
h✝ : IsEmpty ι
x✝ : (i : ι) × G i
i : ι
snd✝ : G i
⊢ (RingHom.comp F
        (Ideal.Quotient.mk
          (Ideal.span
            {a |
              (∃ i j,
                  ∃ (H : i ≤ j),
                    ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
                (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
                  (∃ i x y,
                      FreeCommRing.of { fst := i, snd := x + y } -
                          (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                        a) ∨
                    ∃ i x y,
                      FreeCommRing.of { fst := i, snd := x * y } -
                          FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                        a})))
      (FreeCommRing.of { fst := i, snd := snd✝ }) =
    (RingHom.comp
        (lift G f P (fun i => RingHom.comp F (of G f i))
          (_ : ∀ (i j : ι) (hij : i ≤ j) (x : G i), F ((of G f j) (f i j hij x)) = F ((of G f i) x)))
        (Ideal.Quotient.mk
          (Ideal.span
            {a |
              (∃ i j,
                  ∃ (H : i ≤ j),
                    ∃ x, FreeCommRing.of { fst := j, snd := f i j H x } - FreeCommRing.of { fst := i, snd := x } = a) ∨
                (∃ i, FreeCommRing.of { fst := i, snd := 1 } - 1 = a) ∨
                  (∃ i x y,
                      FreeCommRing.of { fst := i, snd := x + y } -
                          (FreeCommRing.of { fst := i, snd := x } + FreeCommRing.of { fst := i, snd := y }) =
                        a) ∨
                    ∃ i x y,
                      FreeCommRing.of { fst := i, snd := x * y } -
                          FreeCommRing.of { fst := i, snd := x } * FreeCommRing.of { fst := i, snd := y } =
                        a})))
      (FreeCommRing.of { fst := i, snd := snd✝ })

Next tactic:
exact IsEmpty.elim' inferInstance i