File: .lake/packages/lean4/src/lean/Init/Data/AC.lean

full_name: Lean.Data.AC.instBEqExpr
code: inductive Expr
  | var (x : Nat)
  | op (lhs rhs : Expr)
  deriving Inhabited, Repr, BEq
goal: BEq Lean.Data.AC.Expr

full_name: Lean.Data.AC.Expr.op
code: inductive Expr
  | var (x : Nat)
  | op (lhs rhs : Expr)
  deriving Inhabited, Repr, BEq
goal: Lean.Data.AC.Expr

full_name: Lean.Data.AC.instReprExpr
code: inductive Expr
  | var (x : Nat)
  | op (lhs rhs : Expr)
  deriving Inhabited, Repr, BEq
goal: Repr Lean.Data.AC.Expr

full_name: Lean.Data.AC.Expr
code: inductive Expr
  | var (x : Nat)
  | op (lhs rhs : Expr)
  deriving Inhabited, Repr, BEq
goal: Type

full_name: Lean.Data.AC.Expr.var
code: inductive Expr
  | var (x : Nat)
  | op (lhs rhs : Expr)
  deriving Inhabited, Repr, BEq
goal: Lean.Data.AC.Expr

full_name: Lean.Data.AC.instInhabitedExpr
code: inductive Expr
  | var (x : Nat)
  | op (lhs rhs : Expr)
  deriving Inhabited, Repr, BEq
goal: Inhabited Lean.Data.AC.Expr

full_name: Lean.Data.AC.Variable
code: structure Variable {α : Sort u} (op : α → α → α) : Type u where
  value : α
  neutral : Option $ PLift (LawfulIdentity op value)
goal: Type u

full_name: Lean.Data.AC.Variable.neutral
code: structure Variable {α : Sort u} (op : α → α → α) : Type u where
  value : α
  neutral : Option $ PLift (LawfulIdentity op value)
goal: Option (PLift (Std.LawfulIdentity op self.value))

full_name: Lean.Data.AC.Variable.value
code: structure Variable {α : Sort u} (op : α → α → α) : Type u where
  value : α
  neutral : Option $ PLift (LawfulIdentity op value)
goal: α

full_name: Lean.Data.AC.Context.idem
code: structure Context (α : Sort u) where
  op : α → α → α
  assoc : Associative op
  comm : Option $ PLift $ Commutative op
  idem : Option $ PLift $ IdempotentOp op
  vars : List (Variable op)
  arbitrary : α
goal: Option (PLift (Std.IdempotentOp self.op))

full_name: Lean.Data.AC.Context
code: structure Context (α : Sort u) where
  op : α → α → α
  assoc : Associative op
  comm : Option $ PLift $ Commutative op
  idem : Option $ PLift $ IdempotentOp op
  vars : List (Variable op)
  arbitrary : α
goal: Type u

full_name: Lean.Data.AC.Context.assoc
code: structure Context (α : Sort u) where
  op : α → α → α
  assoc : Associative op
  comm : Option $ PLift $ Commutative op
  idem : Option $ PLift $ IdempotentOp op
  vars : List (Variable op)
  arbitrary : α
goal: Std.Associative self.op

full_name: Lean.Data.AC.Context.comm
code: structure Context (α : Sort u) where
  op : α → α → α
  assoc : Associative op
  comm : Option $ PLift $ Commutative op
  idem : Option $ PLift $ IdempotentOp op
  vars : List (Variable op)
  arbitrary : α
goal: Option (PLift (Std.Commutative self.op))

full_name: Lean.Data.AC.Context.arbitrary
code: structure Context (α : Sort u) where
  op : α → α → α
  assoc : Associative op
  comm : Option $ PLift $ Commutative op
  idem : Option $ PLift $ IdempotentOp op
  vars : List (Variable op)
  arbitrary : α
goal: α

full_name: Lean.Data.AC.Context.op
code: structure Context (α : Sort u) where
  op : α → α → α
  assoc : Associative op
  comm : Option $ PLift $ Commutative op
  idem : Option $ PLift $ IdempotentOp op
  vars : List (Variable op)
  arbitrary : α
goal: α → α → α

full_name: Lean.Data.AC.Context.vars
code: structure Context (α : Sort u) where
  op : α → α → α
  assoc : Associative op
  comm : Option $ PLift $ Commutative op
  idem : Option $ PLift $ IdempotentOp op
  vars : List (Variable op)
  arbitrary : α
goal: List (Lean.Data.AC.Variable self.op)

full_name: Lean.Data.AC.ContextInformation.isComm
code: class ContextInformation (α : Sort u) where
  isNeutral : α → Nat → Bool
  isComm : α → Bool
  isIdem : α → Bool
goal: α → Bool

full_name: Lean.Data.AC.ContextInformation.isIdem
code: class ContextInformation (α : Sort u) where
  isNeutral : α → Nat → Bool
  isComm : α → Bool
  isIdem : α → Bool
goal: α → Bool

full_name: Lean.Data.AC.ContextInformation.isNeutral
code: class ContextInformation (α : Sort u) where
  isNeutral : α → Nat → Bool
  isComm : α → Bool
  isIdem : α → Bool
goal: α → Nat → Bool

full_name: Lean.Data.AC.ContextInformation
code: class ContextInformation (α : Sort u) where
  isNeutral : α → Nat → Bool
  isComm : α → Bool
  isIdem : α → Bool
goal: Sort (max 1 u)

full_name: Lean.Data.AC.EvalInformation.evalOp
code: class EvalInformation (α : Sort u) (β : Sort v) where
  arbitrary : α → β
  evalOp : α → β → β → β
  evalVar : α → Nat → β
goal: α → β → β → β

full_name: Lean.Data.AC.EvalInformation.arbitrary
code: class EvalInformation (α : Sort u) (β : Sort v) where
  arbitrary : α → β
  evalOp : α → β → β → β
  evalVar : α → Nat → β
goal: α → β

full_name: Lean.Data.AC.EvalInformation.evalVar
code: class EvalInformation (α : Sort u) (β : Sort v) where
  arbitrary : α → β
  evalOp : α → β → β → β
  evalVar : α → Nat → β
goal: α → Nat → β

full_name: Lean.Data.AC.EvalInformation
code: class EvalInformation (α : Sort u) (β : Sort v) where
  arbitrary : α → β
  evalOp : α → β → β → β
  evalVar : α → Nat → β
goal: Sort (max (max 1 u) v)

full_name: Lean.Data.AC.Context.var
code: def Context.var (ctx : Context α) (idx : Nat) : Variable ctx.op 
goal: Lean.Data.AC.Variable ctx.op

full_name: Lean.Data.AC.instContextInformationContext
code: instance : ContextInformation (Context α) 
goal: Lean.Data.AC.ContextInformation (Lean.Data.AC.Context α)

full_name: Lean.Data.AC.instEvalInformationContext
code: instance : EvalInformation (Context α) α 
goal: Lean.Data.AC.EvalInformation (Lean.Data.AC.Context α) α

full_name: Lean.Data.AC.eval
code: def eval (β : Sort u) [EvalInformation α β] (ctx : α) : (ex : Expr) → β
  
goal: β

full_name: Lean.Data.AC.Expr.toList
code: def Expr.toList : Expr → List Nat
  
goal: Lean.Data.AC.Expr → List Nat

full_name: Lean.Data.AC.evalList
code: def evalList (β : Sort u) [EvalInformation α β] (ctx : α) : List Nat → β
  
goal: List Nat → β

full_name: Lean.Data.AC.insert
code: def insert (x : Nat) : List Nat → List Nat
  
goal: List Nat → List Nat

full_name: Lean.Data.AC.sort
code: def sort (xs : List Nat) : List Nat 
goal: List Nat

full_name: Lean.Data.AC.sort.loop
code: def sort (xs : List Nat) : List Nat 
goal: List Nat → List Nat → List Nat

full_name: Lean.Data.AC.mergeIdem.loop
code: def mergeIdem (xs : List Nat) : List Nat 
goal: Nat → List Nat → List Nat

full_name: Lean.Data.AC.mergeIdem
code: def mergeIdem (xs : List Nat) : List Nat 
goal: List Nat

full_name: Lean.Data.AC.removeNeutrals
code: def removeNeutrals [info : ContextInformation α] (ctx : α) : List Nat → List Nat
  
goal: List Nat → List Nat

full_name: Lean.Data.AC.removeNeutrals.loop
code: def removeNeutrals [info : ContextInformation α] (ctx : α) : List Nat → List Nat
  
goal: List Nat → List Nat

full_name: Lean.Data.AC.norm
code: def norm [info : ContextInformation α] (ctx : α) (e : Expr) : List Nat 
goal: List Nat

full_name: Lean.Data.AC.List.two_step_induction
code: noncomputable def List.two_step_induction
  {motive : List Nat → Sort u}
  (l : List Nat)
  (empty : motive [])
  (single : ∀ a, motive [a])
  (step : ∀ a b l, motive (b :: l) → motive (a :: b :: l))
  : motive l 
goal: motive l

full_name: Lean.Data.AC.Context.mergeIdem_nonEmpty
code: theorem Context.mergeIdem_nonEmpty (e : List Nat) (h : e ≠ []) : mergeIdem e ≠ [] 
goal: Lean.Data.AC.mergeIdem e ≠ []

full_name: Lean.Data.AC.Context.mergeIdem_head
code: theorem Context.mergeIdem_head : mergeIdem (x :: x :: xs) = mergeIdem (x :: xs) 
goal: Lean.Data.AC.mergeIdem (x :: x :: xs) = Lean.Data.AC.mergeIdem (x :: xs)

full_name: Lean.Data.AC.Context.mergeIdem_head2
code: theorem Context.mergeIdem_head2 (h : x ≠ y) : mergeIdem (x :: y :: ys) = x :: mergeIdem (y :: ys) 
goal: Lean.Data.AC.mergeIdem (x :: y :: ys) = x :: Lean.Data.AC.mergeIdem (y :: ys)

full_name: Lean.Data.AC.Context.evalList_mergeIdem
code: theorem Context.evalList_mergeIdem (ctx : Context α) (h : ContextInformation.isIdem ctx) (e : List Nat) : evalList α ctx (mergeIdem e) = evalList α ctx e 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.mergeIdem e) = Lean.Data.AC.evalList α ctx e

full_name: Lean.Data.AC.insert_nonEmpty
code: theorem insert_nonEmpty : insert x xs ≠ [] 
goal: Lean.Data.AC.insert x xs ≠ []

full_name: Lean.Data.AC.Context.sort_loop_nonEmpty
code: theorem Context.sort_loop_nonEmpty (xs : List Nat) (h : xs ≠ []) : sort.loop xs ys ≠ [] 
goal: Lean.Data.AC.sort.loop xs ys ≠ []

full_name: Lean.Data.AC.Context.evalList_insert
code: theorem Context.evalList_insert
  (ctx : Context α)
  (h : Commutative ctx.op)
  (x : Nat)
  (xs : List Nat)
  : evalList α ctx (insert x xs) = evalList α ctx (x::xs) 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.insert x xs) = Lean.Data.AC.evalList α ctx (x :: xs)

full_name: Lean.Data.AC.Context.evalList_sort_congr
code: theorem Context.evalList_sort_congr
  (ctx : Context α)
  (h : Commutative ctx.op)
  (h₂ : evalList α ctx a = evalList α ctx b)
  (h₃ : a ≠ [])
  (h₄ : b ≠ [])
  : evalList α ctx (sort.loop a c) = evalList α ctx (sort.loop b c) 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop a c) = Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop b c)

full_name: Lean.Data.AC.Context.evalList_sort_loop_swap
code: theorem Context.evalList_sort_loop_swap
  (ctx : Context α)
  (h : Commutative ctx.op)
  (xs ys : List Nat)
  : evalList α ctx (sort.loop xs (y::ys)) = evalList α ctx (sort.loop (y::xs) ys) 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop xs (y :: ys)) =
  Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop (y :: xs) ys)

full_name: Lean.Data.AC.Context.evalList_sort_cons
code: theorem Context.evalList_sort_cons
  (ctx : Context α)
  (h : Commutative ctx.op)
  (x : Nat)
  (xs : List Nat)
  : evalList α ctx (sort (x :: xs)) = evalList α ctx (x :: sort xs) 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort (x :: xs)) = Lean.Data.AC.evalList α ctx (x :: Lean.Data.AC.sort xs)

full_name: Lean.Data.AC.Context.evalList_sort
code: theorem Context.evalList_sort (ctx : Context α) (h : ContextInformation.isComm ctx) (e : List Nat) : evalList α ctx (sort e) = evalList α ctx e 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort e) = Lean.Data.AC.evalList α ctx e

full_name: Lean.Data.AC.Context.toList_nonEmpty
code: theorem Context.toList_nonEmpty (e : Expr) : e.toList ≠ [] 
goal: e.toList ≠ []

full_name: Lean.Data.AC.Context.unwrap_isNeutral
code: theorem Context.unwrap_isNeutral
  {ctx : Context α}
  {x : Nat}
  : ContextInformation.isNeutral ctx x = true → LawfulIdentity (EvalInformation.evalOp ctx) (EvalInformation.evalVar (β := α) ctx x) 
goal: Lean.Data.AC.ContextInformation.isNeutral ctx x = true →
  Std.LawfulIdentity (Lean.Data.AC.EvalInformation.evalOp ctx) (Lean.Data.AC.EvalInformation.evalVar ctx x)

full_name: Lean.Data.AC.Context.evalList_removeNeutrals
code: theorem Context.evalList_removeNeutrals (ctx : Context α) (e : List Nat) : evalList α ctx (removeNeutrals ctx e) = evalList α ctx e 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.removeNeutrals ctx e) = Lean.Data.AC.evalList α ctx e

full_name: Lean.Data.AC.Context.evalList_append
code: theorem Context.evalList_append
  (ctx : Context α)
  (l r : List Nat)
  (h₁ : l ≠ [])
  (h₂ : r ≠ [])
  : evalList α ctx (l.append r) = ctx.op (evalList α ctx l) (evalList α ctx r) 
goal: Lean.Data.AC.evalList α ctx (l.append r) = ctx.op (Lean.Data.AC.evalList α ctx l) (Lean.Data.AC.evalList α ctx r)

full_name: Lean.Data.AC.Context.eval_toList
code: theorem Context.eval_toList (ctx : Context α) (e : Expr) : evalList α ctx e.toList = eval α ctx e 
goal: Lean.Data.AC.evalList α ctx e.toList = Lean.Data.AC.eval α ctx e

full_name: Lean.Data.AC.Context.eval_norm
code: theorem Context.eval_norm (ctx : Context α) (e : Expr) : evalList α ctx (norm ctx e) = eval α ctx e 
goal: Lean.Data.AC.evalList α ctx (Lean.Data.AC.norm ctx e) = Lean.Data.AC.eval α ctx e

full_name: Lean.Data.AC.Context.eq_of_norm
code: theorem Context.eq_of_norm (ctx : Context α) (a b : Expr) (h : norm ctx a == norm ctx b) : eval α ctx a = eval α ctx b 
goal: Lean.Data.AC.eval α ctx a = Lean.Data.AC.eval α ctx b