diff options
| author | Andreas Grois <andi@grois.info> | 2024-12-21 21:37:51 +0100 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2024-12-21 21:37:51 +0100 |
| commit | b37fc3089eb0ca8fc37a82ae6d6071b0accbca19 (patch) | |
| tree | e500a5adc1a3f87a5e7f0608773dc12377e7af40 /Common/Parsing.lean | |
| parent | a6e4b8f15c28c374553684f63fa3f4108095da2d (diff) | |
Continue Day17
Diffstat (limited to 'Common/Parsing.lean')
| -rw-r--r-- | Common/Parsing.lean | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Common/Parsing.lean b/Common/Parsing.lean index 637f807..ebc5589 100644 --- a/Common/Parsing.lean +++ b/Common/Parsing.lean @@ -24,6 +24,18 @@ structure RectangularGrid.Coordinate (grid : RectangularGrid Element) where instance {grid : RectangularGrid Element} : BEq grid.Coordinate where beq := λa b ↦ a.x == b.x && a.y == b.y +instance {grid : RectangularGrid Element} : LawfulBEq grid.Coordinate where + rfl := λ{a} ↦ by + unfold BEq.beq instBEqCoordinate + simp only [beq_self_eq_true, Bool.and_self] + eq_of_beq := λ{a b} h₁ ↦ by + unfold BEq.beq instBEqCoordinate at h₁ + simp only [Bool.and_eq_true, beq_iff_eq] at h₁ + cases a + cases b + simp at h₁ ⊢ + assumption + instance {grid : RectangularGrid Element} : Hashable grid.Coordinate where hash := λa ↦ Hashable.hash (a.x, a.y) |
