Skip to content

Commit

Permalink
Merge pull request #1051 from lean-ja/Seasawher/issue505
Browse files Browse the repository at this point in the history
Bool を紹介する
  • Loading branch information
Seasawher authored Nov 4, 2024
2 parents 172120b + 8dc8eb5 commit f942de2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions LeanByExample/Reference/Type/Bool.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/- # Bool
`Bool` は真偽値を表す型です。`true` と `false` の2つの値を持ちます。
-/

#check (true : Bool)
#check (false : Bool)

/- `Bool` の値を得るためには、たとえば `==` を用いて値を比較します。-/

inductive Foo where
| bar
| baz
deriving BEq

example : Bool := Foo.bar == Foo.bar
example : Bool := Foo.bar != Foo.baz

/- 真偽を表すという点で [`Prop`](./Prop.md) と似ていますが、`Bool` の項は簡約すれば必ず `true` か `false` になるため計算可能であるという含みがあります。-/
1 change: 1 addition & 0 deletions booksrc/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
- [ToString: 文字列に変換](./Reference/TypeClass/ToString.md)

- [](./Reference/Type/README.md)
- [Bool: 真偽値](./Reference/Type/Bool.md)
- [Char: Unicode 文字](./Reference/Type/Char.md)
- [Float: 浮動小数点数](./Reference/Type/Float.md)
- [List: 連結リスト](./Reference/Type/List.md)
Expand Down

0 comments on commit f942de2

Please sign in to comment.