Skip to content

Commit 45cc9c7

Browse files
committed
chore(Logic/Basic): deprecate Classical.subtype_of_exists
Also golf its only use in the library.
1 parent 90e41c5 commit 45cc9c7

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Mathlib/Logic/Basic.lean

+6-2
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,11 @@ theorem some_spec₂ {α : Sort*} {p : α → Prop} {h : ∃ a, p a} (q : α →
10311031
(hpq : ∀ a, p a → q a) : q (choose h) := hpq _ <| choose_spec _
10321032
#align classical.some_spec2 Classical.some_spec₂
10331033

1034-
/-- A version of `Classical.indefiniteDescription` which is definitionally equal to a pair -/
1034+
/-- A version of `Classical.indefiniteDescription` which is definitionally equal to a pair.
1035+
1036+
In Lean 4, this definition is defeq to `Classical.indefiniteDescription`,
1037+
so it is deprecated. -/
1038+
@[deprecated Classical.indefiniteDescription (since := "2024-07-04")]
10351039
noncomputable def subtype_of_exists {α : Type*} {P : α → Prop} (h : ∃ x, P x) : { x // P x } :=
10361040
⟨Classical.choose h, Classical.choose_spec h⟩
10371041
#align classical.subtype_of_exists Classical.subtype_of_exists
@@ -1041,7 +1045,7 @@ protected noncomputable def byContradiction' {α : Sort*} (H : ¬(α → False))
10411045
Classical.choice <| (peirce _ False) fun h ↦ (H fun a ↦ h ⟨a⟩).elim
10421046
#align classical.by_contradiction' Classical.byContradiction'
10431047

1044-
/-- `classical.byContradiction'` is equivalent to lean's axiom `classical.choice`. -/
1048+
/-- `Classical.byContradiction'` is equivalent to lean's axiom `Classical.choice`. -/
10451049
def choice_of_byContradiction' {α : Sort*} (contra : ¬(α → False) → α) : Nonempty α → α :=
10461050
fun H ↦ contra H.elim
10471051
#align classical.choice_of_by_contradiction' Classical.choice_of_byContradiction'

Mathlib/SetTheory/Cardinal/Basic.lean

+3-9
Original file line numberDiff line numberDiff line change
@@ -2168,15 +2168,9 @@ theorem mk_preimage_of_injective_lift {α : Type u} {β : Type v} (f : α → β
21682168

21692169
theorem mk_preimage_of_subset_range_lift {α : Type u} {β : Type v} (f : α → β) (s : Set β)
21702170
(h : s ⊆ range f) : lift.{u} #s ≤ lift.{v} #(f ⁻¹' s) := by
2171-
rw [lift_mk_le.{0}]
2172-
refine ⟨⟨?_, ?_⟩⟩
2173-
· rintro ⟨y, hy⟩
2174-
rcases Classical.subtype_of_exists (h hy) with ⟨x, rfl⟩
2175-
exact ⟨x, hy⟩
2176-
rintro ⟨y, hy⟩ ⟨y', hy'⟩; dsimp
2177-
rcases Classical.subtype_of_exists (h hy) with ⟨x, rfl⟩
2178-
rcases Classical.subtype_of_exists (h hy') with ⟨x', rfl⟩
2179-
simp; intro hxx'; rw [hxx']
2171+
rw [← image_preimage_eq_iff] at h
2172+
nth_rewrite 1 [← h]
2173+
apply mk_image_le_lift
21802174
#align cardinal.mk_preimage_of_subset_range_lift Cardinal.mk_preimage_of_subset_range_lift
21812175

21822176
theorem mk_preimage_of_injective_of_subset_range_lift {β : Type v} (f : α → β) (s : Set β)

0 commit comments

Comments
 (0)