theorem
proved
boolCost_self
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.Foundation.UniversalForcing.Strict.DiscreteBoolean on GitHub at line 22.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
formal source
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
50 simp [boolCost]
51
52/-- Strict Boolean forced arithmetic is canonically `LogicNat`. -/