Skip to content

Commit

Permalink
feat: EReal.forall, EReal.exists (#18301)
Browse files Browse the repository at this point in the history
  • Loading branch information
YaelDillies committed Oct 28, 2024
1 parent 0610ff0 commit 4cfaaae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Mathlib/Data/Real/EReal.lean
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ protected def rec {C : EReal → Sort*} (h_bot : C ⊥) (h_real : ∀ a : ℝ, C
| (a : ℝ) => h_real a
| ⊤ => h_top

protected lemma «forall» {p : EReal → Prop} : (∀ r, p r) ↔ p ⊥ ∧ p ⊤ ∧ ∀ r : ℝ, p r where
mp h := ⟨h _, h _, fun _ ↦ h _⟩
mpr h := EReal.rec h.1 h.2.2 h.2.1

protected lemma «exists» {p : EReal → Prop} : (∃ r, p r) ↔ p ⊥ ∨ p ⊤ ∨ ∃ r : ℝ, p r where
mp := by rintro ⟨r, hr⟩; cases r <;> aesop
mpr := by rintro (h | h | ⟨r, hr⟩) <;> exact ⟨_, ‹_›⟩

/-- The multiplication on `EReal`. Our definition satisfies `0 * x = x * 0 = 0` for any `x`, and
picks the only sensible value elsewhere. -/
protected def mul : EReal → EReal → EReal
Expand Down

0 comments on commit 4cfaaae

Please sign in to comment.