Skip to content

Commit 2e06bd9

Browse files
committed
feat(Data/Sum): forall_sum_pi (#6658)
Co-authored-by: Chris Hughes <33847686+ChrisHughes24@users.noreply.github.com>
1 parent 8c53b71 commit 2e06bd9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Mathlib/Data/Sum/Basic.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ theorem «exists» {p : Sum α β → Prop} : (∃ x, p x) ↔ (∃ a, p (inl a)
5959
| Or.inr ⟨b, h⟩ => ⟨inr b, h⟩⟩
6060
#align sum.exists Sum.exists
6161

62+
theorem forall_sum_pi {γ : α ⊕ β → Sort*} (p : (∀ ab, γ ab) → Prop) :
63+
(∀ fab, p fab) ↔ (∀ fa fb, p (Sum.rec fa fb)) :=
64+
fun h fa fb => h _, fun h fab => by
65+
have h1 : fab = Sum.rec (fun a => fab (Sum.inl a)) (fun b => fab (Sum.inr b)) := by
66+
ext ab; cases ab <;> rfl
67+
rw [h1]; exact h _ _⟩
68+
69+
theorem exists_sum_pi {γ : α ⊕ β → Sort*} (p : (∀ ab, γ ab) → Prop) :
70+
(∃ fab, p fab) ↔ (∃ fa fb, p (Sum.rec fa fb)) := by
71+
rw [← not_forall_not, forall_sum_pi]
72+
simp
73+
6274
theorem inl_injective : Function.Injective (inl : α → Sum α β) := fun _ _ ↦ inl.inj
6375
#align sum.inl_injective Sum.inl_injective
6476

0 commit comments

Comments
 (0)