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

full_name: Lean.Elab.Tactic.Omega.Context
code: /-- Context for the `OmegaM` monad, containing the user configurable options. -/
structure Context where
  /-- User configurable options for `omega`. -/
  cfg : OmegaConfig
goal: Type

full_name: Lean.Elab.Tactic.Omega.Context.cfg
code: /-- Context for the `OmegaM` monad, containing the user configurable options. -/
structure Context where
  /-- User configurable options for `omega`. -/
  cfg : OmegaConfig
goal: Lean.Meta.Omega.OmegaConfig

full_name: Lean.Elab.Tactic.Omega.State
code: /-- The internal state for the `OmegaM` monad, recording previously encountered atoms. -/
structure State where
  /-- The atoms up-to-defeq encountered so far. -/
  atoms : HashMap Expr Nat := {}
goal: Type

full_name: Lean.Elab.Tactic.Omega.State.atoms
code: /-- The internal state for the `OmegaM` monad, recording previously encountered atoms. -/
structure State where
  /-- The atoms up-to-defeq encountered so far. -/
  atoms : HashMap Expr Nat := {}
goal: Lean.HashMap Lean.Expr Nat

full_name: Lean.Elab.Tactic.Omega.OmegaM'
code: /-- An intermediate layer in the `OmegaM` monad. -/
abbrev OmegaM' 
goal: Type

full_name: Lean.Elab.Tactic.Omega.Cache
code: /--
Cache of expressions that have been visited, and their reflection as a linear combination.
-/
def Cache : Type 
goal: Type

full_name: Lean.Elab.Tactic.Omega.OmegaM
code: /--
The `OmegaM` monad maintains two pieces of state:
* the linear atoms discovered while processing hypotheses
* a cache mapping subexpressions of one side of a linear inequality to `LinearCombo`s
  (and a proof that the `LinearCombo` evaluates at the atoms to the original expression). -/
abbrev OmegaM 
goal: Type

full_name: Lean.Elab.Tactic.Omega.OmegaM.run
code: /-- Run a computation in the `OmegaM` monad, starting with no recorded atoms. -/
def OmegaM.run (m : OmegaM α) (cfg : OmegaConfig) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Elab.Tactic.Omega.cfg
code: /-- Retrieve the user-specified configuration options. -/
def cfg : OmegaM OmegaConfig 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.Meta.Omega.OmegaConfig

full_name: Lean.Elab.Tactic.Omega.atoms
code: /-- Retrieve the list of atoms. -/
def atoms : OmegaM (Array Expr) 
goal: Lean.Elab.Tactic.Omega.OmegaM (Array Lean.Expr)

full_name: Lean.Elab.Tactic.Omega.atomsList
code: /-- Return the `Expr` representing the list of atoms. -/
def atomsList : OmegaM Expr 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.Expr

full_name: Lean.Elab.Tactic.Omega.atomsCoeffs
code: /-- Return the `Expr` representing the list of atoms as a `Coeffs`. -/
def atomsCoeffs : OmegaM Expr 
goal: Lean.Elab.Tactic.Omega.OmegaM Lean.Expr

full_name: Lean.Elab.Tactic.Omega.commitWhen
code: /-- Run an `OmegaM` computation, restoring the state afterwards depending on the result. -/
def commitWhen (t : OmegaM (α × Bool)) : OmegaM α 
goal: Lean.Elab.Tactic.Omega.OmegaM α

full_name: Lean.Elab.Tactic.Omega.withoutModifyingState
code: /--
Run an `OmegaM` computation, restoring the state afterwards.
-/
def withoutModifyingState (t : OmegaM α) : OmegaM α 
goal: Lean.Elab.Tactic.Omega.OmegaM α

full_name: Lean.Elab.Tactic.Omega.natCast?
code: /-- Wrapper around `Expr.nat?` that also allows `Nat.cast`. -/
def natCast? (n : Expr) : Option Nat 
goal: Option Nat

full_name: Lean.Elab.Tactic.Omega.intCast?
code: /-- Wrapper around `Expr.int?` that also allows `Nat.cast`. -/
def intCast? (n : Expr) : Option Int 
goal: Option Int

full_name: Lean.Elab.Tactic.Omega.groundNat?
code: /--
If `groundNat? e = some n`, then `e` is definitionally equal to `OfNat.ofNat n`.
-/
-- We may want to replace this with an implementation using
-- the internals of `simp (config := {ground := true})`
partial def groundNat? (e : Expr) : Option Nat 
goal: Option Nat

full_name: Lean.Elab.Tactic.Omega.groundNat?.op
code: /--
If `groundNat? e = some n`, then `e` is definitionally equal to `OfNat.ofNat n`.
-/
-- We may want to replace this with an implementation using
-- the internals of `simp (config := {ground := true})`
partial def groundNat? (e : Expr) : Option Nat 
goal: Option Nat

full_name: Lean.Elab.Tactic.Omega.groundInt?
code: /--
If `groundInt? e = some i`,
then `e` is definitionally equal to the standard expression for `i`.
-/
partial def groundInt? (e : Expr) : Option Int 
goal: Option Int

full_name: Lean.Elab.Tactic.Omega.groundInt?.op
code: /--
If `groundInt? e = some i`,
then `e` is definitionally equal to the standard expression for `i`.
-/
partial def groundInt? (e : Expr) : Option Int 
goal: Option Int

full_name: Lean.Elab.Tactic.Omega.mkEqReflWithExpectedType
code: /-- Construct the term with type hint `(Eq.refl a : a = b)`-/
def mkEqReflWithExpectedType (a b : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Elab.Tactic.Omega.analyzeAtom
code: /--
Analyzes a newly recorded atom,
returning a collection of interesting facts about it that should be added to the context.
-/
def analyzeAtom (e : Expr) : OmegaM (HashSet Expr) 
goal: Lean.Elab.Tactic.Omega.OmegaM (Lean.HashSet Lean.Expr)

full_name: Lean.Elab.Tactic.Omega.lookup
code: /--
Look up an expression in the atoms, recording it if it has not previously appeared.

Return its index, and, if it is new, a collection of interesting facts about the atom.
* for each new atom `a` of the form `((x : Nat) : Int)`, the fact that `0 ≤ a`
* for each new atom `a` of the form `x / k`, for `k` a positive numeral, the facts that
  `k * a ≤ x < k * a + k`
* for each new atom of the form `((a - b : Nat) : Int)`, the fact:
  `b ≤ a ∧ ((a - b : Nat) : Int) = a - b ∨ a < b ∧ ((a - b : Nat) : Int) = 0`
-/
def lookup (e : Expr) : OmegaM (Nat × Option (HashSet Expr)) 
goal: Lean.Elab.Tactic.Omega.OmegaM (Nat × Option (Lean.HashSet Lean.Expr))