Skip to content

Commit c1f6461

Browse files
emilyriehlkckennylaulinesthatinterlace
committed
Feat(Logic): basic properties of boolean negation (#31028)
We show that `not : Bool -> Bool` is an involutive equivalence and derive some immediate consequences. Co-authored-by: Kenny Lau <kc_kennylau@yahoo.com.hk> Co-authored-by: Wrenna Robson <wren.robson@gmail.com>
1 parent 07d89dd commit c1f6461

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4533,6 +4533,7 @@ import Mathlib.Logic.Encodable.Lattice
45334533
import Mathlib.Logic.Encodable.Pi
45344534
import Mathlib.Logic.Equiv.Array
45354535
import Mathlib.Logic.Equiv.Basic
4536+
import Mathlib.Logic.Equiv.Bool
45364537
import Mathlib.Logic.Equiv.Defs
45374538
import Mathlib.Logic.Equiv.Embedding
45384539
import Mathlib.Logic.Equiv.Fin.Basic

Mathlib/Logic/Equiv/Bool.lean

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/-
2+
Copyright (c) 2025 Emily Riehl. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Kenny Lau, Emily Riehl, Wrenna Robson
5+
-/
6+
import Mathlib.Logic.Equiv.Basic
7+
import Mathlib.Logic.Function.Basic
8+
9+
/-!
10+
# Equivalences involving `Bool`
11+
12+
This file shows that `not : Bool → Bool` is an equivalence and derives some consequences
13+
-/
14+
15+
/-- The boolean negation function `not : Bool → Bool` is an involution and thus an equivalence. -/
16+
@[simps!]
17+
def Equiv.boolNot : Equiv.Perm Bool := Bool.involutive_not.toPerm
18+
19+
namespace Bool
20+
21+
open Function
22+
23+
theorem not_bijective : Bijective not := Equiv.boolNot.bijective
24+
theorem not_injective : Injective not := Equiv.boolNot.injective
25+
theorem not_surjective : Surjective not := Equiv.boolNot.surjective
26+
27+
theorem not_leftInverse : LeftInverse not not := not_not
28+
theorem not_rightInverse : RightInverse not not := not_not
29+
30+
theorem not_hasLeftInverse : HasLeftInverse not := ⟨not, not_leftInverse⟩
31+
theorem not_hasRightInverse : HasRightInverse not := ⟨not, not_rightInverse⟩
32+
33+
end Bool

0 commit comments

Comments
 (0)