pith. machine review for the scientific record. sign in
def

boolCost

definition
show as:
view math explainer →
module
IndisputableMonolith.Foundation.UniversalForcing.Strict.DiscreteBoolean
domain
Foundation
line
19 · github
papers citing
none yet

open explainer

Generate a durable explainer page for this declaration.

open lean source

IndisputableMonolith.Foundation.UniversalForcing.Strict.DiscreteBoolean on GitHub at line 19.

browse module

All declarations in this module, on Recognition.

explainer page

Tracked in the explainer inventory; generation is lazy so crawlers do not trigger LLM jobs.

open explainer

depends on

used by

formal source

  16
  17open LogicAsFunctionalEquation
  18
  19def boolCost (p q : Bool) : Nat :=
  20  if p = q then 0 else 1
  21
  22@[simp] theorem boolCost_self (p : Bool) : boolCost p p = 0 := by
  23  simp [boolCost]
  24
  25theorem boolCost_symm (p q : Bool) : boolCost p q = boolCost q p := by
  26  by_cases h : p = q
  27  · subst h
  28    simp [boolCost]
  29  · have h' : q ≠ p := by intro hq; exact h hq.symm
  30    simp [boolCost, h, h']
  31
  32def xorBool (p q : Bool) : Bool :=
  33  xor p q
  34
  35/-- Strict discrete Boolean realization. -/
  36def strictBooleanRealization : StrictLogicRealization where
  37  Carrier := Bool
  38  Cost := Nat
  39  zeroCost := inferInstance
  40  compare := boolCost
  41  compose := xorBool
  42  one := false
  43  generator := true
  44  identity_law := boolCost_self
  45  non_contradiction_law := boolCost_symm
  46  excluded_middle_law := True
  47  composition_law := True
  48  invariance_law := True
  49  nontrivial_law := by