Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The power Σ\SigmaΣ-algebra A℘A^{\wp}A℘

Definition
MSKleene_Power

by Cosme · Sep 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

formal-languagesmany-sorted-algebratree-automatauniversal-algebra

The power (subset) Σ\SigmaΣ-algebra A℘A^{\wp}A℘ associated with a many-sorted Σ\SigmaΣ-algebra AAA (Proposition 2.32; for single-sorted algebras, Mezei–Wright 1967).

Its carrier is the sortwise powerset s↦Set(As)s \mapsto \mathrm{Set}(A_s)s↦Set(As​). For an operation symbol σ\sigmaσ of rank (s,s)(\mathbf{s},s)(s,s) and a tuple of subsets (Li)i(L_i)_i(Li​)i​, the interpreted operation returns the image

σA℘((Li)i)={ σA((xi)i)∣xi∈Li for every i }.\sigma^{A^{\wp}}((L_i)_i) = \{\, \sigma^{A}((x_i)_i) \mid x_i \in L_i \text{ for every } i \,\}.σA℘((Li​)i​)={σA((xi​)i​)∣xi​∈Li​ for every i}.

The predicate Args.pmem expresses that an argument tuple is a componentwise member of a tuple of subsets, and powerOp packages the image above. The singleton SSS-sorted map {⋅}AΣ:A→A℘\{\cdot\}^{\Sigma}_A : A \to A^{\wp}{⋅}AΣ​:A→A℘, x↦{x}x \mapsto \{x\}x↦{x}, is also defined.

This object is where regular expressions are interpreted as languages.

Definition code
/-
The power (subset) `Σ`-algebra `A^℘` associated with a many-sorted `Σ`-algebra
`A` (Proposition 2.32; for single-sorted algebras, Mezei–Wright 1967, Def. 2.2).

Carrier: sortwise powerset `s ↦ Set (A_s)`.
Operation `σ^{A^℘}`: sends a tuple of subsets `(L_i)` to the image
`{ σ^A(x_i) | x_i ∈ L_i for every i }`.

Also: the singleton map `{·} : A → A^℘`, `x ↦ {x}`, as an `S`-sorted map.
-/
import Definitions.Def_MSKleene_Core

namespace MSKleene

universe u

variable {S : Type u} {sig : Signature S}

/-- `Args.pmem xs Ls` holds when the argument tuple `xs` is a componentwise
member of the tuple of subsets `Ls`. -/
def Args.pmem {A : SSet S} :
    {w : List S} → Args A w → Args (fun s => Set (A s)) w → Prop
  | [], _, _ => True
  | _ :: _, (x, xs), (L, Ls) => x ∈ L ∧ Args.pmem xs Ls

/-- The image of a tuple of subsets under an operation of the algebra `A`:
`{ A.op σ xs | xs a componentwise member of Ls }`. -/
def powerOp (A : Algebra sig) {w : List S} {s : S} (σ : sig w s)
    (Ls : Args (fun s => Set (A.carrier s)) w) : Set (A.carrier s) :=
  { y | ∃ xs : Args A.carrier w, Args.pmem xs Ls ∧ y = A.op σ xs }

/-- The power `Σ`-algebra `A^℘` (Proposition 2.32). -/
def powerAlgebra (A : Algebra sig) : Algebra sig where
  carrier := fun s => Set (A.carrier s)
  op := fun σ Ls => powerOp A σ Ls

@[simp] theorem powerAlgebra_carrier (A : Algebra sig) (s : S) :
    (powerAlgebra A).carrier s = Set (A.carrier s) := rfl

@[simp] theorem powerAlgebra_op (A : Algebra sig) {w : List S} {s : S}
    (σ : sig w s) (Ls : Args (fun s => Set (A.carrier s)) w) :
    (powerAlgebra A).op σ Ls = powerOp A σ Ls := rfl

/-- The singleton `S`-sorted map `{·}^Σ_A : A → A^℘`. -/
def singletonMap (A : Algebra sig) : SMap A.carrier (powerAlgebra A).carrier :=
  fun s a => ({a} : Set (A.carrier s))

theorem singletonMap_apply (A : Algebra sig) (s : S) (a : A.carrier s) :
    singletonMap A s a = ({a} : Set (A.carrier s)) := rfl

end MSKleene
Source
Gong, Ruiz Mora, Sanmartín Vich, Cosme Llópez, "A Kleene theorem for free many-sorted algebras", 2026, https://arxiv.org/abs/1808.08217 (predecessor CVCL20)
Read-back

What the Lean code literally says, in plain math · claude-sonnet-5

Args.pmem

This definition introduces a predicate ("positional membership"). Fix an arbitrary type SSS whose elements are called sorts, and an implicit family A:S→TypeA : S \to \mathrm{Type}A:S→Type assigning a type AsA_sAs​ to each sort sss. For a list of sorts w=[s1,…,sk]w = [s_1, \dots, s_k]w=[s1​,…,sk​] (implicit), Args(A,w)\mathrm{Args}(A, w)Args(A,w) denotes the iterated product As1×⋯×AskA_{s_1} \times \cdots \times A_{s_k}As1​​×⋯×Ask​​ (a one‑element type when www is empty), and Args(s↦Set(As),w)\mathrm{Args}(s \mapsto \mathrm{Set}(A_s), w)Args(s↦Set(As​),w) denotes the product Set(As1)×⋯×Set(Ask)\mathrm{Set}(A_{s_1}) \times \cdots \times \mathrm{Set}(A_{s_k})Set(As1​​)×⋯×Set(Ask​​) whose iii‑th entry is a subset of AsiA_{s_i}Asi​​. Given a tuple xs∈Args(A,w)xs \in \mathrm{Args}(A, w)xs∈Args(A,w) and a tuple of subsets Ls∈Args(s↦Set(As),w)Ls \in \mathrm{Args}(s \mapsto \mathrm{Set}(A_s), w)Ls∈Args(s↦Set(As​),w), the proposition pmem(xs,Ls)\mathrm{pmem}(xs, Ls)pmem(xs,Ls) is defined by recursion on www:

  • when www is the empty list, pmem(xs,Ls)=True\mathrm{pmem}(xs, Ls) = \mathrm{True}pmem(xs,Ls)=True — it holds unconditionally, and both tuples are the trivial one‑element tuple;
  • when w=s::w′w = s :: w'w=s::w′, writing xs=(x,xs′)xs = (x, xs')xs=(x,xs′) with x∈Asx \in A_sx∈As​ and Ls=(L,Ls′)Ls = (L, Ls')Ls=(L,Ls′) with L⊆AsL \subseteq A_sL⊆As​, we have pmem(xs,Ls)=(x∈L) ∧ pmem(xs′,Ls′)\mathrm{pmem}(xs, Ls) = (x \in L) \ \wedge\ \mathrm{pmem}(xs', Ls')pmem(xs,Ls)=(x∈L) ∧ pmem(xs′,Ls′).

Thus pmem(xs,Ls)\mathrm{pmem}(xs, Ls)pmem(xs,Ls) asserts that every component of the tuple xsxsxs lies in the correspondingly positioned subset of LsLsLs; for the empty arity it is vacuously true.

powerOp

Fix a sort type SSS and an implicit signature sig\mathrm{sig}sig over SSS, where a signature assigns to each arity list w∈List(S)w \in \mathrm{List}(S)w∈List(S) and result sort s∈Ss \in Ss∈S a type sig(w,s)\mathrm{sig}(w,s)sig(w,s) of operation symbols. Let AAA be an algebra for sig\mathrm{sig}sig: it provides a carrier family s↦A.carrierss \mapsto A.\mathrm{carrier}_ss↦A.carriers​ and, for each operation symbol σ∈sig(w,s)\sigma \in \mathrm{sig}(w,s)σ∈sig(w,s), an interpretation A.op(σ,−):Args(A.carrier,w)→A.carriersA.\mathrm{op}(\sigma, -) : \mathrm{Args}(A.\mathrm{carrier}, w) \to A.\mathrm{carrier}_sA.op(σ,−):Args(A.carrier,w)→A.carriers​. Given an implicit arity www and result sort sss, an operation symbol σ∈sig(w,s)\sigma \in \mathrm{sig}(w,s)σ∈sig(w,s), and a tuple LsLsLs whose iii‑th entry is a subset Li⊆A.carrierwiL_i \subseteq A.\mathrm{carrier}_{w_i}Li​⊆A.carrierwi​​, the definition sets

powerOp(A,σ,Ls)  =  { y  ∣  ∃ xs∈Args(A.carrier,w),  pmem(xs,Ls) ∧ y=A.op(σ,xs) }\mathrm{powerOp}(A, \sigma, Ls) \;=\; \{\, y \;\mid\; \exists\, xs \in \mathrm{Args}(A.\mathrm{carrier}, w),\ \ \mathrm{pmem}(xs, Ls) \ \wedge\ y = A.\mathrm{op}(\sigma, xs) \,\}powerOp(A,σ,Ls)={y∣∃xs∈Args(A.carrier,w),  pmem(xs,Ls) ∧ y=A.op(σ,xs)}

as a subset of A.carriersA.\mathrm{carrier}_sA.carriers​. In words, it is the set of all values obtained by applying the operation σ\sigmaσ of AAA to some argument tuple xsxsxs each of whose components lies in the corresponding subset listed by LsLsLs. When www is the empty list, there are no components, pmem\mathrm{pmem}pmem holds trivially, and this reduces to the singleton { A.op(σ,∗) }\{\,A.\mathrm{op}(\sigma, \ast)\,\}{A.op(σ,∗)} containing the interpreted constant, with LsLsLs the trivial empty tuple.

powerAlgebra

With SSS and sig\mathrm{sig}sig as above and AAA an algebra for sig\mathrm{sig}sig, this defines a new algebra powerAlgebra(A)\mathrm{powerAlgebra}(A)powerAlgebra(A) for the same signature sig\mathrm{sig}sig. Its carrier at each sort sss is Set(A.carriers)\mathrm{Set}(A.\mathrm{carrier}_s)Set(A.carriers​), the type of all subsets of AAA's carrier at sss. Its interpretation of an operation symbol σ\sigmaσ applied to a tuple of subsets LsLsLs is powerOp(A,σ,Ls)\mathrm{powerOp}(A, \sigma, Ls)powerOp(A,σ,Ls), the set described in the previous paragraph.

powerAlgebra_carrier

This theorem is marked as a simplification lemma. It states that for every algebra AAA for sig\mathrm{sig}sig and every sort s∈Ss \in Ss∈S, the carrier of the algebra powerAlgebra(A)\mathrm{powerAlgebra}(A)powerAlgebra(A) at sort sss is equal, as a type, to Set(A.carriers)\mathrm{Set}(A.\mathrm{carrier}_s)Set(A.carriers​). The proof is by reflexivity, i.e. the two sides are definitionally equal.

powerAlgebra_op

This theorem is marked as a simplification lemma. It states that for every algebra AAA for sig\mathrm{sig}sig, every implicit arity www and result sort sss, every operation symbol σ∈sig(w,s)\sigma \in \mathrm{sig}(w,s)σ∈sig(w,s), and every tuple LsLsLs whose iii‑th component is a subset of A.carrierwiA.\mathrm{carrier}_{w_i}A.carrierwi​​, the interpretation of σ\sigmaσ in the algebra powerAlgebra(A)\mathrm{powerAlgebra}(A)powerAlgebra(A) applied to LsLsLs equals powerOp(A,σ,Ls)\mathrm{powerOp}(A, \sigma, Ls)powerOp(A,σ,Ls). The proof is by reflexivity.

singletonMap

With SSS, sig\mathrm{sig}sig, and an algebra AAA for sig\mathrm{sig}sig, this defines singletonMap(A)\mathrm{singletonMap}(A)singletonMap(A) as a sorted map from the carrier of AAA to the carrier of powerAlgebra(A)\mathrm{powerAlgebra}(A)powerAlgebra(A); that is, a family of functions indexed by sorts, where at sort sss it is a function A.carriers→Set(A.carriers)A.\mathrm{carrier}_s \to \mathrm{Set}(A.\mathrm{carrier}_s)A.carriers​→Set(A.carriers​). Concretely, at sort sss it sends an element aaa to the singleton subset {a}\{a\}{a} of A.carriersA.\mathrm{carrier}_sA.carriers​. It is asserted only to be such a sorted map; there is no claim that it is a homomorphism of algebras.

singletonMap_apply

This theorem (not marked as a simplification lemma) states that for every algebra AAA for sig\mathrm{sig}sig, every sort s∈Ss \in Ss∈S, and every element a∈A.carriersa \in A.\mathrm{carrier}_sa∈A.carriers​, the value of singletonMap(A)\mathrm{singletonMap}(A)singletonMap(A) at sort sss on the argument aaa is the singleton set {a}⊆A.carriers\{a\} \subseteq A.\mathrm{carrier}_s{a}⊆A.carriers​. The proof is by reflexivity.

Human review
  • Endorsed by Shuze Chen · Sep 9, 2026

  • Endorsed by Cosme · Sep 9, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me