File: Mathlib/Tactic/CC/Addition.lean

full_name: Mathlib.Tactic.CC.initFn._@.Mathlib.Tactic.CC.Addition._hyg.7
code: initialize
  registerTraceClass `Meta.Tactic.cc.merge
  registerTraceClass `Meta.Tactic.cc.failure
  registerTraceClass `Debug.Meta.Tactic.cc
  registerTraceClass `Debug.Meta.Tactic.cc.ac
  registerTraceClass `Debug.Meta.Tactic.cc.parentOccs
goal: IO Unit

full_name: Mathlib.Tactic.CC.CCM
code: /-- The monad for the `cc` tactic stores the current state of the tactic. -/
abbrev CCM 
goal: Type

full_name: Mathlib.Tactic.CC.CCM.run
code: /-- Run a computation in the `CCM` monad. -/
@[inline]
def run {α : Type} (x : CCM α) (c : CCStructure) : MetaM (α × CCStructure) 
goal: Lean.MetaM (α × Mathlib.Tactic.CC.CCStructure)

full_name: Mathlib.Tactic.CC.CCM.modifyTodo
code: /-- Update the `todo` field of the state. -/
@[inline]
def modifyTodo (f : Array TodoEntry → Array TodoEntry) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.modifyACTodo
code: /-- Update the `acTodo` field of the state. -/
@[inline]
def modifyACTodo (f : Array ACTodoEntry → Array ACTodoEntry) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.modifyCache
code: /-- Update the `cache` field of the state. -/
@[inline]
def modifyCache (f : CCCongrTheoremCache → CCCongrTheoremCache) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.getTodo
code: /-- Read the `todo` field of the state. -/
@[inline]
def getTodo : CCM (Array TodoEntry) 
goal: Mathlib.Tactic.CC.CCM (Array Mathlib.Tactic.CC.TodoEntry)

full_name: Mathlib.Tactic.CC.CCM.getACTodo
code: /-- Read the `acTodo` field of the state. -/
@[inline]
def getACTodo : CCM (Array ACTodoEntry) 
goal: Mathlib.Tactic.CC.CCM (Array Mathlib.Tactic.CC.ACTodoEntry)

full_name: Mathlib.Tactic.CC.CCM.getCache
code: /-- Read the `cache` field of the state. -/
@[inline]
def getCache : CCM CCCongrTheoremCache 
goal: Mathlib.Tactic.CC.CCM Mathlib.Tactic.CC.CCCongrTheoremCache

full_name: Mathlib.Tactic.CC.CCM.getEntry
code: /-- Look up an entry associated with the given expression. -/
def getEntry (e : Expr) : CCM (Option Entry) 
goal: Mathlib.Tactic.CC.CCM (Option Mathlib.Tactic.CC.Entry)

full_name: Mathlib.Tactic.CC.CCM.normalize
code: /-- Use the normalizer to normalize `e`.

If no normalizer was configured, returns `e` itself. -/
def normalize (e : Expr) : CCM Expr 
goal: Mathlib.Tactic.CC.CCM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.pushTodo
code: /-- Add a new entry to the end of the todo list.

See also `pushEq`, `pushHEq` and `pushReflEq`. -/
def pushTodo (lhs rhs : Expr) (H : EntryExpr) (heqProof : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.pushEq
code: /-- Add the equality proof `H : lhs = rhs` to the end of the todo list. -/
@[inline]
def pushEq (lhs rhs : Expr) (H : EntryExpr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.pushHEq
code: /-- Add the heterogeneous equality proof `H : HEq lhs rhs` to the end of the todo list. -/
@[inline]
def pushHEq (lhs rhs : Expr) (H : EntryExpr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.pushReflEq
code: /-- Add `rfl : lhs = rhs` to the todo list. -/
@[inline]
def pushReflEq (lhs rhs : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.getRoot
code: /-- Return the root expression of the expression's congruence class. -/
def getRoot (e : Expr) : CCM Expr 
goal: Mathlib.Tactic.CC.CCM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.isCgRoot
code: /-- Is `e` the root of its congruence class? -/
def isCgRoot (e : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.addOccurrence
code: /-- Update the `child` so its parent becomes `parent`. -/
def addOccurrence (parent child : Expr) (symmTable : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.isCongruent
code: /--
Return true iff the given function application are congruent

`e₁` should have the form `f a` and `e₂` the form `g b`.

See paper: Congruence Closure for Intensional Type Theory. -/
partial def isCongruent (e₁ e₂ : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.mkCongruencesKey
code: /-- Return the `CongruencesKey` associated with an expression of the form `f a`. -/
def mkCongruencesKey (e : Expr) : CCM CongruencesKey 
goal: Mathlib.Tactic.CC.CCM Mathlib.Tactic.CC.CongruencesKey

full_name: Mathlib.Tactic.CC.CCM.mkSymmCongruencesKey
code: /-- Return the `SymmCongruencesKey` associated with the equality `lhs = rhs`. -/
def mkSymmCongruencesKey (lhs rhs : Expr) : CCM SymmCongruencesKey 
goal: Mathlib.Tactic.CC.CCM Mathlib.Tactic.CC.SymmCongruencesKey

full_name: Mathlib.Tactic.CC.CCM.mkCCHCongrTheorem
code: /-- Try to find a congruence theorem for an application of `fn` with `nargs` arguments, with support
for `HEq`. -/
def mkCCHCongrTheorem (fn : Expr) (nargs : Nat) : CCM (Option CCCongrTheorem) 
goal: Mathlib.Tactic.CC.CCM (Option Mathlib.Tactic.CC.CCCongrTheorem)

full_name: Mathlib.Tactic.CC.CCM.mkCCCongrTheorem
code: /-- Try to find a congruence theorem for the expression `e` with support for `HEq`. -/
def mkCCCongrTheorem (e : Expr) : CCM (Option CCCongrTheorem) 
goal: Mathlib.Tactic.CC.CCM (Option Mathlib.Tactic.CC.CCCongrTheorem)

full_name: Mathlib.Tactic.CC.CCM.propagateInstImplicit
code: /-- Record the instance `e` and add it to the set of known defeq instances. -/
def propagateInstImplicit (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.setFO
code: /-- Treat the entry associated with `e` as a first-order function. -/
def setFO (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.updateMT
code: /-- Update the modification time of the congruence class of `e`. -/
partial def updateMT (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.hasHEqProofs
code: /-- Does the congruence class with root `root` have any `HEq` proofs? -/
def hasHEqProofs (root : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.flipProofCore
code: /-- Apply symmetry to `H`, which is an `Eq` or a `HEq`.

* If `heqProofs` is true, ensure the result is a `HEq` (otherwise it is assumed to be `Eq`).
* If `flipped` is true, apply `symm`, otherwise keep the same direction. -/
def flipProofCore (H : Expr) (flipped heqProofs : Bool) : CCM Expr 
goal: Mathlib.Tactic.CC.CCM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.flipDelayedProofCore
code: /-- In a delayed way, apply symmetry to `H`, which is an `Eq` or a `HEq`.

* If `heqProofs` is true, ensure the result is a `HEq` (otherwise it is assumed to be `Eq`).
* If `flipped` is true, apply `symm`, otherwise keep the same direction. -/
def flipDelayedProofCore (H : DelayedExpr) (flipped heqProofs : Bool) : CCM DelayedExpr 
goal: Mathlib.Tactic.CC.CCM Mathlib.Tactic.CC.DelayedExpr

full_name: Mathlib.Tactic.CC.CCM.flipProof
code: /-- Apply symmetry to `H`, which is an `Eq` or a `HEq`.

* If `heqProofs` is true, ensure the result is a `HEq` (otherwise it is assumed to be `Eq`).
* If `flipped` is true, apply `symm`, otherwise keep the same direction. -/
def flipProof (H : EntryExpr) (flipped heqProofs : Bool) : CCM EntryExpr 
goal: Mathlib.Tactic.CC.CCM Mathlib.Tactic.CC.EntryExpr

full_name: Mathlib.Tactic.CC.CCM.isEqv
code: /-- Are `e₁` and `e₂` known to be in the same equivalence class? -/
def isEqv (e₁ e₂ : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.isNotEqv
code: /-- Is `e₁ ≠ e₂` known to be true?

Note that this is stronger than `not (isEqv e₁ e₂)`:
only if we can prove they are distinct this returns `true`. -/
def isNotEqv (e₁ e₂ : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.isEqTrue
code: /-- Is the proposition `e` known to be true? -/
@[inline]
def isEqTrue (e : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.isEqFalse
code: /-- Is the proposition `e` known to be false? -/
@[inline]
def isEqFalse (e : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.mkTrans
code: /-- Apply transitivity to `H₁` and `H₂`, which are both `Eq` or `HEq` depending on `heqProofs`. -/
def mkTrans (H₁ H₂ : Expr) (heqProofs : Bool) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.mkTransOpt
code: /-- Apply transitivity to `H₁?` and `H₂`, which are both `Eq` or `HEq` depending on `heqProofs`.

If `H₁?` is `none`, return `H₂` instead. -/
def mkTransOpt (H₁? : Option Expr) (H₂ : Expr) (heqProofs : Bool) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.getEqTrueProof
code: /-- Build a proof for `e = True`. Fails if `e` is not known to be true. -/
def getEqTrueProof (e : Expr) : CCM Expr 
goal: Mathlib.Tactic.CC.CCM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.getEqFalseProof
code: /-- Build a proof for `e = False`. Fails if `e` is not known to be false. -/
def getEqFalseProof (e : Expr) : CCM Expr 
goal: Mathlib.Tactic.CC.CCM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.getPropEqProof
code: /-- Build a proof for `a = b`. Fails if `a` and `b` are not known to be equal. -/
def getPropEqProof (a b : Expr) : CCM Expr 
goal: Mathlib.Tactic.CC.CCM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.getInconsistencyProof
code: /-- Build a proof of `False` if the context is inconsistent.
Returns `none` if `False` is not known to be true. -/
def getInconsistencyProof : CCM (Option Expr) 
goal: Mathlib.Tactic.CC.CCM (Option Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.compareSymmAux
code: /-- Auxiliary function for comparing `lhs₁ ~ rhs₁` and `lhs₂ ~ rhs₂`,
    when `~` is symmetric/commutative.
    It returns `true` (equal) for `a ~ b` `b ~ a`-/
def compareSymmAux (lhs₁ rhs₁ lhs₂ rhs₂ : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.compareSymm
code: /-- Given ``k₁ := (R₁ lhs₁ rhs₁, `R₁)`` and ``k₂ := (R₂ lhs₂ rhs₂, `R₂)``, return `true` if
`R₁ lhs₁ rhs₁` is equivalent to `R₂ lhs₂ rhs₂` modulo the symmetry of `R₁` and `R₂`. -/
def compareSymm : (k₁ k₂ : Expr × Name) → CCM Bool
  
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.checkEqTrue
code: /-- Given `e := R lhs rhs`, if `R` is a reflexive relation and `lhs` is equivalent to `rhs`, add
equality `e = True`. -/
def checkEqTrue (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.addCongruenceTable
code: /-- If the congruence table (`congruences` field) has congruent expression to `e`, add the
equality to the todo list. If not, add `e` to the congruence table. -/
def addCongruenceTable (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.addSymmCongruenceTable
code: /-- If the symm congruence table (`symmCongruences` field) has congruent expression to `e`, add the
equality to the todo list. If not, add `e` to the symm congruence table. -/
def addSymmCongruenceTable (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.pushSubsingletonEq
code: /-- Given subsingleton elements `a` and `b` which are not necessarily of the same type, if the
types of `a` and `b` are equivalent, add the (heterogeneous) equality proof between `a` and `b` to
the todo list. -/
def pushSubsingletonEq (a b : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.checkNewSubsingletonEq
code: /-- Given the equivalent expressions `oldRoot` and `newRoot` the root of `oldRoot` is
`newRoot`, if `oldRoot` has root representative of subsingletons, try to push the equality proof
between their root representatives to the todo list, or update the root representative to
`newRoot`. -/
def checkNewSubsingletonEq (oldRoot newRoot : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.getEqcLambdas
code: /-- Get all lambda expressions in the equivalence class of `e` and append to `r`.

`e` must be the root of its equivalence class. -/
def getEqcLambdas (e : Expr) (r : Array Expr := #[]) : CCM (Array Expr) 
goal: Mathlib.Tactic.CC.CCM (Array Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.propagateBeta
code: /-- Remove `fn` and expressions whose type isn't def-eq to `fn`'s type out from `lambdas`,
return the remaining lambdas applied to the reversed arguments. -/
def propagateBeta (fn : Expr) (revArgs : Array Expr) (lambdas : Array Expr)
    (newLambdaApps : Array Expr := #[]) : CCM (Array Expr) 
goal: Mathlib.Tactic.CC.CCM (Array Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.mkNeOfEqOfNe
code: /-- Given `a`, `a₁` and `a₁NeB : a₁ ≠ b`, return a proof of `a ≠ b` if `a` and `a₁` are in the
same equivalence class. -/
def mkNeOfEqOfNe (a a₁ a₁NeB : Expr) : CCM (Option Expr) 
goal: Mathlib.Tactic.CC.CCM (Option Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.mkNeOfNeOfEq
code: /-- Given `aNeB₁ : a ≠ b₁`, `b₁` and `b`, return a proof of `a ≠ b` if `b` and `b₁` are in the
same equivalence class. -/
def mkNeOfNeOfEq (aNeB₁ b₁ b : Expr) : CCM (Option Expr) 
goal: Mathlib.Tactic.CC.CCM (Option Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.isAC
code: /-- If `e` is of the form `op e₁ e₂` where `op` is an associative and commutative binary operator,
return the canonical form of `op`. -/
def isAC (e : Expr) : CCM (Option Expr) 
goal: Mathlib.Tactic.CC.CCM (Option Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.dbgTraceACEq
code: /-- Given `lhs`, `rhs`, and `header := "my header:"`, Trace `my header: lhs = rhs`. -/
def dbgTraceACEq (header : String) (lhs rhs : ACApps) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.dbgTraceACState
code: /-- Trace the state of AC module. -/
def dbgTraceACState : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.mkACProof
code: /-- Return the proof of `e₁ = e₂` using `ac_rfl` tactic. -/
def mkACProof (e₁ e₂ : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Mathlib.Tactic.CC.CCM.mkACSimpProof
code: /-- Given `tr := t*r` `sr := s*r` `tEqs : t = s`, return a proof for `tr = sr`

    We use `a*b` to denote an AC application. That is, `(a*b)*(c*a)` is the term `a*a*b*c`. -/
def mkACSimpProof (tr t s r sr : ACApps) (tEqs : DelayedExpr) : MetaM DelayedExpr 
goal: Lean.MetaM Mathlib.Tactic.CC.DelayedExpr

full_name: Mathlib.Tactic.CC.CCM.mkACSuperposeProof
code: /-- Given `ra := a*r` `sb := b*s` `ts := t*s` `tr := t*r` `tsEqa : t*s = a` `trEqb : t*r = b`,
    return a proof for `ra = sb`.

    We use `a*b` to denote an AC application. That is, `(a*b)*(c*a)` is the term `a*a*b*c`. -/
def mkACSuperposeProof (ra sb a b r s ts tr : ACApps) (tsEqa trEqb : DelayedExpr) :
    MetaM DelayedExpr 
goal: Lean.MetaM Mathlib.Tactic.CC.DelayedExpr

full_name: Mathlib.Tactic.CC.CCM.simplifyACCore
code: /-- Given `e := lhs * r` and `H : lhs = rhs`, return `rhs * r` and the proof of `e = rhs * r`. -/
def simplifyACCore (e lhs rhs : ACApps) (H : DelayedExpr) :
    CCM (ACApps × DelayedExpr) 
goal: Mathlib.Tactic.CC.CCM (Mathlib.Tactic.CC.ACApps × Mathlib.Tactic.CC.DelayedExpr)

full_name: Mathlib.Tactic.CC.CCM.simplifyACStep
code: /-- The single step of `simplifyAC`.

Simplifies an expression `e` by either simplifying one argument to the AC operator, or the whole
expression. -/
def simplifyACStep (e : ACApps) : CCM (Option (ACApps × DelayedExpr)) 
goal: Mathlib.Tactic.CC.CCM (Option (Mathlib.Tactic.CC.ACApps × Mathlib.Tactic.CC.DelayedExpr))

full_name: Mathlib.Tactic.CC.CCM.simplifyAC
code: /-- If `e` can be simplified by the AC module, return the simplified term and the proof term of the
equality. -/
def simplifyAC (e : ACApps) : CCM (Option (ACApps × DelayedExpr)) 
goal: Mathlib.Tactic.CC.CCM (Option (Mathlib.Tactic.CC.ACApps × Mathlib.Tactic.CC.DelayedExpr))

full_name: Mathlib.Tactic.CC.CCM.insertEraseROcc
code: /-- Insert or erase `lhs` to the occurrences of `arg` on an equality in `acR`. -/
def insertEraseROcc (arg : Expr) (lhs : ACApps) (inLHS isInsert : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.insertEraseROccs
code: /-- Insert or erase `lhs` to the occurrences of arguments of `e` on an equality in `acR`. -/
def insertEraseROccs (e lhs : ACApps) (inLHS isInsert : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.insertROccs
code: /-- Insert `lhs` to the occurrences of arguments of `e` on an equality in `acR`. -/
@[inline]
def insertROccs (e lhs : ACApps) (inLHS : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.eraseROccs
code: /-- Erase `lhs` to the occurrences of arguments of `e` on an equality in `acR`. -/
@[inline]
def eraseROccs (e lhs : ACApps) (inLHS : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.insertRBHSOccs
code: /-- Insert `lhs` to the occurrences on an equality in `acR` corresponding to the equality
`lhs := rhs`. -/
@[inline]
def insertRBHSOccs (lhs rhs : ACApps) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.eraseRBHSOccs
code: /-- Erase `lhs` to the occurrences on an equality in `acR` corresponding to the equality
`lhs := rhs`. -/
@[inline]
def eraseRBHSOccs (lhs rhs : ACApps) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.insertRRHSOccs
code: /-- Insert `lhs` to the occurrences of arguments of `e` on the right hand side of
an equality in `acR`. -/
@[inline]
def insertRRHSOccs (e lhs : ACApps) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.eraseRRHSOccs
code: /-- Erase `lhs` to the occurrences of arguments of `e` on the right hand side of
an equality in `acR`. -/
@[inline]
def eraseRRHSOccs (e lhs : ACApps) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.composeAC
code: /-- Try to simplify the right hand sides of equalities in `acR` by `H : lhs = rhs`. -/
def composeAC (lhs rhs : ACApps) (H : DelayedExpr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.collapseAC
code: /-- Try to simplify the left hand sides of equalities in `acR` by `H : lhs = rhs`. -/
def collapseAC (lhs rhs : ACApps) (H : DelayedExpr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.superposeAC
code: /-- Given `tsEqa : ts = a`, for each equality `trEqb : tr = b` in `acR` where
the intersection `t` of `ts` and `tr` is nonempty, let `ts = t*s` and `tr := t*r`, add a new
equality `r*a = s*b`. -/
def superposeAC (ts a : ACApps) (tsEqa : DelayedExpr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.processAC
code: /-- Process the tasks in the `acTodo` field. -/
def processAC : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.addACEq
code: /-- Given AC variables `e₁` and `e₂` which are in the same equivalence class, add the proof of
`e₁ = e₂` to the AC module. -/
def addACEq (e₁ e₂ : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.setACVar
code: /-- If the root expression of `e` is AC variable, add equality to AC module. If not, register the
AC variable to the root entry. -/
def setACVar (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.internalizeACVar
code: /-- If `e` isn't an AC variable, set `e` as an new AC variable. -/
def internalizeACVar (e : Expr) : CCM Bool 
goal: Mathlib.Tactic.CC.CCM Bool

full_name: Mathlib.Tactic.CC.CCM.convertAC
code: /-- Given `e := op₁ (op₂ a₁ a₂) (op₃ a₃ a₄)` where `opₙ`s are canonicalized to `op`, internalize
`aₙ`s as AC variables and return `(op (op a₁ a₂) (op a₃ a₄), args ++ #[a₁, a₂, a₃, a₄])`. -/
partial def convertAC (op e : Expr) (args : Array Expr := #[]) : CCM (Array Expr × Expr) 
goal: Mathlib.Tactic.CC.CCM (Array Lean.Expr × Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.internalizeAC
code: /-- Internalize `e` so that the AC module can deal with the given expression.

If the expression does not contain an AC operator, or the parent expression
is already processed by `internalizeAC`, this operation does nothing. -/
def internalizeAC (e : Expr) (parent? : Option Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.mayPropagate
code: /-- Can we propagate equality from subexpressions of `e` to `e`? -/
def mayPropagate (e : Expr) : Bool 
goal: Bool

full_name: Mathlib.Tactic.CC.CCM.removeParents
code: /-- Remove parents of `e` from the congruence table and the symm congruence table, and append
parents to propagate equality, to `parentsToPropagate`.
Returns the new value of `parentsToPropagate`. -/
def removeParents (e : Expr) (parentsToPropagate : Array Expr := #[]) : CCM (Array Expr) 
goal: Mathlib.Tactic.CC.CCM (Array Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.invertTrans
code: /--
The fields `target` and `proof` in `e`'s entry are encoding a transitivity proof
Let `e.rootTarget` and `e.rootProof` denote these fields.
```lean
e = e.rootTarget            := e.rootProof
_ = e.rootTarget.rootTarget := e.rootTarget.rootProof
 ...
_ = e.root                  := ...
```
The transitivity proof eventually reaches the root of the equivalence class.
This method "inverts" the proof. That is, the `target` goes from `e.root` to e after
we execute it.
-/
partial def invertTrans (e : Expr) (newFlipped : Bool := false) (newTarget : Option Expr := none)
    (newProof : Option EntryExpr := none) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.collectFnRoots
code: /-- Traverse the `root`'s equivalence class, and for each function application,
collect the function's equivalence class root. -/
def collectFnRoots (root : Expr) (fnRoots : Array Expr := #[]) : CCM (Array Expr) 
goal: Mathlib.Tactic.CC.CCM (Array Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.reinsertParents
code: /-- Reinsert parents of `e` to the congruence table and the symm congruence table.

Together with `removeParents`, this allows modifying parents of an expression. -/
def reinsertParents (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.checkInvariant
code: /-- Check for integrity of the `CCStructure`. -/
def checkInvariant : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateBetaToEqc
code: /--
For each `fnRoot` in `fnRoots` traverse its parents, and look for a parent prefix that is
in the same equivalence class of the given lambdas.

remark All expressions in lambdas are in the same equivalence class -/
def propagateBetaToEqc (fnRoots lambdas : Array Expr) (newLambdaApps : Array Expr := #[]) :
    CCM (Array Expr) 
goal: Mathlib.Tactic.CC.CCM (Array Lean.Expr)

full_name: Mathlib.Tactic.CC.CCM.propagateProjectionConstructor
code: /--
Given `c` a constructor application, if `p` is a projection application (not `.proj _ _ _`, but
`.app (.const projName _) _`) such that major premise is
equal to `c`, then propagate new equality.

Example: if `p` is of the form `b.fst`, `c` is of the form `(x, y)`, and `b = c`, we add the
equality `(x, y).fst = x` -/
def propagateProjectionConstructor (p c : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateConstructorEq
code: /--
Given a new equality `e₁ = e₂`, where `e₁` and `e₂` are constructor applications.
Implement the following implications:
```lean
c a₁ ... aₙ = c b₁ ... bₙ => a₁ = b₁, ..., aₙ = bₙ

c₁ ... = c₂ ... => False
```
where `c`, `c₁` and `c₂` are constructors -/
partial def propagateConstructorEq (e₁ e₂ : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateConstructorEq.go
code: /--
Given a new equality `e₁ = e₂`, where `e₁` and `e₂` are constructor applications.
Implement the following implications:
```lean
c a₁ ... aₙ = c b₁ ... bₙ => a₁ = b₁, ..., aₙ = bₙ

c₁ ... = c₂ ... => False
```
where `c`, `c₁` and `c₂` are constructors -/
partial def propagateConstructorEq (e₁ e₂ : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateValueInconsistency
code: /-- Derive contradiction if we can get equality between different values. -/
def propagateValueInconsistency (e₁ e₂ : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateAndDown
code: /-- Propagate equality from `a ∧ b = True` to `a = True` and `b = True`. -/
def propagateAndDown (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateOrDown
code: /-- Propagate equality from `a ∨ b = False` to `a = False` and `b = False`. -/
def propagateOrDown (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateNotDown
code: /-- Propagate equality from `¬a` to `a`. -/
def propagateNotDown (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateEqDown
code: /-- Propagate equality from `(a = b) = True` to `a = b`. -/
def propagateEqDown (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateExistsDown
code: /-- Propagate equality from `¬∃ x, p x` to `∀ x, ¬p x`. -/
def propagateExistsDown (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.propagateDown
code: /-- Propagate equality from `e` to subexpressions of `e`. -/
def propagateDown (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.addEqvStep
code: /-- Performs one step in the process when the new equation is added.

Here, `H` contains the proof that `e₁ = e₂` (if `heqProof` is false)
or `HEq e₁ e₂` (if `heqProof` is true). -/
def addEqvStep (e₁ e₂ : Expr) (H : EntryExpr) (heqProof : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.addEqvStep.go
code: /-- Performs one step in the process when the new equation is added.

Here, `H` contains the proof that `e₁ = e₂` (if `heqProof` is false)
or `HEq e₁ e₂` (if `heqProof` is true). -/
def addEqvStep (e₁ e₂ : Expr) (H : EntryExpr) (heqProof : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.processTodo
code: /-- Process the tasks in the `todo` field. -/
def processTodo : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.internalize
code: /-- Internalize `e` so that the congruence closure can deal with the given expression. -/
def internalize (e : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.addEqvCore
code: /-- Add `H : lhs = rhs` or `H : HEq lhs rhs` to the congruence closure. Don't forget to internalize
`lhs` and `rhs` beforehand. -/
def addEqvCore (lhs rhs H : Expr) (heqProof : Bool) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit

full_name: Mathlib.Tactic.CC.CCM.add
code: /-- Add `proof : type` to the congruence closure. -/
def add (type : Expr) (proof : Expr) : CCM Unit 
goal: Mathlib.Tactic.CC.CCM Unit