- var: Nat → Lean.Data.AC.Expr
- op: Lean.Data.AC.Expr → Lean.Data.AC.Expr → Lean.Data.AC.Expr
Instances For
Equations
- Lean.Data.AC.instReprExpr = { reprPrec := Lean.Data.AC.reprExpr✝ }
- value : α
- neutral : Option (PLift (Std.LawfulIdentity op self.value))
Instances For
- op : α → α → α
- assoc : Std.Associative self.op
- comm : Option (PLift (Std.Commutative self.op))
- idem : Option (PLift (Std.IdempotentOp self.op))
- vars : List (Lean.Data.AC.Variable self.op)
- arbitrary : α
Instances For
def
Lean.Data.AC.Context.var
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(idx : Nat)
:
Lean.Data.AC.Variable ctx.op
Instances For
def
Lean.Data.AC.eval
{α : Sort u_1}
(β : Sort u)
[Lean.Data.AC.EvalInformation α β]
(ctx : α)
(ex : Lean.Data.AC.Expr)
:
β
Equations
- Lean.Data.AC.eval β ctx (Lean.Data.AC.Expr.var a) = Lean.Data.AC.EvalInformation.evalVar ctx a
- Lean.Data.AC.eval β ctx (a.op a_1) = Lean.Data.AC.EvalInformation.evalOp ctx (Lean.Data.AC.eval β ctx a) (Lean.Data.AC.eval β ctx a_1)
Instances For
Equations
- (Lean.Data.AC.Expr.var a).toList = [a]
- (a.op a_1).toList = a.toList.append a_1.toList
Instances For
def
Lean.Data.AC.evalList
{α : Sort u_1}
(β : Sort u)
[Lean.Data.AC.EvalInformation α β]
(ctx : α)
:
Equations
- Lean.Data.AC.evalList β ctx [] = Lean.Data.AC.EvalInformation.arbitrary ctx
- Lean.Data.AC.evalList β ctx [x_1] = Lean.Data.AC.EvalInformation.evalVar ctx x_1
- Lean.Data.AC.evalList β ctx (x_1 :: xs) = Lean.Data.AC.EvalInformation.evalOp ctx (Lean.Data.AC.EvalInformation.evalVar ctx x_1) (Lean.Data.AC.evalList β ctx xs)
Instances For
Equations
- Lean.Data.AC.insert x [] = [x]
- Lean.Data.AC.insert x (a :: as) = if x < a then x :: a :: as else a :: Lean.Data.AC.insert x as
Instances For
Equations
- Lean.Data.AC.sort xs = Lean.Data.AC.sort.loop [] xs
Instances For
Equations
- Lean.Data.AC.sort.loop x [] = x
- Lean.Data.AC.sort.loop x (x_2 :: xs) = Lean.Data.AC.sort.loop (Lean.Data.AC.insert x_2 x) xs
Instances For
Equations
- Lean.Data.AC.mergeIdem [] = []
- Lean.Data.AC.mergeIdem (a :: as) = Lean.Data.AC.mergeIdem.loop a as
Instances For
Equations
- Lean.Data.AC.mergeIdem.loop x (next :: rest) = if x = next then Lean.Data.AC.mergeIdem.loop x rest else x :: Lean.Data.AC.mergeIdem.loop next rest
- Lean.Data.AC.mergeIdem.loop x [] = [x]
Instances For
def
Lean.Data.AC.removeNeutrals
{α : Sort u_1}
[info : Lean.Data.AC.ContextInformation α]
(ctx : α)
:
Equations
- Lean.Data.AC.removeNeutrals ctx (x_1 :: xs) = match Lean.Data.AC.removeNeutrals.loop ctx (x_1 :: xs) with | [] => [x_1] | ys => ys
- Lean.Data.AC.removeNeutrals ctx [] = []
Instances For
def
Lean.Data.AC.removeNeutrals.loop
{α : Sort u_1}
[info : Lean.Data.AC.ContextInformation α]
(ctx : α)
:
Equations
- One or more equations did not get rendered due to their size.
- Lean.Data.AC.removeNeutrals.loop ctx [] = []
Instances For
def
Lean.Data.AC.norm
{α : Sort u_1}
[info : Lean.Data.AC.ContextInformation α]
(ctx : α)
(e : Lean.Data.AC.Expr)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
noncomputable def
Lean.Data.AC.List.two_step_induction
{motive : List Nat → Sort u}
(l : List Nat)
(empty : motive [])
(single : (a : Nat) → motive [a])
(step : (a b : Nat) → (l : List Nat) → motive (b :: l) → motive (a :: b :: l))
:
motive l
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Lean.Data.AC.Context.mergeIdem_nonEmpty
(e : List Nat)
(h : e ≠ [])
:
Lean.Data.AC.mergeIdem e ≠ []
theorem
Lean.Data.AC.Context.mergeIdem_head
{x : Nat}
{xs : List Nat}
:
Lean.Data.AC.mergeIdem (x :: x :: xs) = Lean.Data.AC.mergeIdem (x :: xs)
theorem
Lean.Data.AC.Context.mergeIdem_head2
{x y : Nat}
{ys : List Nat}
(h : x ≠ y)
:
Lean.Data.AC.mergeIdem (x :: y :: ys) = x :: Lean.Data.AC.mergeIdem (y :: ys)
theorem
Lean.Data.AC.Context.evalList_mergeIdem
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(h : Lean.Data.AC.ContextInformation.isIdem ctx = true)
(e : List Nat)
:
Lean.Data.AC.evalList α ctx (Lean.Data.AC.mergeIdem e) = Lean.Data.AC.evalList α ctx e
theorem
Lean.Data.AC.Context.sort_loop_nonEmpty
{ys : List Nat}
(xs : List Nat)
(h : xs ≠ [])
:
Lean.Data.AC.sort.loop xs ys ≠ []
theorem
Lean.Data.AC.Context.evalList_insert
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(h : Std.Commutative ctx.op)
(x : Nat)
(xs : List Nat)
:
Lean.Data.AC.evalList α ctx (Lean.Data.AC.insert x xs) = Lean.Data.AC.evalList α ctx (x :: xs)
theorem
Lean.Data.AC.Context.evalList_sort_congr
{α : Sort u_1}
{a b c : List Nat}
(ctx : Lean.Data.AC.Context α)
(h : Std.Commutative ctx.op)
(h₂ : Lean.Data.AC.evalList α ctx a = Lean.Data.AC.evalList α ctx b)
(h₃ : a ≠ [])
(h₄ : b ≠ [])
:
Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop a c) = Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop b c)
theorem
Lean.Data.AC.Context.evalList_sort_loop_swap
{α : Sort u_1}
{y : Nat}
(ctx : Lean.Data.AC.Context α)
(h : Std.Commutative ctx.op)
(xs ys : List Nat)
:
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)
theorem
Lean.Data.AC.Context.evalList_sort_cons
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(h : Std.Commutative ctx.op)
(x : Nat)
(xs : List Nat)
:
Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort (x :: xs)) = Lean.Data.AC.evalList α ctx (x :: Lean.Data.AC.sort xs)
theorem
Lean.Data.AC.Context.evalList_sort
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(h : Lean.Data.AC.ContextInformation.isComm ctx = true)
(e : List Nat)
:
Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort e) = Lean.Data.AC.evalList α ctx e
theorem
Lean.Data.AC.Context.unwrap_isNeutral
{α : Sort u_1}
{ctx : Lean.Data.AC.Context α}
{x : Nat}
:
theorem
Lean.Data.AC.Context.evalList_removeNeutrals
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(e : List Nat)
:
Lean.Data.AC.evalList α ctx (Lean.Data.AC.removeNeutrals ctx e) = Lean.Data.AC.evalList α ctx e
theorem
Lean.Data.AC.Context.evalList_append
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(l r : List Nat)
(h₁ : l ≠ [])
(h₂ : r ≠ [])
:
Lean.Data.AC.evalList α ctx (l.append r) = ctx.op (Lean.Data.AC.evalList α ctx l) (Lean.Data.AC.evalList α ctx r)
theorem
Lean.Data.AC.Context.eval_toList
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(e : Lean.Data.AC.Expr)
:
Lean.Data.AC.evalList α ctx e.toList = Lean.Data.AC.eval α ctx e
theorem
Lean.Data.AC.Context.eval_norm
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(e : Lean.Data.AC.Expr)
:
Lean.Data.AC.evalList α ctx (Lean.Data.AC.norm ctx e) = Lean.Data.AC.eval α ctx e
theorem
Lean.Data.AC.Context.eq_of_norm
{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(a b : Lean.Data.AC.Expr)
(h : (Lean.Data.AC.norm ctx a == Lean.Data.AC.norm ctx b) = true)
:
Lean.Data.AC.eval α ctx a = Lean.Data.AC.eval α ctx b