-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90cba53
commit 905e93a
Showing
5 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
theorem beq_eq_or_neq {α: Type} [BEq α] (x y: α): | ||
BEq.beq x y \/ (Not (BEq.beq x y)) := by | ||
by_cases BEq.beq x y | ||
· left | ||
assumption | ||
· right | ||
assumption | ||
|
||
theorem beq_eq_or_neq_prop {α: Type} [BEq α] [LawfulBEq α] (x y: α): | ||
x = y \/ (Not (x = y)) := by | ||
have h := beq_eq_or_neq x y | ||
cases h | ||
· case inl h => | ||
left | ||
rw [beq_iff_eq] at h | ||
assumption | ||
· case inr h => | ||
right | ||
intro h' | ||
apply h | ||
rw [h'] | ||
rw [beq_iff_eq] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
structure NonEmptyList (α: Type) where | ||
head : α | ||
tail : List α | ||
|
||
namespace NonEmptyList | ||
|
||
def cons (x: α) (xs: NonEmptyList α): NonEmptyList α := | ||
NonEmptyList.mk x (xs.head :: xs.tail) |