l3lab/ntp-mathlib huggingface dataset:
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · 

Proof state:
case refine'_1.inl.intro.intro.intro.intro.refine'_1
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x✝ : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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✝ =
    0
i j : ι
hij : i ≤ j
x : G i
⊢ ∀ k ∈ {{ fst := i, snd := x }, { fst := j, snd := (fun i j h => ⇑(f' i j h)) i j hij x }}, k.fst ≤ j

Next tactic:
rintro k (rfl | ⟨rfl | _⟩)
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        

Proof state:
case refine'_1.inl.intro.intro.intro.intro.refine'_1.inr.refl
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x✝ : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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✝ =
    0
i j : ι
hij : i ≤ j
x : G i
⊢ { fst := j, snd := (fun i j h => ⇑(f' i j h)) i j hij x }.fst ≤ j

Next tactic:
rfl
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        rfl
      · 

Proof state:
case refine'_1.inl.intro.intro.intro.intro.refine'_2
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x✝ : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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✝ =
    0
i j : ι
hij : i ≤ j
x : G i
⊢ (lift fun ix => (f' (↑ix).fst j (_ : (↑ix).fst ≤ j)) (↑ix).snd)
      ((restriction {{ fst := i, snd := x }, { fst := j, snd := (fun i j h => ⇑(f' i j h)) i j hij x }})
        (FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) i j hij x } -
          FreeCommRing.of { fst := i, snd := x })) =
    0

Next tactic:
rw [(restriction _).map_sub, RingHom.map_sub, restriction_of, dif_pos,
          restriction_of, dif_pos, lift_of, lift_of]
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        rfl
      · rw [(restriction _).map_sub, RingHom.map_sub, restriction_of, dif_pos,
          restriction_of, dif_pos, lift_of, lift_of]
        dsimp only
        have := DirectedSystem.map_map (fun i j h => f' i j h) hij (le_refl j : j ≤ j)
        rw [this]
        exact sub_self _
        exacts [Or.inr rfl, Or.inl rfl]
    · 

Proof state:
case refine'_1.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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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 =
    0
i : ι
⊢ ∃ j s,
    ∃ (H : ∀ k ∈ s, k.fst ≤ j),
      IsSupported (FreeCommRing.of { fst := i, snd := 1 } - 1) s ∧
        (lift fun ix => (f' (↑ix).fst j (_ : (↑ix).fst ≤ j)) (↑ix).snd)
            ((restriction s) (FreeCommRing.of { fst := i, snd := 1 } - 1)) =
          0

Next tactic:
refine' ⟨i, {⟨i, 1⟩}, _, isSupported_sub (isSupported_of.2 rfl) isSupported_one, _⟩
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        rfl
      · rw [(restriction _).map_sub, RingHom.map_sub, restriction_of, dif_pos,
          restriction_of, dif_pos, lift_of, lift_of]
        dsimp only
        have := DirectedSystem.map_map (fun i j h => f' i j h) hij (le_refl j : j ≤ j)
        rw [this]
        exact sub_self _
        exacts [Or.inr rfl, Or.inl rfl]
    · refine' ⟨i, {⟨i, 1⟩}, _, isSupported_sub (isSupported_of.2 rfl) isSupported_one, _⟩
      · 

Proof state:
case refine'_1.inr.inl.intro.refine'_1
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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 =
    0
i : ι
⊢ ∀ k ∈ {{ fst := i, snd := 1 }}, k.fst ≤ i

Next tactic:
rintro k (rfl | h)
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        rfl
      · rw [(restriction _).map_sub, RingHom.map_sub, restriction_of, dif_pos,
          restriction_of, dif_pos, lift_of, lift_of]
        dsimp only
        have := DirectedSystem.map_map (fun i j h => f' i j h) hij (le_refl j : j ≤ j)
        rw [this]
        exact sub_self _
        exacts [Or.inr rfl, Or.inl rfl]
    · refine' ⟨i, {⟨i, 1⟩}, _, isSupported_sub (isSupported_of.2 rfl) isSupported_one, _⟩
      · rintro k (rfl | h)
        

Proof state:
case refine'_1.inr.inl.intro.refine'_1.refl
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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 =
    0
i : ι
⊢ { fst := i, snd := 1 }.fst ≤ i

Next tactic:
rfl
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        rfl
      · rw [(restriction _).map_sub, RingHom.map_sub, restriction_of, dif_pos,
          restriction_of, dif_pos, lift_of, lift_of]
        dsimp only
        have := DirectedSystem.map_map (fun i j h => f' i j h) hij (le_refl j : j ≤ j)
        rw [this]
        exact sub_self _
        exacts [Or.inr rfl, Or.inl rfl]
    · refine' ⟨i, {⟨i, 1⟩}, _, isSupported_sub (isSupported_of.2 rfl) isSupported_one, _⟩
      · rintro k (rfl | h)
        rfl
        -- porting note: the Lean3 proof contained `rw [restriction_of]`, but this
        -- lemma does not seem to work here
      · 

Proof state:
case refine'_1.inr.inl.intro.refine'_2
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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 =
    0
i : ι
⊢ (lift fun ix => (f' (↑ix).fst i (_ : (↑ix).fst ≤ i)) (↑ix).snd)
      ((restriction {{ fst := i, snd := 1 }}) (FreeCommRing.of { fst := i, snd := 1 } - 1)) =
    0

Next tactic:
rw [RingHom.map_sub, RingHom.map_sub]
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        rfl
      · rw [(restriction _).map_sub, RingHom.map_sub, restriction_of, dif_pos,
          restriction_of, dif_pos, lift_of, lift_of]
        dsimp only
        have := DirectedSystem.map_map (fun i j h => f' i j h) hij (le_refl j : j ≤ j)
        rw [this]
        exact sub_self _
        exacts [Or.inr rfl, Or.inl rfl]
    · refine' ⟨i, {⟨i, 1⟩}, _, isSupported_sub (isSupported_of.2 rfl) isSupported_one, _⟩
      · rintro k (rfl | h)
        rfl
        -- porting note: the Lean3 proof contained `rw [restriction_of]`, but this
        -- lemma does not seem to work here
      · rw [RingHom.map_sub, RingHom.map_sub]
        

Proof state:
case refine'_1.inr.inl.intro.refine'_2
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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 =
    0
i : ι
⊢ (lift fun ix => (f' (↑ix).fst i (_ : (↑ix).fst ≤ i)) (↑ix).snd)
        ((restriction {{ fst := i, snd := 1 }}) (FreeCommRing.of { fst := i, snd := 1 })) -
      (lift fun ix => (f' (↑ix).fst i (_ : (↑ix).fst ≤ i)) (↑ix).snd) ((restriction {{ fst := i, snd := 1 }}) 1) =
    0

Next tactic:
erw [lift_of, dif_pos rfl, RingHom.map_one, lift_of, RingHom.map_one, sub_self]
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 ∧
          lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j) := by
  refine' span_induction (Ideal.Quotient.eq_zero_iff_mem.1 H) _ _ _ _
  · rintro x (⟨i, j, hij, x, rfl⟩ | ⟨i, rfl⟩ | ⟨i, x, y, rfl⟩ | ⟨i, x, y, rfl⟩)
    · refine'
        ⟨j, {⟨i, x⟩, ⟨j, f' i j hij x⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inr rfl) (isSupported_of.2 <| Or.inl rfl), _⟩
      · rintro k (rfl | ⟨rfl | _⟩)
        exact hij
        rfl
      · rw [(restriction _).map_sub, RingHom.map_sub, restriction_of, dif_pos,
          restriction_of, dif_pos, lift_of, lift_of]
        dsimp only
        have := DirectedSystem.map_map (fun i j h => f' i j h) hij (le_refl j : j ≤ j)
        rw [this]
        exact sub_self _
        exacts [Or.inr rfl, Or.inl rfl]
    · refine' ⟨i, {⟨i, 1⟩}, _, isSupported_sub (isSupported_of.2 rfl) isSupported_one, _⟩
      · rintro k (rfl | h)
        rfl
        -- porting note: the Lean3 proof contained `rw [restriction_of]`, but this
        -- lemma does not seem to work here
      · rw [RingHom.map_sub, RingHom.map_sub]
        erw [lift_of, dif_pos rfl, RingHom.map_one, lift_of, RingHom.map_one, sub_self]
    · refine'
        ⟨i, {⟨i, x + y⟩, ⟨i, x⟩, ⟨i, y⟩}, _,
          isSupported_sub (isSupported_of.2 <| Or.inl rfl)
            (isSupported_add (isSupported_of.2 <| Or.inr <| Or.inl rfl)
              (isSupported_of.2 <| Or.inr <| Or.inr rfl)),
          _⟩
      · 

Proof state:
case refine'_1.inr.inr.inl.intro.intro.intro.refine'_1
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
inst✝² : DirectedSystem G fun i j h => ⇑(f' i j h)
inst✝¹ : Nonempty ι
inst✝ : IsDirected ι fun x x_1 => x ≤ x_1
x✝ : FreeCommRing ((i : ι) × G i)
H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x,
                    FreeCommRing.of { fst := j, snd := (fun i j h => ⇑(f' i j h)) 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✝ =
    0
i : ι
x y : G i
⊢ ∀ k ∈ {{ fst := i, snd := x + y }, { fst := i, snd := x }, { fst := i, snd := y }}, k.fst ≤ i

Next tactic:
rintro k (rfl | ⟨rfl | ⟨rfl | hk⟩⟩)