Skip to content

Commit be529d5

Browse files
committed
chore(Data/SetLike/Basic): generalise instance (leanprover-community#40025)
* Generalise the standard `IsConcreteLE` instance from `PartialOrder.ofSetLike` to `LE.ofSetLike` Co-authored-by: artie2000 <artem.khovanov@gmail.com>
1 parent 8baa3d0 commit be529d5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Mathlib/Data/SetLike/Basic.lean

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,17 @@ section default
224224

225225
variable (A B : Type*) [SetLike A B]
226226

227-
/-- The order induced from a `SetLike` instance by inclusion. -/
227+
/-- The order induced from a `SetLike` instance by inclusion.
228+
229+
An order defined as `.ofSetLike` will automatically make available an instance
230+
of `IsConcreteLE`.
231+
-/
228232
@[reducible] def LE.ofSetLike : LE A where
229233
le := fun H K => ∀ ⦃x⦄, x ∈ H → x ∈ K
230234

235+
instance : letI := LE.ofSetLike A B; IsConcreteLE A B :=
236+
letI := LE.ofSetLike A B; { coe_subset_coe' := Iff.rfl }
237+
231238
/-- The partial order induced from a `SetLike` instance by inclusion.
232239
233240
A partial order defined as `.ofSetLike` will automatically make available an instance
@@ -238,9 +245,6 @@ of `IsConcreteLE`.
238245
lt s t := letI := LE.ofSetLike A B; s ≤ t ∧ ¬t ≤ s
239246
__ := PartialOrder.lift (SetLike.coe : A → Set B) SetLike.coe_injective
240247

241-
instance : letI := PartialOrder.ofSetLike A B; IsConcreteLE A B :=
242-
letI := PartialOrder.ofSetLike A B; { coe_subset_coe' := Iff.rfl }
243-
244248
end default
245249

246250
namespace SetLike

0 commit comments

Comments
 (0)