Skip to content

Commit

Permalink
feat: basic instances for ULift and PLift (leanprover#5112)
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em authored Aug 21, 2024
1 parent a58da12 commit 0a8d1bf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Init/Data.lean
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ import Init.Data.Cast
import Init.Data.Sum
import Init.Data.BEq
import Init.Data.Subtype
import Init.Data.ULift
import Init.Data.PLift
12 changes: 12 additions & 0 deletions src/Init/Data/PLift.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/-
Copyright (c) 2024 Lean FRO. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kim Morrison
-/
prelude
import Init.Core

deriving instance DecidableEq for PLift

instance [Subsingleton α] : Subsingleton (PLift α) where
allEq := fun ⟨a⟩ ⟨b⟩ => congrArg PLift.up (Subsingleton.elim a b)
12 changes: 12 additions & 0 deletions src/Init/Data/ULift.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/-
Copyright (c) 2024 Lean FRO. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kim Morrison
-/
prelude
import Init.Core

deriving instance DecidableEq for ULift

instance [Subsingleton α] : Subsingleton (ULift α) where
allEq := fun ⟨a⟩ ⟨b⟩ => congrArg ULift.up (Subsingleton.elim a b)

0 comments on commit 0a8d1bf

Please sign in to comment.