Theory Op

theory Op
  imports Main
begin

section β€Ήn-ary operationsβ€Ί

locale nary_operations =
  fixes
    𝔒𝔭 :: "'op β‡’ 'a list β‡’ 'a" and
    𝔄𝔯𝔦𝔱𝔢 :: "'op β‡’ nat"
  assumes
    𝔒𝔭_𝔄𝔯𝔦𝔱𝔢_domain: "length xs = 𝔄𝔯𝔦𝔱𝔢 op ⟹ βˆƒy. 𝔒𝔭 op xs = y"

(* locale nary_operations_inl =
  nary_operations "Ξ»op args. fst (eval op args)" arity
  for
    eval :: "'op β‡’ 'dyn list β‡’ 'dyn Γ— 'op option" and arity
begin

definition equiv_op where
  "equiv_op x y ≑ fst ∘ eval x = fst ∘ eval y"

lemma equivp_equiv_op[simp]: "equivp equiv_op"
proof (rule equivpI)
  show "reflp equiv_op"
    by (rule reflpI) (simp add: equiv_op_def)
next
  show "symp equiv_op"
    by (rule sympI) (simp add: equiv_op_def)
next
  show "transp equiv_op"
    by (rule transpI) (simp add: equiv_op_def)
qed

end *)

(* locale nary_operations0 =
  fixes
    eval :: "'op β‡’ 'dyn list β‡’ 'dyn Γ— 'op option" and
    arity :: "'op β‡’ nat"
begin

definition equiv_op where
  "equiv_op x y ≑ fst ∘ eval x = fst ∘ eval y"

lemma equivp_equiv_op[simp]: "equivp equiv_op"
proof (rule equivpI)
  show "reflp equiv_op"
    by (rule reflpI) (simp add: equiv_op_def)
next
  show "symp equiv_op"
    by (rule sympI) (simp add: equiv_op_def)
next
  show "transp equiv_op"
    by (rule transpI) (simp add: equiv_op_def)
qed

end *)

end