Skip to content

Commit

Permalink
Logical Foundations - Basics
Browse files Browse the repository at this point in the history
  • Loading branch information
steshaw committed Jun 28, 2023
1 parent 01360df commit 6bb76c4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions sf-lf/basics.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
inductive Day : Type :=
| monday
| tuesday
| wednesday
| thursday
| friday
| saturday
| sunday
deriving Repr

def Day.next_weekday (d : Day) : Day :=
match d with
| monday => tuesday
| tuesday => wednesday
| wednesday => thursday
| thursday => friday
| friday => monday
| saturday => monday
| sunday => monday

#eval Day.friday.next_weekday
-- Day.monday
#eval Day.saturday.next_weekday.next_weekday
-- Day.tuesday

example test_next_weekday: Day.saturday.next_weekday.next_weekday = Day.tuesday :=
rfl

0 comments on commit 6bb76c4

Please sign in to comment.