Theorem: LRAT.DefaultFormula.mem_insertUnit_units (LeanSAT/LRAT/Formula/RupAddSound.lean)

State before:
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
⊢ let insertUnit_res := insertUnit (units, assignments, foundContradiction) l;
  ∀ (l' : Literal (PosFin n)), l' ∈ insertUnit_res.fst.data → l' = l ∨ l' ∈ units.data
Tactic:
intro insertUnit_res l' l'_in_insertUnit_res
State after:
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
l'_in_insertUnit_res : l' ∈ insertUnit_res.fst.data
⊢ l' = l ∨ l' ∈ units.data

State before:
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
l'_in_insertUnit_res : l' ∈ insertUnit_res.fst.data
⊢ l' = l ∨ l' ∈ units.data
Tactic:
simp only [insertUnit_res] at *
State after:
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
l'_in_insertUnit_res : l' ∈ (insertUnit (units, assignments, foundContradiction) l).fst.data
⊢ l' = l ∨ l' ∈ units.data

State before:
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
l'_in_insertUnit_res : l' ∈ (insertUnit (units, assignments, foundContradiction) l).fst.data
⊢ l' = l ∨ l' ∈ units.data
Tactic:
simp only [insertUnit, Prod.mk.eta] at l'_in_insertUnit_res
State after:
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
l'_in_insertUnit_res :
  l' ∈
    (if hasAssignment l.snd assignments[l.fst.val]! = true then (units, assignments, foundContradiction)
        else
          (units.push l, assignments.modify l.fst.val (addAssignment l.snd),
            foundContradiction || assignments[l.fst.val]! != unassigned)).fst.data
⊢ l' = l ∨ l' ∈ units.data

State before:
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
l'_in_insertUnit_res :
  l' ∈
    (if hasAssignment l.snd assignments[l.fst.val]! = true then (units, assignments, foundContradiction)
        else
          (units.push l, assignments.modify l.fst.val (addAssignment l.snd),
            foundContradiction || assignments[l.fst.val]! != unassigned)).fst.data
⊢ l' = l ∨ l' ∈ units.data
Tactic:
split at l'_in_insertUnit_res
State after:
case isTrue
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res : l' ∈ (units, assignments, foundContradiction).fst.data
⊢ l' = l ∨ l' ∈ units.data

case isFalse
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : ¬hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res :
  l' ∈
    (units.push l, assignments.modify l.fst.val (addAssignment l.snd),
          foundContradiction || assignments[l.fst.val]! != unassigned).fst.data
⊢ l' = l ∨ l' ∈ units.data

State before:
case isTrue
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res : l' ∈ (units, assignments, foundContradiction).fst.data
⊢ l' = l ∨ l' ∈ units.data

case isFalse
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : ¬hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res :
  l' ∈
    (units.push l, assignments.modify l.fst.val (addAssignment l.snd),
          foundContradiction || assignments[l.fst.val]! != unassigned).fst.data
⊢ l' = l ∨ l' ∈ units.data
Tactic:
. exact Or.inr l'_in_insertUnit_res
State after:
case isFalse
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : ¬hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res :
  l' ∈
    (units.push l, assignments.modify l.fst.val (addAssignment l.snd),
          foundContradiction || assignments[l.fst.val]! != unassigned).fst.data
⊢ l' = l ∨ l' ∈ units.data

State before:
case isFalse
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : ¬hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res :
  l' ∈
    (units.push l, assignments.modify l.fst.val (addAssignment l.snd),
          foundContradiction || assignments[l.fst.val]! != unassigned).fst.data
⊢ l' = l ∨ l' ∈ units.data
Tactic:
. simp only [Array.push_data, List.mem_append, List.mem_singleton] at l'_in_insertUnit_res
  exact Or.symm l'_in_insertUnit_res
State after:
no goals

State before:
case isTrue
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res : l' ∈ (units, assignments, foundContradiction).fst.data
⊢ l' = l ∨ l' ∈ units.data
Tactic:
exact Or.inr l'_in_insertUnit_res
State after:
no goals

State before:
case isFalse
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : ¬hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res :
  l' ∈
    (units.push l, assignments.modify l.fst.val (addAssignment l.snd),
          foundContradiction || assignments[l.fst.val]! != unassigned).fst.data
⊢ l' = l ∨ l' ∈ units.data
Tactic:
simp only [Array.push_data, List.mem_append, List.mem_singleton] at l'_in_insertUnit_res
State after:
case isFalse
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : ¬hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res : l' ∈ units.data ∨ l' = l
⊢ l' = l ∨ l' ∈ units.data

State before:
case isFalse
n : Nat
units : Array (Literal (PosFin n))
assignments : Array Assignment
foundContradiction : Bool
l : Literal (PosFin n)
insertUnit_res : Array (Literal (PosFin n)) × Array Assignment × Bool :=
  insertUnit (units, assignments, foundContradiction) l
l' : Literal (PosFin n)
h✝ : ¬hasAssignment l.snd assignments[l.fst.val]! = true
l'_in_insertUnit_res : l' ∈ units.data ∨ l' = l
⊢ l' = l ∨ l' ∈ units.data
Tactic:
exact Or.symm l'_in_insertUnit_res
State after:
no goals