Theorem: Nat.Linear.PolyCnstr.eq_false_of_isUnsat
File: src/lean/Init/Data/Nat/Linear.lean

tactic: cases c
state_before: ctx : Context
c : PolyCnstr
⊢ isUnsat c = true → denote ctx c = False

tactic: rename_i eq lhs rhs
state_before: case mk
ctx : Context
eq✝ : Bool
lhs✝ rhs✝ : Poly
⊢ isUnsat { eq := eq✝, lhs := lhs✝, rhs := rhs✝ } = true → denote ctx { eq := eq✝, lhs := lhs✝, rhs := rhs✝ } = False

tactic: simp [isUnsat]
state_before: case mk
ctx : Context
eq : Bool
lhs rhs : Poly
⊢ isUnsat { eq := eq, lhs := lhs, rhs := rhs } = true → denote ctx { eq := eq, lhs := lhs, rhs := rhs } = False

tactic: by_cases he : eq = true <;> simp [he, denote, Poly.denote_eq, Poly.denote_le]
state_before: case mk
ctx : Context
eq : Bool
lhs rhs : Poly
⊢ (bif eq then Poly.isZero lhs && Poly.isNonZero rhs || Poly.isNonZero lhs && Poly.isZero rhs
      else Poly.isNonZero lhs && Poly.isZero rhs) =
      true →
    denote ctx { eq := eq, lhs := lhs, rhs := rhs } = False

tactic: intro
  | Or.inl ⟨h₁, h₂⟩ => simp [Poly.of_isZero, h₁]; have := Nat.not_eq_zero_of_lt (Poly.of_isNonZero ctx h₂); simp [this.symm]
  | Or.inr ⟨h₁, h₂⟩ => simp [Poly.of_isZero, h₂]; have := Nat.not_eq_zero_of_lt (Poly.of_isNonZero ctx h₁); simp [this]
state_before: case mk.inl
ctx : Context
eq : Bool
lhs rhs : Poly
he : eq = true
⊢ Poly.isZero lhs = true ∧ Poly.isNonZero rhs = true ∨ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true →
    (Poly.denote ctx lhs = Poly.denote ctx rhs) = False

tactic: simp [Poly.of_isZero, h₁]
state_before: ctx : Context
eq : Bool
lhs rhs : Poly
he : eq = true
x✝ : Poly.isZero lhs = true ∧ Poly.isNonZero rhs = true ∨ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true
h₁ : Poly.isZero lhs = true
h₂ : Poly.isNonZero rhs = true
⊢ (Poly.denote ctx lhs = Poly.denote ctx rhs) = False

tactic: have := Nat.not_eq_zero_of_lt (Poly.of_isNonZero ctx h₂)
state_before: ctx : Context
eq : Bool
lhs rhs : Poly
he : eq = true
x✝ : Poly.isZero lhs = true ∧ Poly.isNonZero rhs = true ∨ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true
h₁ : Poly.isZero lhs = true
h₂ : Poly.isNonZero rhs = true
⊢ (0 = Poly.denote ctx rhs) = False

tactic: simp [this.symm]
state_before: ctx : Context
eq : Bool
lhs rhs : Poly
he : eq = true
x✝ : Poly.isZero lhs = true ∧ Poly.isNonZero rhs = true ∨ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true
h₁ : Poly.isZero lhs = true
h₂ : Poly.isNonZero rhs = true
this : Poly.denote ctx rhs ≠ 0
⊢ (0 = Poly.denote ctx rhs) = False

tactic: simp [Poly.of_isZero, h₂]
state_before: ctx : Context
eq : Bool
lhs rhs : Poly
he : eq = true
x✝ : Poly.isZero lhs = true ∧ Poly.isNonZero rhs = true ∨ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true
h₁ : Poly.isNonZero lhs = true
h₂ : Poly.isZero rhs = true
⊢ (Poly.denote ctx lhs = Poly.denote ctx rhs) = False

tactic: have := Nat.not_eq_zero_of_lt (Poly.of_isNonZero ctx h₁)
state_before: ctx : Context
eq : Bool
lhs rhs : Poly
he : eq = true
x✝ : Poly.isZero lhs = true ∧ Poly.isNonZero rhs = true ∨ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true
h₁ : Poly.isNonZero lhs = true
h₂ : Poly.isZero rhs = true
⊢ (Poly.denote ctx lhs = 0) = False

tactic: simp [this]
state_before: ctx : Context
eq : Bool
lhs rhs : Poly
he : eq = true
x✝ : Poly.isZero lhs = true ∧ Poly.isNonZero rhs = true ∨ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true
h₁ : Poly.isNonZero lhs = true
h₂ : Poly.isZero rhs = true
this : Poly.denote ctx lhs ≠ 0
⊢ (Poly.denote ctx lhs = 0) = False

tactic: intro ⟨h₁, h₂⟩
state_before: case mk.inr
ctx : Context
eq : Bool
lhs rhs : Poly
he : ¬eq = true
⊢ Poly.isNonZero lhs = true ∧ Poly.isZero rhs = true → (Poly.denote ctx lhs ≤ Poly.denote ctx rhs) = False

tactic: simp [Poly.of_isZero, h₂]
state_before: case mk.inr
ctx : Context
eq : Bool
lhs rhs : Poly
he : ¬eq = true
h₁ : Poly.isNonZero lhs = true
h₂ : Poly.isZero rhs = true
⊢ (Poly.denote ctx lhs ≤ Poly.denote ctx rhs) = False

tactic: have := Nat.not_eq_zero_of_lt (Poly.of_isNonZero ctx h₁)
state_before: case mk.inr
ctx : Context
eq : Bool
lhs rhs : Poly
he : ¬eq = true
h₁ : Poly.isNonZero lhs = true
h₂ : Poly.isZero rhs = true
⊢ (Poly.denote ctx lhs = 0) = False

tactic: simp [this]
state_before: case mk.inr
ctx : Context
eq : Bool
lhs rhs : Poly
he : ¬eq = true
h₁ : Poly.isNonZero lhs = true
h₂ : Poly.isZero rhs = true
this : Poly.denote ctx lhs ≠ 0
⊢ (Poly.denote ctx lhs = 0) = False