File: .lake/packages/lean4/src/lean/Lean/Elab/Tactic/Omega/Frontend.lean

full_name: Lean.Elab.Tactic.Omega.eval._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Omega.Frontend._hyg.6
code: /--
Allow elaboration of `OmegaConfig` arguments to tactics.
-/
declare_config_elab elabOmegaConfig Lean.Meta.Omega.OmegaConfig
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.Omega.OmegaConfig

full_name: Lean.Elab.Tactic.Omega.elabOmegaConfig
code: /--
Allow elaboration of `OmegaConfig` arguments to tactics.
-/
declare_config_elab elabOmegaConfig Lean.Meta.Omega.OmegaConfig
goal: Lean.Syntax → Lean.Elab.TermElabM Lean.Meta.Omega.OmegaConfig

full_name: Lean.Elab.Tactic.Omega.evalUnsafe._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Omega.Frontend._hyg.6
code: /--
Allow elaboration of `OmegaConfig` arguments to tactics.
-/
declare_config_elab elabOmegaConfig Lean.Meta.Omega.OmegaConfig
goal: Lean.Expr → Lean.Elab.TermElabM Lean.Meta.Omega.OmegaConfig

full_name: Lean.Elab.Tactic.Omega.succ?
code: /-- Match on the two defeq expressions for successor: `n+1`, `n.succ`. -/
def succ? (e : Expr) : Option Expr 
goal: Option Lean.Expr

full_name: Lean.Elab.Tactic.Omega.MetaProblem.processedFacts
code: /--
A partially processed `omega` context.

We have:
* a `Problem` representing the integer linear constraints extracted so far, and their proofs
* the unprocessed `facts : List Expr` taken from the local context,
* the unprocessed `disjunctions : List Expr`,
  which will only be split one at a time if we can't otherwise find a contradiction.

We begin with `facts := ← getLocalHyps` and `problem := .trivial`,
and progressively process the facts.

As we process the facts, we may generate additional facts
(e.g. about coercions and integer divisions).
To avoid duplicates, we maintain a `HashSet` of previously processed facts.
-/
structure MetaProblem where
  /-- An integer linear arithmetic problem. -/
  problem : Problem := {}
  /-- Pending facts which have not been processed yet. -/
  facts : List Expr := []
  /--
  Pending disjunctions, which we will case split one at a time if we can't get a contradiction.
  -/
  disjunctions : List Expr := []
  /-- Facts which have already been processed; we keep these to avoid duplicates. -/
  processedFacts : HashSet Expr := ∅
goal: Lean.HashSet Lean.Expr

full_name: Lean.Elab.Tactic.Omega.MetaProblem.problem
code: /--
A partially processed `omega` context.

We have:
* a `Problem` representing the integer linear constraints extracted so far, and their proofs
* the unprocessed `facts : List Expr` taken from the local context,
* the unprocessed `disjunctions : List Expr`,
  which will only be split one at a time if we can't otherwise find a contradiction.

We begin with `facts := ← getLocalHyps` and `problem := .trivial`,
and progressively process the facts.

As we process the facts, we may generate additional facts
(e.g. about coercions and integer divisions).
To avoid duplicates, we maintain a `HashSet` of previously processed facts.
-/
structure MetaProblem where
  /-- An integer linear arithmetic problem. -/
  problem : Problem := {}
  /-- Pending facts which have not been processed yet. -/
  facts : List Expr := []
  /--
  Pending disjunctions, which we will case split one at a time if we can't get a contradiction.
  -/
  disjunctions : List Expr := []
  /-- Facts which have already been processed; we keep these to avoid duplicates. -/
  processedFacts : HashSet Expr := ∅
goal: Lean.Elab.Tactic.Omega.Problem

full_name: Lean.Elab.Tactic.Omega.MetaProblem.facts
code: /--
A partially processed `omega` context.

We have:
* a `Problem` representing the integer linear constraints extracted so far, and their proofs
* the unprocessed `facts : List Expr` taken from the local context,
* the unprocessed `disjunctions : List Expr`,
  which will only be split one at a time if we can't otherwise find a contradiction.

We begin with `facts := ← getLocalHyps` and `problem := .trivial`,
and progressively process the facts.

As we process the facts, we may generate additional facts
(e.g. about coercions and integer divisions).
To avoid duplicates, we maintain a `HashSet` of previously processed facts.
-/
structure MetaProblem where
  /-- An integer linear arithmetic problem. -/
  problem : Problem := {}
  /-- Pending facts which have not been processed yet. -/
  facts : List Expr := []
  /--
  Pending disjunctions, which we will case split one at a time if we can't get a contradiction.
  -/
  disjunctions : List Expr := []
  /-- Facts which have already been processed; we keep these to avoid duplicates. -/
  processedFacts : HashSet Expr := ∅
goal: List Lean.Expr

full_name: Lean.Elab.Tactic.Omega.MetaProblem
code: /--
A partially processed `omega` context.

We have:
* a `Problem` representing the integer linear constraints extracted so far, and their proofs
* the unprocessed `facts : List Expr` taken from the local context,
* the unprocessed `disjunctions : List Expr`,
  which will only be split one at a time if we can't otherwise find a contradiction.

We begin with `facts := ← getLocalHyps` and `problem := .trivial`,
and progressively process the facts.

As we process the facts, we may generate additional facts
(e.g. about coercions and integer divisions).
To avoid duplicates, we maintain a `HashSet` of previously processed facts.
-/
structure MetaProblem where
  /-- An integer linear arithmetic problem. -/
  problem : Problem := {}
  /-- Pending facts which have not been processed yet. -/
  facts : List Expr := []
  /--
  Pending disjunctions, which we will case split one at a time if we can't get a contradiction.
  -/
  disjunctions : List Expr := []
  /-- Facts which have already been processed; we keep these to avoid duplicates. -/
  processedFacts : HashSet Expr := ∅
goal: Type

full_name: Lean.Elab.Tactic.Omega.MetaProblem.disjunctions
code: /--
A partially processed `omega` context.

We have:
* a `Problem` representing the integer linear constraints extracted so far, and their proofs
* the unprocessed `facts : List Expr` taken from the local context,
* the unprocessed `disjunctions : List Expr`,
  which will only be split one at a time if we can't otherwise find a contradiction.

We begin with `facts := ← getLocalHyps` and `problem := .trivial`,
and progressively process the facts.

As we process the facts, we may generate additional facts
(e.g. about coercions and integer divisions).
To avoid duplicates, we maintain a `HashSet` of previously processed facts.
-/
structure MetaProblem where
  /-- An integer linear arithmetic problem. -/
  problem : Problem := {}
  /-- Pending facts which have not been processed yet. -/
  facts : List Expr := []
  /--
  Pending disjunctions, which we will case split one at a time if we can't get a contradiction.
  -/
  disjunctions : List Expr := []
  /-- Facts which have already been processed; we keep these to avoid duplicates. -/
  processedFacts : HashSet Expr := ∅
goal: List Lean.Expr

full_name: Lean.Elab.Tactic.Omega.mkEvalRflProof
code: /-- Construct the `rfl` proof that `lc.eval atoms = e`. -/
def mkEvalRflProof (e : Expr) (lc : LinearCombo) : OmegaM Expr 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.Expr

full_name: Lean.Elab.Tactic.Omega.mkCoordinateEvalAtomsEq
code: /-- If `e : Expr` is the `n`-th atom, construct the proof that
`e = (coordinate n).eval atoms`. -/
def mkCoordinateEvalAtomsEq (e : Expr) (n : Nat) : OmegaM Expr 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.Expr

full_name: Lean.Elab.Tactic.Omega.mkAtomLinearCombo
code: /-- Construct the linear combination (and its associated proof and new facts) for an atom. -/
def mkAtomLinearCombo (e : Expr) : OmegaM (LinearCombo × OmegaM Expr × HashSet Expr) 
goal: Lean.Elab.Tactic.Omega.OmegaM
  (Lean.Omega.LinearCombo × Lean.Elab.Tactic.Omega.OmegaM Lean.Expr × Lean.HashSet Lean.Expr)

full_name: Lean.Elab.Tactic.Omega.MetaProblem.trivial
code: /-- The trivial `MetaProblem`, with no facts to processs and a trivial `Problem`. -/
def trivial : MetaProblem 
goal: Lean.Elab.Tactic.Omega.MetaProblem

full_name: Lean.Elab.Tactic.Omega.MetaProblem.instInhabited
code: instance : Inhabited MetaProblem 
goal: Inhabited Lean.Elab.Tactic.Omega.MetaProblem

full_name: Lean.Elab.Tactic.Omega.MetaProblem.addIntEquality
code: /--
Add an integer equality to the `Problem`.

We solve equalities as they are discovered, as this often results in an earlier contradiction.
-/
def addIntEquality (p : MetaProblem) (h x : Expr) : OmegaM MetaProblem 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.Elab.Tactic.Omega.MetaProblem

full_name: Lean.Elab.Tactic.Omega.MetaProblem.addIntInequality
code: /--
Add an integer inequality to the `Problem`.

We solve equalities as they are discovered, as this often results in an earlier contradiction.
-/
def addIntInequality (p : MetaProblem) (h y : Expr) : OmegaM MetaProblem 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.Elab.Tactic.Omega.MetaProblem

full_name: Lean.Elab.Tactic.Omega.MetaProblem.pushNot
code: /-- Given a fact `h` with type `¬ P`, return a more useful fact obtained by pushing the negation. -/
def pushNot (h P : Expr) : MetaM (Option Expr) 
goal: Lean.MetaM (Option Lean.Expr)

full_name: Lean.Elab.Tactic.Omega.MetaProblem.addFact
code: /--
Parse an `Expr` and extract facts, also returning the number of new facts found.
-/
partial def addFact (p : MetaProblem) (h : Expr) : OmegaM (MetaProblem × Nat) 
goal: Lean.Elab.Tactic.Omega.OmegaM (Lean.Elab.Tactic.Omega.MetaProblem × Nat)

full_name: Lean.Elab.Tactic.Omega.MetaProblem.processFacts
code: /--
Process all the facts in a `MetaProblem`, returning the new problem, and the number of new facts.

This is partial because new facts may be generated along the way.
-/
partial def processFacts (p : MetaProblem) : OmegaM (MetaProblem × Nat) 
goal: Lean.Elab.Tactic.Omega.OmegaM (Lean.Elab.Tactic.Omega.MetaProblem × Nat)

full_name: Lean.Elab.Tactic.Omega.cases₂
code: /--
Given `p : P ∨ Q` (or any inductive type with two one-argument constructors),
split the goal into two subgoals:
one containing the hypothesis `h : P` and another containing `h : Q`.
-/
def cases₂ (mvarId : MVarId) (p : Expr) (hName : Name := `h) :
    MetaM ((MVarId × FVarId) × (MVarId × FVarId)) 
goal: Lean.MetaM ((Lean.MVarId × Lean.FVarId) × Lean.MVarId × Lean.FVarId)

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.inScope
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: Lean.MetaM Bool

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.prettyConstraints
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: String

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.prettyCoeffs
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: String

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.prettyAtoms
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: Lean.MessageData

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.mentioned
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: Lean.MetaM (Array Bool)

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.varNameOf
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: String

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.MessageData

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.prettyConstraint
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: Lean.Omega.Constraint → String

full_name: Lean.Elab.Tactic.Omega.formatErrorMessage.varNames
code: /--
Helpful error message when omega cannot find a solution
-/
def formatErrorMessage (p : Problem) : OmegaM MessageData 
goal: Lean.MetaM (Array String)

full_name: Lean.Elab.Tactic.Omega.omega
code: /--
Given a collection of facts, try prove `False` using the omega algorithm,
and close the goal using that.
-/
def omega (facts : List Expr) (g : MVarId) (cfg : OmegaConfig := {}) : MetaM Unit 
goal: Lean.MetaM Unit

full_name: Lean.Elab.Tactic.Omega.omegaTactic
code: /-- The `omega` tactic, for resolving integer and natural linear arithmetic problems. -/
def omegaTactic (cfg : OmegaConfig) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.Omega.omegaDefault
code: /-- The `omega` tactic, for resolving integer and natural linear arithmetic problems. This
`TacticM Unit` frontend with default configuration can be used as an Aesop rule, for example via
the tactic call `aesop (add 50% tactic Lean.Omega.omegaDefault)`. -/
def omegaDefault : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.Omega.evalOmega
code: @[builtin_tactic Lean.Parser.Tactic.omega]
def evalOmega : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.Omega.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Tactic.Omega.Frontend._hyg.15404
code: builtin_initialize bvOmegaSimpExtension : SimpExtension ←
  registerSimpAttr `bv_toNat
    "simp lemmas converting `BitVec` goals to `Nat` goals, for the `bv_omega` preprocessor"
goal: IO Lean.Meta.SimpExtension

full_name: Lean.Elab.Tactic.Omega.bvOmegaSimpExtension
code: builtin_initialize bvOmegaSimpExtension : SimpExtension ←
  registerSimpAttr `bv_toNat
    "simp lemmas converting `BitVec` goals to `Nat` goals, for the `bv_omega` preprocessor"
goal: Lean.Meta.SimpExtension