Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 80c4301

Browse files
committed
feat(data/part): add 2 lemmas (#18153)
1 parent 3310acf commit 80c4301

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/data/part.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ variables {α : Type*} {β : Type*} {γ : Type*}
7070
def to_option (o : part α) [decidable o.dom] : option α :=
7171
if h : dom o then some (o.get h) else none
7272

73+
@[simp] lemma to_option_is_some (o : part α) [decidable o.dom] :
74+
o.to_option.is_some ↔ o.dom :=
75+
by by_cases o.dom; simp [h, part.to_option]
76+
77+
@[simp] lemma to_option_is_none (o : part α) [decidable o.dom] :
78+
o.to_option.is_none ↔ ¬o.dom :=
79+
by by_cases o.dom; simp [h, part.to_option]
80+
7381
/-- `part` extensionality -/
7482
theorem ext' : ∀ {o p : part α}
7583
(H1 : o.dom ↔ p.dom)

0 commit comments

Comments
 (0)