Theorem: AIG.toCNF.denote_as_go (LeanSAT/AIG/CNF.lean)

State before:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
⊢ ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false →
    CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false
Tactic:
intro h
State after:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false

State before:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false
Tactic:
match heval1:(go aig start h1 (State.empty aig)).val.cnf.eval assign with
| true =>
  have heval2 := (go aig start h1 (.empty aig)).val.cache.inv.heval
  specialize heval2 assign heval1 start h1 go_marked
  simp [h] at heval2
  simp [heval2]
| false =>
  simp [heval1]
State after:
no goals

State before:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false
Tactic:
have heval2 := (go aig start h1 (.empty aig)).val.cache.inv.heval
State after:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true
heval2 :
  ∀ (assign : aig.CNFVar → Bool),
    CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true →
      ∀ (idx : Nat) (hbound : idx < aig.decls.size),
        (go aig start h1 (State.empty aig)).val.cache.marks[idx] = true →
          ⟦{ aig := aig, ref := { gate := idx, hgate := hbound } }, projectLeftAssign assign⟧ =
            projectRightAssign assign idx hbound
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false

State before:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true
heval2 :
  ∀ (assign : aig.CNFVar → Bool),
    CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true →
      ∀ (idx : Nat) (hbound : idx < aig.decls.size),
        (go aig start h1 (State.empty aig)).val.cache.marks[idx] = true →
          ⟦{ aig := aig, ref := { gate := idx, hgate := hbound } }, projectLeftAssign assign⟧ =
            projectRightAssign assign idx hbound
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false
Tactic:
specialize heval2 assign heval1 start h1 go_marked
State after:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true
heval2 :
  ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = projectRightAssign assign start h1
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false

State before:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true
heval2 :
  ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = projectRightAssign assign start h1
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false
Tactic:
simp [h] at heval2
State after:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true
heval2 : assign (Sum.inr ⟨start, h1⟩) = false
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false

State before:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = true
heval2 : assign (Sum.inr ⟨start, h1⟩) = false
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false
Tactic:
simp [heval2]
State after:
no goals

State before:
aig : AIG Nat
start : Nat
h1 : start < aig.decls.size
assign : aig.CNFVar → Bool
h : ⟦{ aig := aig, ref := { gate := start, hgate := h1 } }, projectLeftAssign assign⟧ = false
heval1 : CNF.eval assign (go aig start h1 (State.empty aig)).val.cnf = false
⊢ CNF.eval assign ([(Sum.inr ⟨start, h1⟩, true)] :: (go aig start h1 (State.empty aig)).val.cnf) = false
Tactic:
simp [heval1]
State after:
no goals