l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        

Proof state:
case nil.h
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
r : reduce L1 = []
h : [(x, b)] = L2 ++ (x', b') :: (x', !b') :: L3
this : 1 = 1 + 1 + List.length L2 + List.length L3
⊢ False

Next tactic:
simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        

Proof state:
case nil.h
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
r : reduce L1 = []
h : [(x, b)] = L2 ++ (x', b') :: (x', !b') :: L3
this : 0 = List.length L2 + List.length L3 + Nat.succ 0
⊢ False

Next tactic:
cases this
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      

Proof state:
case cons
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
hd : α × Bool
tail : List (α × Bool)
r : reduce L1 = hd :: tail
⊢ List.rec [(x, b)] (fun head tail tail_ih => if x = head.1 ∧ b = !head.2 then tail else (x, b) :: head :: tail)
        (hd :: tail) =
      L2 ++ (x', b') :: (x', !b') :: L3 →
    p

Next tactic:
| cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · rcases L2 with ( _ | ⟨ a , L2 ⟩ )
          · injections
            subst_vars
            simp at h
          · refine' @reduce.not _ L1 L2 L3 x' b' _
            injection H with _ H
            rw [ r , H ]
            rfl
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        

Proof state:
case cons
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
hd : α × Bool
tail : List (α × Bool)
r : reduce L1 = hd :: tail
⊢ List.rec [(x, b)] (fun head tail tail_ih => if x = head.1 ∧ b = !head.2 then tail else (x, b) :: head :: tail)
        (hd :: tail) =
      L2 ++ (x', b') :: (x', !b') :: L3 →
    p

Next tactic:
cases' hd with y c
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        

Proof state:
case cons.mk
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
⊢ List.rec [(x, b)] (fun head tail tail_ih => if x = head.1 ∧ b = !head.2 then tail else (x, b) :: head :: tail)
        ((y, c) :: tail) =
      L2 ++ (x', b') :: (x', !b') :: L3 →
    p

Next tactic:
dsimp only
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        

Proof state:
case cons.mk
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
⊢ (if x = y ∧ b = !c then tail else (x, b) :: (y, c) :: tail) = L2 ++ (x', b') :: (x', !b') :: L3 → p

Next tactic:
split_ifs with h
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> 

Proof state:
case pos
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : x = y ∧ b = !c
⊢ tail = L2 ++ (x', b') :: (x', !b') :: L3 → p

Next tactic:
intro H
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> 

Proof state:
case neg
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : ¬(x = y ∧ b = !c)
⊢ (x, b) :: (y, c) :: tail = L2 ++ (x', b') :: (x', !b') :: L3 → p

Next tactic:
intro H
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · 

Proof state:
case pos
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : x = y ∧ b = !c
H : tail = L2 ++ (x', b') :: (x', !b') :: L3
⊢ p

Next tactic:
rw [ H ] at r
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          

Proof state:
case pos
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: (L2 ++ (x', b') :: (x', !b') :: L3)
h : x = y ∧ b = !c
H : tail = L2 ++ (x', b') :: (x', !b') :: L3
⊢ p

Next tactic:
exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · 

Proof state:
case neg
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L2 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : ¬(x = y ∧ b = !c)
H : (x, b) :: (y, c) :: tail = L2 ++ (x', b') :: (x', !b') :: L3
⊢ p

Next tactic:
rcases L2 with ( _ | ⟨ a , L2 ⟩ )
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · rcases L2 with ( _ | ⟨ a , L2 ⟩ )
          · 

Proof state:
case neg.nil
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : ¬(x = y ∧ b = !c)
H : (x, b) :: (y, c) :: tail = [] ++ (x', b') :: (x', !b') :: L3
⊢ p

Next tactic:
injections
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · rcases L2 with ( _ | ⟨ a , L2 ⟩ )
          · injections
            

Proof state:
case neg.nil
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : ¬(x = y ∧ b = !c)
fst_eq✝¹ : x = x'
snd_eq✝¹ : b = b'
tail_eq✝ : tail = L3
fst_eq✝ : y = x'
snd_eq✝ : c = !b'
⊢ p

Next tactic:
subst_vars
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · rcases L2 with ( _ | ⟨ a , L2 ⟩ )
          · injections
            subst_vars
            

Proof state:
case neg.nil
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
L1 : List (α × Bool)
b' : Bool
tail : List (α × Bool)
y : α
r : reduce L1 = (y, !b') :: tail
h : ¬(y = y ∧ b' = !!b')
⊢ p

Next tactic:
simp at h
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · rcases L2 with ( _ | ⟨ a , L2 ⟩ )
          · injections
            subst_vars
            simp at h
          · 

Proof state:
case neg.cons
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : ¬(x = y ∧ b = !c)
a : α × Bool
L2 : List (α × Bool)
H : (x, b) :: (y, c) :: tail = a :: L2 ++ (x', b') :: (x', !b') :: L3
⊢ p

Next tactic:
refine' @reduce.not _ L1 L2 L3 x' b' _
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · rcases L2 with ( _ | ⟨ a , L2 ⟩ )
          · injections
            subst_vars
            simp at h
          · refine' @reduce.not _ L1 L2 L3 x' b' _
            

Proof state:
case neg.cons
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : ¬(x = y ∧ b = !c)
a : α × Bool
L2 : List (α × Bool)
H : (x, b) :: (y, c) :: tail = a :: L2 ++ (x', b') :: (x', !b') :: L3
⊢ reduce L1 = L2 ++ (x', b') :: (x', !b') :: L3

Next tactic:
injection H with _ H
@[to_additive]
theorem reduce.not {p : Prop} : ∀ {L₁ L₂ L₃ : List (α × Bool)} {x : α} {b},
    ((reduce L₁) = L₂ ++ ((x,b)::(x ,!b)::L₃)) → p
  | [], L2 ,L3, _, _ => fun h => by cases L2 <;> injections
  | (x, b)::L1, L2, L3, x', b' => by
      dsimp
      cases r : reduce L1 with
      | nil =>
        dsimp
        intro h
        exfalso
        have := congr_arg List.length h
        simp? [List.length] at this says
         simp only [List.length, zero_add, List.length_append] at this
        rw [add_comm, add_assoc, add_assoc, add_comm, <-add_assoc] at this
        simp [Nat.one_eq_succ_zero, Nat.succ_add] at this
        -- Porting note: needed to add this step in #3414.
        -- This is caused by https://github.com/leanprover/lean4/pull/2146.
        -- Nevertheless the proof could be cleaned up.
        cases this
      | cons hd tail =>
        cases' hd with y c
        dsimp only
        split_ifs with h <;> intro H
        · rw [ H ] at r
          exact @reduce.not _ L1 ((y, c)::L2) L3 x' b' r
        · rcases L2 with ( _ | ⟨ a , L2 ⟩ )
          · injections
            subst_vars
            simp at h
          · refine' @reduce.not _ L1 L2 L3 x' b' _
            injection H with _ H
            

Proof state:
case neg.cons
α : Type u
L L₁ L₂ L₃ L₄ : List (α × Bool)
inst✝ : DecidableEq α
p : Prop
x : α
b : Bool
L1 L3 : List (α × Bool)
x' : α
b' : Bool
tail : List (α × Bool)
y : α
c : Bool
r : reduce L1 = (y, c) :: tail
h : ¬(x = y ∧ b = !c)
a : α × Bool
L2 : List (α × Bool)
head_eq✝ : (x, b) = a
H : (y, c) :: tail = List.append L2 ((x', b') :: (x', !b') :: L3)
⊢ reduce L1 = L2 ++ (x', b') :: (x', !b') :: L3

Next tactic:
rw [ r , H ]