While this submission is a draft, it cannot be used by other submissions.

Possible worlds

Lax794877.PossibleWorlds · concepts/Lax794877/PossibleWorlds.lean · lax-794877

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    An instance over a schema LL is a structure over two copies of LL: the certain facts and the uncertain ones. A possible world keeps every certain fact and some of the uncertain ones, and is read as an LL-structure. For a sentence φ\varphi of the schema, counting possible worlds is the counting problem whose value on an instance is the number of its possible worlds in which φ\varphi holds; with every uncertain fact present with probability 1/21/2, this number divided by the number of worlds is the probability of φ\varphi.

    Concept map
    6 concepts; 9 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib.Algebra.BigOperators.Ring.Finset
    2import Mathlib.Algebra.Order.BigOperators.Group.Finset
    3import Mathlib.Data.Fintype.BigOperators
    4import Mathlib.SetTheory.Cardinal.Finite
    5import Mathlib.Algebra.Group.Action.Defs
    6import Mathlib.Tactic.Ring
    7import Mathlib.Tactic.FinCases
    8import Mathlib.Order.PiLex
    9import Mathlib.Data.Prod.Lex
    10import Mathlib.Data.Fintype.EquivFin
    11import Mathlib.ModelTheory.Order
    12import Mathlib.ModelTheory.Semantics
    13import Mathlib.ModelTheory.Complexity
    14import Mathlib.Logic.Equiv.Fin.Basic
    15import Mathlib.Data.Fintype.Lattice
    16import Mathlib.Data.Finite.Sigma
    17import Mathlib.Order.Lattice.Nat
    18import Mathlib.Data.Set.Card
    19import Mathlib.Data.Fintype.Pigeonhole
    20import Mathlib.Dynamics.FixedPoints.Basic
    21import Mathlib.ModelTheory.Syntax
    22import Mathlib.Data.Fintype.Card
    23import Lax904597.SecondOrder
    24import Lax366625.CountingProblems
    25
    26/-!
    27---
    28title: Possible worlds
    29type: definition
    30---
    31An instance over a schema LL is a structure over two copies of LL: the
    32certain facts and the uncertain ones. A possible world keeps every certain
    33fact and some of the uncertain ones, and is read as an LL-structure. For a
    34sentence φ\varphi of the schema, counting possible worlds is the counting
    35problem whose value on an instance is the number of its possible worlds in
    36which φ\varphi holds; with every uncertain fact present with probability
    371/21/2, this number divided by the number of worlds is the probability of
    38φ\varphi.
    39-/
    40
    41namespace Lax794877.PossibleWorlds
    42
    43open Lax904597.SecondOrder
    44
    45open FirstOrder
    46
    47open Language Structure
    48
    49variable (L : Language.{0, 0})
    50
    51/-- The block guessing a world: one relation variable per relation symbol of
    52the schema, of the same arity. -/
    53def worldBlock [Finite (Σ n, L.Relations n)] : SOBlock where
    54 ι := Σ n, L.Relations n
    55 arity := fun p => p.1
    56
    57section Worlds
    58
    59variable {L} [Finite (Σ n, L.Relations n)] {A : Type}
    60
    61/-- The structure over the schema that a family of relations is. -/
    62@[reducible]
    63def worldStructure [L.IsRelational] (ρ : (worldBlock L).Assignment A) : L.Structure A where
    64 funMap f := isEmptyElim f
    65 RelMap := fun {n} R x => ρ ⟨n, R⟩ x
    66
    67/-- The family of relations `ρ` is a **possible world** of the instance: it
    68contains every certain fact, and only certain or uncertain facts. -/
    69def IsWorld [(L.sum L).Structure A] (ρ : (worldBlock L).Assignment A) : Prop :=
    70 ∀ (p : Σ n, L.Relations n) (x : Fin p.1 → A),
    71 (RelMap (L := L.sum L) (M := A) (Sum.inl p.2) x → ρ p x) ∧
    72 (ρ p x → RelMap (L := L.sum L) (M := A) (Sum.inl p.2) x ∨
    73 RelMap (L := L.sum L) (M := A) (Sum.inr p.2) x)
    74
    75/-- A fact that is uncertain and not certain: the facts a world is free to
    76keep or to drop. -/
    77def IsOpenFact [(L.sum L).Structure A] (q : Σ p : Σ n, L.Relations n, Fin p.1 → A) : Prop :=
    78 RelMap (L := L.sum L) (M := A) (Sum.inr q.1.2) q.2 ∧
    79 ¬RelMap (L := L.sum L) (M := A) (Sum.inl q.1.2) q.2
    80
    81end Worlds
    82
    83open Lax366625.CountingProblems
    84
    85/-- **Counting possible worlds**: the number of possible worlds of the instance
    86in which the sentence `φ` of the schema holds. -/
    87noncomputable def PossibleWorlds {L : Language.{0, 0}} [Finite
    88 (Σ n, L.Relations n)] [L.IsRelational]
    89 (φ : L.Sentence) : CountingProblem (L.sum L) :=
    90 CountingProblem.ofFun fun A _ =>
    91 Nat.card {ρ : (worldBlock L).Assignment A // IsWorld ρ ∧ @Sentence.Realize L A
    92 (worldStructure ρ) φ}
    93
    94end Lax794877.PossibleWorlds
    95

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…