Skip to content

Commit

Permalink
chore: swap the names of InitialSeg.init and InitialSeg.init' (#2581
Browse files Browse the repository at this point in the history
  • Loading branch information
negiizhao committed Mar 2, 2023
1 parent 28d1ea5 commit 591e208
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions Mathlib/Order/InitialSeg.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Floris van Doorn
! This file was ported from Lean 3 source module order.initial_seg
! leanprover-community/mathlib commit 7c3269ca3fa4c0c19e4d127cd7151edbdbf99ed4
! leanprover-community/mathlib commit 8da9e30545433fdd8fe55a0d3da208e5d9263f03
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Expand Down Expand Up @@ -52,7 +52,7 @@ embedding whose range is an initial segment. That is, whenever `b < f a` in `β`
range of `f`. -/
structure InitialSeg {α β : Type _} (r : α → α → Prop) (s : β → β → Prop) extends r ↪r s where
/-- The order embedding is an initial segment -/
init : ∀ a b, s b (toRelEmbedding a) → ∃ a', toRelEmbedding a' = b
init' : ∀ a b, s b (toRelEmbedding a) → ∃ a', toRelEmbedding a' = b
#align initial_seg InitialSeg

-- Porting notes: Deleted `scoped[InitialSeg]`
Expand Down Expand Up @@ -83,17 +83,17 @@ theorem coe_coe_fn (f : r ≼i s) : ((f : r ↪r s) : α → β) = f :=
rfl
#align initial_seg.coe_coe_fn InitialSeg.coe_coe_fn

theorem init' (f : r ≼i s) {a : α} {b : β} : s b (f a) → ∃ a', f a' = b :=
f.init _ _
#align initial_seg.init' InitialSeg.init'
theorem init (f : r ≼i s) {a : α} {b : β} : s b (f a) → ∃ a', f a' = b :=
f.init' _ _
#align initial_seg.init InitialSeg.init

theorem map_rel_iff (f : r ≼i s) : s (f a) (f b) ↔ r a b :=
f.map_rel_iff'
#align initial_seg.map_rel_iff InitialSeg.map_rel_iff

theorem init_iff (f : r ≼i s) {a : α} {b : β} : s b (f a) ↔ ∃ a', f a' = b ∧ r a' a :=
fun h => by
rcases f.init' h with ⟨a', rfl⟩
rcases f.init h with ⟨a', rfl⟩
exact ⟨a', rfl, f.map_rel_iff.1 h⟩,
fun ⟨a', e, h⟩ => e ▸ f.map_rel_iff.2 h⟩
#align initial_seg.init_iff InitialSeg.init_iff
Expand Down Expand Up @@ -184,13 +184,13 @@ theorem eq_or_principal [IsWellOrder β s] (f : r ≼i s) :
rw [← e];
exact
(trichotomous _ _).resolve_right
(not_or_of_not (hn a) fun hl => not_exists.2 hn (f.init' hl))⟩⟩
(not_or_of_not (hn a) fun hl => not_exists.2 hn (f.init hl))⟩⟩
#align initial_seg.eq_or_principal InitialSeg.eq_or_principal

/-- Restrict the codomain of an initial segment -/
def codRestrict (p : Set β) (f : r ≼i s) (H : ∀ a, f a ∈ p) : r ≼i Subrel s p :=
⟨RelEmbedding.codRestrict p f H, fun a ⟨b, m⟩ h =>
let ⟨a', e⟩ := f.init' h
let ⟨a', e⟩ := f.init h
⟨a', by subst e; rfl⟩⟩
#align initial_seg.cod_restrict InitialSeg.codRestrict

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/SetTheory/Cardinal/Ordinal.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Mario Carneiro, Floris van Doorn
! This file was ported from Lean 3 source module set_theory.cardinal.ordinal
! leanprover-community/mathlib commit 40494fe75ecbd6d2ec61711baa630cf0a7b7d064
! leanprover-community/mathlib commit 8da9e30545433fdd8fe55a0d3da208e5d9263f03
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Expand Down Expand Up @@ -112,7 +112,7 @@ theorem alephIdx_le {a b} : alephIdx a ≤ alephIdx b ↔ a ≤ b := by
#align cardinal.aleph_idx_le Cardinal.alephIdx_le

theorem alephIdx.init {a b} : b < alephIdx a → ∃ c, alephIdx c = b :=
alephIdx.initialSeg.init _ _
alephIdx.initialSeg.init
#align cardinal.aleph_idx.init Cardinal.alephIdx.init

/-- The `aleph'` index function, which gives the ordinal index of a cardinal.
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/SetTheory/Ordinal/Arithmetic.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Floris van Doorn, Violeta Hernández Palacios
! This file was ported from Lean 3 source module set_theory.ordinal.arithmetic
! leanprover-community/mathlib commit f1e061e3caef3022f0daa99d670ecf2c30e0b5c6
! leanprover-community/mathlib commit 8da9e30545433fdd8fe55a0d3da208e5d9263f03
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Expand Down Expand Up @@ -109,7 +109,7 @@ instance add_contravariantClass_le : ContravariantClass Ordinal.{u} Ordinal.{u}
simpa only [Sum.lex_inr_inr, fr, InitialSeg.coe_coe_fn, Embedding.coeFn_mk] using
@RelEmbedding.map_rel_iff _ _ _ _ f.toRelEmbedding (Sum.inr a) (Sum.inr b)⟩,
fun a b H => by
rcases f.init' (by rw [fr] <;> exact Sum.lex_inr_inr.2 H) with ⟨a' | a', h⟩
rcases f.init (by rw [fr] <;> exact Sum.lex_inr_inr.2 H) with ⟨a' | a', h⟩
· rw [fl] at h
cases h
· rw [fr] at h
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/SetTheory/Ordinal/Basic.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Floris van Doorn
! This file was ported from Lean 3 source module set_theory.ordinal.basic
! leanprover-community/mathlib commit dc6c365e751e34d100e80fe6e314c3c3e0fd2988
! leanprover-community/mathlib commit 8da9e30545433fdd8fe55a0d3da208e5d9263f03
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Expand Down Expand Up @@ -466,7 +466,7 @@ theorem typein_apply {α β} {r : α → α → Prop} {s : β → β → Prop} [
(RelEmbedding.codRestrict _ ((Subrel.relEmbedding _ _).trans f) fun ⟨x, h⟩ => by
rw [RelEmbedding.trans_apply]; exact f.toRelEmbedding.map_rel_iff.2 h)
fun ⟨y, h⟩ => by
rcases f.init' h with ⟨a, rfl⟩
rcases f.init h with ⟨a, rfl⟩
exact ⟨⟨a, f.toRelEmbedding.map_rel_iff.1 h⟩,
Subtype.eq <| RelEmbedding.trans_apply _ _ _⟩⟩
#align ordinal.typein_apply Ordinal.typein_apply
Expand Down

0 comments on commit 591e208

Please sign in to comment.