Skip to content

Commit 8d76e79

Browse files
committed
chore(Order): process misc porting notes
1 parent c7a52c0 commit 8d76e79

File tree

7 files changed

+12
-28
lines changed

7 files changed

+12
-28
lines changed

Mathlib/Order/Defs/LinearOrder.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ theorem le_imp_le_of_lt_imp_lt {α β} [Preorder α] [LinearOrder β] {a b : α}
130130
lemma min_def (a b : α) : min a b = if a ≤ b then a else b := by rw [LinearOrder.min_def a]
131131
lemma max_def (a b : α) : max a b = if a ≤ b then b else a := by rw [LinearOrder.max_def a]
132132

133-
-- Porting note: no `min_tac` tactic in the following series of lemmas
134-
135133
lemma min_le_left (a b : α) : min a b ≤ a := by
136134
if h : a ≤ b
137135
then simp [min_def, if_pos h, le_refl]

Mathlib/Order/Extension/Well.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ We can map our order into two well-orders:
2222
2323
Then their lexicographic product is a well-founded linear order which our original order injects in.
2424
25-
## Porting notes
25+
## Implementation note
2626
27-
The definition in `mathlib` 3 used an auxiliary well-founded order on `α` lifted from `Cardinal`
28-
instead of `Cardinal`. The new definition is definitionally equal to the `mathlib` 3 version but
29-
avoids non-standard instances.
27+
The definition in `mathlib` 3 used an auxiliary well-founded order on `α` lifted from `Cardinal`,
28+
instead of using `Cardinal` directly. The new definition is definitionally equal
29+
to the `mathlib` 3 version but avoids non-standard instances.
3030
3131
## Tags
3232

Mathlib/Order/Filter/AtTopBot/Basic.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ theorem tendsto_add_atTop_iff_nat {f : ℕ → α} {l : Filter α} (k : ℕ) :
441441

442442
theorem map_div_atTop_eq_nat (k : ℕ) (hk : 0 < k) : map (fun a => a / k) atTop = atTop :=
443443
map_atTop_eq_of_gc (fun b => k * b + (k - 1)) 1 (fun _ _ h => Nat.div_le_div_right h)
444-
-- Porting note: there was a parse error in `calc`, use `simp` instead
445444
(fun a b _ => by rw [Nat.div_le_iff_le_mul_add_pred hk])
446445
fun b _ => by rw [Nat.mul_add_div hk, Nat.div_eq_of_lt, Nat.add_zero]; omega
447446

Mathlib/Order/GameAdd.lean

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,16 @@ attribute [local instance] Sym2.Rel.setoid
200200
/-- Recursion on the well-founded `Sym2.GameAdd` relation. -/
201201
def GameAdd.fix {C : α → α → Sort*} (hr : WellFounded rα)
202202
(IH : ∀ a₁ b₁, (∀ a₂ b₂, Sym2.GameAdd rα s(a₂, b₂) s(a₁, b₁) → C a₂ b₂) → C a₁ b₁) (a b : α) :
203-
C a b := by
204-
-- Porting note: this was refactored for https://github.com/leanprover-community/mathlib4/pull/3414 (reenableeta), and could perhaps be cleaned up.
205-
have := hr.sym2_gameAdd
206-
dsimp only [GameAdd, lift₂, DFunLike.coe, EquivLike.coe] at this
207-
exact @WellFounded.fix (α × α) (fun x => C x.1 x.2) _ this.of_quotient_lift₂
203+
C a b :=
204+
@WellFounded.fix (α × α) (fun x => C x.1 x.2)
205+
(fun x y ↦ Prod.GameAdd rα rα x y ∨ Prod.GameAdd rα rα x.swap y)
206+
(by simpa [← Sym2.gameAdd_iff] using hr.sym2_gameAdd.onFun)
208207
(fun ⟨x₁, x₂⟩ IH' => IH x₁ x₂ fun a' b' => IH' ⟨a', b'⟩) (a, b)
209208

210209
theorem GameAdd.fix_eq {C : α → α → Sort*} (hr : WellFounded rα)
211210
(IH : ∀ a₁ b₁, (∀ a₂ b₂, Sym2.GameAdd rα s(a₂, b₂) s(a₁, b₁) → C a₂ b₂) → C a₁ b₁) (a b : α) :
212-
GameAdd.fix hr IH a b = IH a b fun a' b' _ => GameAdd.fix hr IH a' b' := by
213-
-- Porting note: this was refactored for https://github.com/leanprover-community/mathlib4/pull/3414 (reenableeta), and could perhaps be cleaned up.
214-
dsimp [GameAdd.fix]
215-
exact WellFounded.fix_eq _ _ _
211+
GameAdd.fix hr IH a b = IH a b fun a' b' _ => GameAdd.fix hr IH a' b' :=
212+
WellFounded.fix_eq ..
216213

217214
/-- Induction on the well-founded `Sym2.GameAdd` relation. -/
218215
theorem GameAdd.induction {C : α → α → Prop} :

Mathlib/Order/Height.lean

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,8 @@ theorem chainHeight_insert_of_forall_gt (a : α) (hx : ∀ b ∈ s, a < b) :
271271
refine ⟨a::l, ⟨?_, ?_⟩, by simp⟩
272272
· rw [chain'_cons']
273273
exact ⟨fun y hy ↦ hx _ (hl.2 _ (mem_of_mem_head? hy)), hl.1
274-
· -- Porting note: originally this was
275-
-- rintro x (rfl | hx)
276-
-- exacts [Or.inl (Set.mem_singleton x), Or.inr (hl.2 x hx)]
277-
-- but this fails because `List.Mem` is now an inductive prop.
278-
-- I couldn't work out how to drive `rcases` here but asked at
279-
-- https://leanprover.zulipchat.com/#narrow/stream/348111-std4/topic/rcases.3F/near/347976083
280-
rintro x (_ | _)
281-
exacts [Or.inl (Set.mem_singleton a), Or.inr (hl.2 x ‹_›)]
274+
· rintro x (_ | _)
275+
exacts [Or.inl (Set.mem_singleton a), Or.inr (hl.2 x ‹x ∈ l›)]
282276

283277
theorem chainHeight_insert_of_forall_lt (a : α) (ha : ∀ b ∈ s, b < a) :
284278
(insert a s).chainHeight = s.chainHeight + 1 := by

Mathlib/Order/Heyting/Hom.lean

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ instance instHeytingHomClass : HeytingHomClass (HeytingHom α β) α β where
248248
map_bot f := f.map_bot'
249249
map_himp := HeytingHom.map_himp'
250250

251-
-- @[simp] -- Porting note: not in simp-nf, simp can simplify lhs. Added aux simp lemma
252251
theorem toFun_eq_coe {f : HeytingHom α β} : f.toFun = ⇑f :=
253252
rfl
254253

@@ -354,7 +353,6 @@ instance : CoheytingHomClass (CoheytingHom α β) α β where
354353
map_top f := f.map_top'
355354
map_sdiff := CoheytingHom.map_sdiff'
356355

357-
-- @[simp] -- Porting note: not in simp-nf, simp can simplify lhs. Added aux simp lemma
358356
theorem toFun_eq_coe {f : CoheytingHom α β} : f.toFun = (f : α → β) :=
359357
rfl
360358

@@ -460,7 +458,6 @@ instance : BiheytingHomClass (BiheytingHom α β) α β where
460458
map_himp f := f.map_himp'
461459
map_sdiff f := f.map_sdiff'
462460

463-
-- @[simp] -- Porting note: not in simp-nf, simp can simplify lhs. Added aux simp lemma
464461
theorem toFun_eq_coe {f : BiheytingHom α β} : f.toFun = (f : α → β) :=
465462
rfl
466463

Mathlib/Order/PropInstances.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ theorem Prop.isCompl_iff {P Q : Prop} : IsCompl P Q ↔ ¬(P ↔ Q) := by
9292
rw [_root_.isCompl_iff, Prop.disjoint_iff, Prop.codisjoint_iff, not_iff]
9393
by_cases P <;> by_cases Q <;> simp [*]
9494

95-
-- Porting note: Lean 3 would unfold these for us, but we need to do it manually now
9695
section decidable_instances
9796

9897
universe u

0 commit comments

Comments
 (0)