Skip to content

Commit 058869f

Browse files
committed
chore(Order/InitialSeg): small cleanup (#17607)
We rewrap a few lines and replace `simp only` by `rw`.
1 parent 0958575 commit 058869f

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

Mathlib/Order/InitialSeg.lean

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ def equivLT (f : r ≃r s) (g : s ≺i t) : r ≺i t :=
329329
fun ⟨a, h⟩ => ⟨f a, h⟩⟩⟩
330330

331331
/-- Composition of a principal segment with an order isomorphism, as a principal segment -/
332-
def ltEquiv {r : α → α → Prop} {s : β → β → Prop} {t : γ → γ → Prop} (f : PrincipalSeg r s)
333-
(g : s ≃r t) : PrincipalSeg r t :=
332+
def ltEquiv {r : α → α → Prop} {s : β → β → Prop} {t : γ → γ → Prop} (f : r ≺i s) (g : s ≃r t) :
333+
r ≺i t :=
334334
⟨@RelEmbedding.trans _ _ _ r s t f g, g f.top, by
335335
intro x
336336
rw [← g.apply_symm_apply x, g.map_rel_iff, ← f.mem_range_iff_rel]
@@ -467,27 +467,25 @@ noncomputable def ltOrEq [IsWellOrder β s] (f : r ≼i s) : (r ≺i s) ⊕ (r
467467
· exact Sum.inr (RelIso.ofSurjective f h)
468468
· exact Sum.inl (f.toPrincipalSeg h)
469469

470-
theorem ltOrEq_apply_left [IsWellOrder β s] (f : r ≼i s) (g : r ≺i s) (a : α) :
471-
g a = f a :=
470+
theorem ltOrEq_apply_left [IsWellOrder β s] (f : r ≼i s) (g : r ≺i s) (a : α) : g a = f a :=
472471
@InitialSeg.eq α β r s _ g f a
473472

474-
theorem ltOrEq_apply_right [IsWellOrder β s] (f : r ≼i s) (g : r ≃r s) (a : α) :
475-
g a = f a :=
473+
theorem ltOrEq_apply_right [IsWellOrder β s] (f : r ≼i s) (g : r ≃r s) (a : α) : g a = f a :=
476474
InitialSeg.eq (InitialSeg.ofIso g) f a
477475

478476
/-- Composition of an initial segment taking values in a well order and a principal segment. -/
479-
noncomputable def leLT [IsWellOrder β s] [IsTrans γ t] (f : r ≼i s) (g : s ≺i t) :
480-
r ≺i t :=
477+
noncomputable def leLT [IsWellOrder β s] [IsTrans γ t] (f : r ≼i s) (g : s ≺i t) : r ≺i t :=
481478
match f.ltOrEq with
482479
| Sum.inl f' => f'.trans g
483480
| Sum.inr f' => PrincipalSeg.equivLT f' g
484481

485482
@[simp]
486483
theorem leLT_apply [IsWellOrder β s] [IsTrans γ t] (f : r ≼i s) (g : s ≺i t) (a : α) :
487484
(f.leLT g) a = g (f a) := by
488-
delta InitialSeg.leLT; cases' f.ltOrEq with f' f'
489-
· simp only [PrincipalSeg.trans_apply, f.ltOrEq_apply_left]
490-
· simp only [PrincipalSeg.equivLT_apply, f.ltOrEq_apply_right]
485+
rw [InitialSeg.leLT]
486+
obtain f' | f' := f.ltOrEq
487+
· rw [PrincipalSeg.trans_apply, f.ltOrEq_apply_left]
488+
· rw [PrincipalSeg.equivLT_apply, f.ltOrEq_apply_right]
491489

492490
end InitialSeg
493491

0 commit comments

Comments
 (0)