-- Mathlib/.lake/packages/lean4/src/lean/Std/Tactic/BVDecide/LRAT/Internal/Formula/Lemmas.lean
theorem mem_of_insertRupUnits {n : Nat} (f : DefaultFormula n) (units : CNF.Clause (PosFin n))
    (c : DefaultClause n) :
    c ∈ toList (insertRupUnits f units).1 → c ∈ units.map Clause.unit ∨ c ∈ toList f

Proof state:
n : Nat
f : DefaultFormula n
units : CNF.Clause (PosFin n)
c : DefaultClause n
h :
  some c ∈ f.clauses.toList ∨
    (∃ a,
        (a, false) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧ unit (a, false) = c ∨
          (a, true) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧
            unit (a, true) = c) ∨
      ∃ a, (a, false) ∈ f.ratUnits.toList ∧ unit (a, false) = c ∨ (a, true) ∈ f.ratUnits.toList ∧ unit (a, true) = c
⊢ (∃ a, (a, false) ∈ units ∧ Clause.unit (a, false) = c ∨ (a, true) ∈ units ∧ Clause.unit (a, true) = c) ∨
    some c ∈ f.clauses.toList ∨
      (∃ a, (a, false) ∈ f.rupUnits.toList ∧ unit (a, false) = c ∨ (a, true) ∈ f.rupUnits.toList ∧ unit (a, true) = c) ∨
        ∃ a, (a, false) ∈ f.ratUnits.toList ∧ unit (a, false) = c ∨ (a, true) ∈ f.ratUnits.toList ∧ unit (a, true) = c

Tactic:
have hb : ∀ l : Literal (PosFin n), l ∈ (f.rupUnits, f.assignments, false).1.toList → (l ∈ f.rupUnits.toList ∨ l ∈ units) := by
  intro l hl
  exact Or.inl hl

Result:
n : Nat
f : DefaultFormula n
units : CNF.Clause (PosFin n)
c : DefaultClause n
h :
  some c ∈ f.clauses.toList ∨
    (∃ a,
        (a, false) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧ unit (a, false) = c ∨
          (a, true) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧
            unit (a, true) = c) ∨
      ∃ a, (a, false) ∈ f.ratUnits.toList ∧ unit (a, false) = c ∨ (a, true) ∈ f.ratUnits.toList ∧ unit (a, true) = c
hb : ∀ (l : Literal (PosFin n)), l ∈ (f.rupUnits, f.assignments, false).fst.toList → l ∈ f.rupUnits.toList ∨ l ∈ units
⊢ (∃ a, (a, false) ∈ units ∧ Clause.unit (a, false) = c ∨ (a, true) ∈ units ∧ Clause.unit (a, true) = c) ∨
    some c ∈ f.clauses.toList ∨
      (∃ a, (a, false) ∈ f.rupUnits.toList ∧ unit (a, false) = c ∨ (a, true) ∈ f.rupUnits.toList ∧ unit (a, true) = c) ∨
        ∃ a, (a, false) ∈ f.ratUnits.toList ∧ unit (a, false) = c ∨ (a, true) ∈ f.ratUnits.toList ∧ unit (a, true) = c

Proof state:
n : Nat
f : DefaultFormula n
units : CNF.Clause (PosFin n)
c : DefaultClause n
h :
  some c ∈ f.clauses.toList ∨
    (∃ a,
        (a, false) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧
            Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, false) = c ∨
          (a, true) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧
            Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, true) = c) ∨
      ∃ a,
        (a, false) ∈ f.ratUnits.toList ∧ Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, false) = c ∨
          (a, true) ∈ f.ratUnits.toList ∧ Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, true) = c
hb : ∀ (l : Literal (PosFin n)), l ∈ (f.rupUnits, f.assignments, false).fst.toList → l ∈ f.rupUnits.toList ∨ l ∈ units
acc : Array (Literal (PosFin n)) × Array Assignment × Bool
ih : ∀ (l : Literal (PosFin n)), l ∈ acc.fst.toList → l ∈ f.rupUnits.toList ∨ l ∈ units
unit : Literal (PosFin n)
unit_in_units : unit ∈ units
l : Literal (PosFin n)
hl : l ∈ (insertUnit acc unit).fst.toList
⊢ l ∈ f.rupUnits.toList ∨ l ∈ units

Tactic:
rw [insertUnit.eq_def] at hl

Result:
n : Nat
f : DefaultFormula n
units : CNF.Clause (PosFin n)
c : DefaultClause n
h :
  some c ∈ f.clauses.toList ∨
    (∃ a,
        (a, false) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧
            Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, false) = c ∨
          (a, true) ∈ (List.foldl insertUnit (f.rupUnits, f.assignments, false) units).fst.toList ∧
            Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, true) = c) ∨
      ∃ a,
        (a, false) ∈ f.ratUnits.toList ∧ Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, false) = c ∨
          (a, true) ∈ f.ratUnits.toList ∧ Std.Tactic.BVDecide.LRAT.Internal.DefaultClause.unit (a, true) = c
hb : ∀ (l : Literal (PosFin n)), l ∈ (f.rupUnits, f.assignments, false).fst.toList → l ∈ f.rupUnits.toList ∨ l ∈ units
acc : Array (Literal (PosFin n)) × Array Assignment × Bool
ih : ∀ (l : Literal (PosFin n)), l ∈ acc.fst.toList → l ∈ f.rupUnits.toList ∨ l ∈ units
unit : Literal (PosFin n)
unit_in_units : unit ∈ units
l : Literal (PosFin n)
hl :
  l ∈
    (match acc with
        | (units, assignments, foundContradiction) =>
          match unit with
          | (l, b) =>
            let curAssignment := assignments[l.val]!;
            if hasAssignment b curAssignment = true then (units, assignments, foundContradiction)
            else
              (units.push (l, b), assignments.modify l.val (addAssignment b),
                foundContradiction || curAssignment != unassigned)).fst.toList
⊢ l ∈ f.rupUnits.toList ∨ l ∈ units