fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
oadd_lt_oadd_2 {e o₁ o₂ : ONote} {n₁ n₂ : ℕ+} (h₁ : NF (oadd e n₁ o₁)) (h : (n₁ : ℕ) < n₂) : oadd e n₁ o₁ < oadd e n₂ o₂ := by simp only [lt_def, repr] refine lt_of_lt_of_le ((add_lt_add_iff_left _).2 h₁.snd'.repr_lt) (le_trans ?_ (le_add_right _ _)) rwa [← mul_succ, mul_le_mul_iff_right₀ (opow_pos _ omega0_p...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
oadd_lt_oadd_2
null
oadd_lt_oadd_3 {e n a₁ a₂} (h : a₁ < a₂) : oadd e n a₁ < oadd e n a₂ := by rw [lt_def]; unfold repr exact @add_lt_add_left _ _ _ _ (repr a₁) _ h _
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
oadd_lt_oadd_3
null
cmp_compares : ∀ (a b : ONote) [NF a] [NF b], (cmp a b).Compares a b | 0, 0, _, _ => rfl | oadd _ _ _, 0, _, _ => oadd_pos _ _ _ | 0, oadd _ _ _, _, _ => oadd_pos _ _ _ | o₁@(oadd e₁ n₁ a₁), o₂@(oadd e₂ n₂ a₂), h₁, h₂ => by -- TODO: golf rw [cmp] have IHe := @cmp_compares _ _ h₁.fst h₂.fst simp only...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
cmp_compares
null
repr_inj {a b} [NF a] [NF b] : repr a = repr b ↔ a = b := ⟨fun e => match cmp a b, cmp_compares a b with | Ordering.lt, (h : repr a < repr b) => (ne_of_lt h e).elim | Ordering.gt, (h : repr a > repr b)=> (ne_of_gt h e).elim | Ordering.eq, h => h, congr_arg _⟩
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_inj
null
NF.of_dvd_omega0_opow {b e n a} (h : NF (ONote.oadd e n a)) (d : ω ^ b ∣ repr (ONote.oadd e n a)) : b ≤ repr e ∧ ω ^ b ∣ repr a := by have := mt repr_inj.1 (fun h => by injection h : ONote.oadd e n a ≠ 0) have L := le_of_not_gt fun l => not_le_of_gt (h.below_of_lt l).repr_lt (le_of_dvd this d) simp only [...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
NF.of_dvd_omega0_opow
null
NF.of_dvd_omega0 {e n a} (h : NF (ONote.oadd e n a)) : ω ∣ repr (ONote.oadd e n a) → repr e ≠ 0 ∧ ω ∣ repr a := by (rw [← opow_one ω, ← one_le_iff_ne_zero]; exact h.of_dvd_omega0_opow)
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
NF.of_dvd_omega0
null
TopBelow (b : ONote) : ONote → Prop | 0 => True | oadd e _ _ => cmp e b = Ordering.lt
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
TopBelow
`TopBelow b o` asserts that the largest exponent in `o`, if it exists, is less than `b`. This is an auxiliary definition for decidability of `NF`.
decidableTopBelow : DecidableRel TopBelow := by intro b o cases o <;> delta TopBelow <;> infer_instance
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
decidableTopBelow
null
nfBelow_iff_topBelow {b} [NF b] : ∀ {o}, NFBelow o (repr b) ↔ NF o ∧ TopBelow b o | 0 => ⟨fun h => ⟨⟨⟨_, h⟩⟩, trivial⟩, fun _ => NFBelow.zero⟩ | oadd _ _ _ => ⟨fun h => ⟨⟨⟨_, h⟩⟩, (@cmp_compares _ b h.fst _).eq_lt.2 h.lt⟩, fun ⟨h₁, h₂⟩ => h₁.below_of_lt <| (@cmp_compares _ b h₁.fst _).eq_lt.1 h₂⟩
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
nfBelow_iff_topBelow
null
decidableNF : DecidablePred NF | 0 => isTrue NF.zero | oadd e n a => by have := decidableNF e have := decidableNF a apply decidable_of_iff (NF e ∧ NF a ∧ TopBelow e a) rw [← and_congr_right fun h => @nfBelow_iff_topBelow _ h _] exact ⟨fun ⟨h₁, h₂⟩ => NF.oadd h₁ n h₂, fun h => ⟨h.fst, h.snd'⟩⟩
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
decidableNF
null
addAux (e : ONote) (n : ℕ+) (o : ONote) : ONote := match o with | 0 => oadd e n 0 | o'@(oadd e' n' a') => match cmp e e' with | Ordering.lt => o' | Ordering.eq => oadd e (n + n') a' | Ordering.gt => oadd e n o'
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
addAux
Auxiliary definition for `add`
add : ONote → ONote → ONote | 0, o => o | oadd e n a, o => addAux e n (add a o)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
add
Addition of ordinal notations (correct only for normal input)
@[simp] zero_add (o : ONote) : 0 + o = o := rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
zero_add
null
oadd_add (e n a o) : oadd e n a + o = addAux e n (a + o) := rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
oadd_add
null
sub : ONote → ONote → ONote | 0, _ => 0 | o, 0 => o | o₁@(oadd e₁ n₁ a₁), oadd e₂ n₂ a₂ => match cmp e₁ e₂ with | Ordering.lt => 0 | Ordering.gt => o₁ | Ordering.eq => match (n₁ : ℕ) - n₂ with | 0 => if n₁ = n₂ then sub a₁ a₂ else 0 | Nat.succ k => oadd e₁ k.succPNat a₁
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
sub
Subtraction of ordinal notations (correct only for normal input)
add_nfBelow {b} : ∀ {o₁ o₂}, NFBelow o₁ b → NFBelow o₂ b → NFBelow (o₁ + o₂) b | 0, _, _, h₂ => h₂ | oadd e n a, o, h₁, h₂ => by have h' := add_nfBelow (h₁.snd.mono <| le_of_lt h₁.lt) h₂ simp only [oadd_add]; revert h'; obtain - | ⟨e', n', a'⟩ := a + o <;> intro h' · exact NFBelow.oadd h₁.fst NFBelow.ze...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
add_nfBelow
null
add_nf (o₁ o₂) : ∀ [NF o₁] [NF o₂], NF (o₁ + o₂) | ⟨⟨b₁, h₁⟩⟩, ⟨⟨b₂, h₂⟩⟩ => ⟨(le_total b₁ b₂).elim (fun h => ⟨b₂, add_nfBelow (h₁.mono h) h₂⟩) fun h => ⟨b₁, add_nfBelow h₁ (h₂.mono h)⟩⟩ @[simp]
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
add_nf
null
repr_add : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ + o₂) = repr o₁ + repr o₂ | 0, o, _, _ => by simp | oadd e n a, o, h₁, h₂ => by haveI := h₁.snd; have h' := repr_add a o conv_lhs at h' => simp [HAdd.hAdd, Add.add] have nf := ONote.add_nf a o conv at nf => simp [HAdd.hAdd, Add.add] conv in _ + o =>...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_add
null
sub_nfBelow : ∀ {o₁ o₂ b}, NFBelow o₁ b → NF o₂ → NFBelow (o₁ - o₂) b | 0, o, b, _, h₂ => by cases o <;> exact NFBelow.zero | oadd _ _ _, 0, _, h₁, _ => h₁ | oadd e₁ n₁ a₁, oadd e₂ n₂ a₂, b, h₁, h₂ => by have h' := sub_nfBelow h₁.snd h₂.snd simp only [HSub.hSub, Sub.sub, sub] at h' ⊢ have := @cmp_comp...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
sub_nfBelow
null
sub_nf (o₁ o₂) : ∀ [NF o₁] [NF o₂], NF (o₁ - o₂) | ⟨⟨b₁, h₁⟩⟩, h₂ => ⟨⟨b₁, sub_nfBelow h₁ h₂⟩⟩ @[simp]
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
sub_nf
null
repr_sub : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ - o₂) = repr o₁ - repr o₂ | 0, o, _, h₂ => by cases o <;> exact (Ordinal.zero_sub _).symm | oadd _ _ _, 0, _, _ => (Ordinal.sub_zero _).symm | oadd e₁ n₁ a₁, oadd e₂ n₂ a₂, h₁, h₂ => by haveI := h₁.snd; haveI := h₂.snd; have h' := repr_sub a₁ a₂ conv_lhs at h...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_sub
null
mul : ONote → ONote → ONote | 0, _ => 0 | _, 0 => 0 | o₁@(oadd e₁ n₁ a₁), oadd e₂ n₂ a₂ => if e₂ = 0 then oadd e₁ (n₁ * n₂) a₁ else oadd (e₁ + e₂) n₂ (mul o₁ a₂)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
mul
Multiplication of ordinal notations (correct only for normal input)
oadd_mul (e₁ n₁ a₁ e₂ n₂ a₂) : oadd e₁ n₁ a₁ * oadd e₂ n₂ a₂ = if e₂ = 0 then oadd e₁ (n₁ * n₂) a₁ else oadd (e₁ + e₂) n₂ (oadd e₁ n₁ a₁ * a₂) := rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
oadd_mul
null
oadd_mul_nfBelow {e₁ n₁ a₁ b₁} (h₁ : NFBelow (oadd e₁ n₁ a₁) b₁) : ∀ {o₂ b₂}, NFBelow o₂ b₂ → NFBelow (oadd e₁ n₁ a₁ * o₂) (repr e₁ + b₂) | 0, _, _ => NFBelow.zero | oadd e₂ n₂ a₂, b₂, h₂ => by have IH := oadd_mul_nfBelow h₁ h₂.snd by_cases e0 : e₂ = 0 <;> simp only [e0, oadd_mul, ↓reduceIte] · appl...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
oadd_mul_nfBelow
null
mul_nf : ∀ (o₁ o₂) [NF o₁] [NF o₂], NF (o₁ * o₂) | 0, o, _, h₂ => by cases o <;> exact NF.zero | oadd _ _ _, _, ⟨⟨_, hb₁⟩⟩, ⟨⟨_, hb₂⟩⟩ => ⟨⟨_, oadd_mul_nfBelow hb₁ hb₂⟩⟩ @[simp]
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
mul_nf
null
repr_mul : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ * o₂) = repr o₁ * repr o₂ | 0, o, _, h₂ => by cases o <;> exact (zero_mul _).symm | oadd _ _ _, 0, _, _ => (mul_zero _).symm | oadd e₁ n₁ a₁, oadd e₂ n₂ a₂, h₁, h₂ => by have IH : repr (mul _ _) = _ := @repr_mul _ _ h₁ h₂.snd conv => lhs simp [(· ...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_mul
null
split' : ONote → ONote × ℕ | 0 => (0, 0) | oadd e n a => if e = 0 then (0, n) else let (a', m) := split' a (oadd (e - 1) n a', m)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
split'
Calculate division and remainder of `o` mod `ω`: `split' o = (a, n)` means `o = ω * a + n`.
split : ONote → ONote × ℕ | 0 => (0, 0) | oadd e n a => if e = 0 then (0, n) else let (a', m) := split a (oadd e n a', m)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
split
Calculate division and remainder of `o` mod `ω`: `split o = (a, n)` means `o = a + n`, where `ω ∣ a`.
scale (x : ONote) : ONote → ONote | 0 => 0 | oadd e n a => oadd (x + e) n (scale x a)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
scale
`scale x o` is the ordinal notation for `ω ^ x * o`.
mulNat : ONote → ℕ → ONote | 0, _ => 0 | _, 0 => 0 | oadd e n a, m + 1 => oadd e (n * m.succPNat) a
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
mulNat
`mulNat o n` is the ordinal notation for `o * n`.
opowAux (e a0 a : ONote) : ℕ → ℕ → ONote | _, 0 => 0 | 0, m + 1 => oadd e m.succPNat 0 | k + 1, m => scale (e + mulNat a0 k) a + (opowAux e a0 a k m)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
opowAux
Auxiliary definition to compute the ordinal notation for the ordinal exponentiation in `opow`
opowAux2 (o₂ : ONote) (o₁ : ONote × ℕ) : ONote := match o₁ with | (0, 0) => if o₂ = 0 then 1 else 0 | (0, 1) => 1 | (0, m + 1) => let (b', k) := split' o₂ oadd b' (m.succPNat ^ k) 0 | (a@(oadd a0 _ _), m) => match split o₂ with | (b, 0) => oadd (a0 * b) 1 0 | (b, k + 1) => let eb := ...
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
opowAux2
Auxiliary definition to compute the ordinal notation for the ordinal exponentiation in `opow`
opow (o₁ o₂ : ONote) : ONote := opowAux2 o₂ (split o₁)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
opow
`opow o₁ o₂` calculates the ordinal notation for the ordinal exponential `o₁ ^ o₂`.
opow_def (o₁ o₂ : ONote) : o₁ ^ o₂ = opowAux2 o₂ (split o₁) := rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
opow_def
null
split_eq_scale_split' : ∀ {o o' m} [NF o], split' o = (o', m) → split o = (scale 1 o', m) | 0, o', m, _, p => by injection p; substs o' m; rfl | oadd e n a, o', m, h, p => by by_cases e0 : e = 0 <;> simp only [split', e0, ↓reduceIte, Prod.mk.injEq, split] at p ⊢ · rcases p with ⟨rfl, rfl⟩ exact ⟨rfl, ...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
split_eq_scale_split'
null
nf_repr_split' : ∀ {o o' m} [NF o], split' o = (o', m) → NF o' ∧ repr o = ω * repr o' + m | 0, o', m, _, p => by injection p; substs o' m; simp [NF.zero] | oadd e n a, o', m, h, p => by by_cases e0 : e = 0 <;> simp only [split', e0, ↓reduceIte, Prod.mk.injEq, repr, repr_zero, opow_zero, one_mul] at p ⊢ ...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
nf_repr_split'
null
scale_eq_mul (x) [NF x] : ∀ (o) [NF o], scale x o = oadd x 1 0 * o | 0, _ => rfl | oadd e n a, h => by simp only [HMul.hMul]; simp only [scale] haveI := h.snd by_cases e0 : e = 0 · simp_rw [scale_eq_mul] simp [Mul.mul, mul, e0, h.zero_of_zero, show x + 0 = x from repr_inj.1 (by simp)] ...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
scale_eq_mul
null
nf_scale (x) [NF x] (o) [NF o] : NF (scale x o) := by rw [scale_eq_mul] infer_instance @[simp]
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
nf_scale
null
repr_scale (x) [NF x] (o) [NF o] : repr (scale x o) = ω ^ repr x * repr o := by simp only [scale_eq_mul, repr_mul, repr, PNat.one_coe, Nat.cast_one, mul_one, add_zero]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_scale
null
nf_repr_split {o o' m} [NF o] (h : split o = (o', m)) : NF o' ∧ repr o = repr o' + m := by rcases e : split' o with ⟨a, n⟩ obtain ⟨s₁, s₂⟩ := nf_repr_split' e rw [split_eq_scale_split' e] at h injection h; substs o' n simp only [repr_scale, repr_one, Nat.cast_one, opow_one, ← s₂, and_true] infer_instance
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
nf_repr_split
null
split_dvd {o o' m} [NF o] (h : split o = (o', m)) : ω ∣ repr o' := by rcases e : split' o with ⟨a, n⟩ rw [split_eq_scale_split' e] at h injection h; subst o' cases nf_repr_split' e; simp
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
split_dvd
null
split_add_lt {o e n a m} [NF o] (h : split o = (oadd e n a, m)) : repr a + m < ω ^ repr e := by obtain ⟨h₁, h₂⟩ := nf_repr_split h obtain ⟨e0, d⟩ := h₁.of_dvd_omega0 (split_dvd h) apply principal_add_omega0_opow _ h₁.snd'.repr_lt (lt_of_lt_of_le (nat_lt_omega0 _) _) simpa using opow_le_opow_right omega0_pos...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
split_add_lt
null
mulNat_eq_mul (n o) : mulNat o n = o * ofNat n := by cases o <;> cases n <;> rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
mulNat_eq_mul
null
nf_mulNat (o) [NF o] (n) : NF (mulNat o n) := by simpa using ONote.mul_nf o (ofNat n)
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
nf_mulNat
null
nf_opowAux (e a0 a) [NF e] [NF a0] [NF a] : ∀ k m, NF (opowAux e a0 a k m) := by intro k m unfold opowAux cases m with | zero => cases k <;> exact NF.zero | succ m => cases k with | zero => exact NF.oadd_zero _ _ | succ k => haveI := nf_opowAux e a0 a k simp only [mulNat_eq_mul]; infer...
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
nf_opowAux
null
nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by rcases e₁ : split o₁ with ⟨a, m⟩ have na := (nf_repr_split e₁).1 rcases e₂ : split' o₂ with ⟨b', k⟩ haveI := (nf_repr_split' e₂).1 obtain - | ⟨a0, n, a'⟩ := a · rcases m with - | m · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, opow, opowAux2, *] ...
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
nf_opow
null
scale_opowAux (e a0 a : ONote) [NF e] [NF a0] [NF a] : ∀ k m, repr (opowAux e a0 a k m) = ω ^ repr e * repr (opowAux 0 a0 a k m) | 0, m => by cases m <;> simp [opowAux] | k + 1, m => by by_cases h : m = 0 <;> simp only [h, opowAux, mulNat_eq_mul, repr_add, repr_scale, repr_mul, repr_ofNat, zero_add, m...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
scale_opowAux
null
repr_opow_aux₁ {e a} [Ne : NF e] [Na : NF a] {a' : Ordinal} (e0 : repr e ≠ 0) (h : a' < (ω : Ordinal.{0}) ^ repr e) (aa : repr a = a') (n : ℕ+) : ((ω : Ordinal.{0}) ^ repr e * (n : ℕ) + a') ^ (ω : Ordinal.{0}) = (ω ^ repr e) ^ (ω : Ordinal.{0}) := by subst aa have No := Ne.oadd n (Na.below_of_lt' h) ...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_opow_aux₁
null
repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω ∣ repr a') (e0 : repr a0 ≠ 0) (h : repr a' + m < (ω ^ repr a0)) (n : ℕ+) (k : ℕ) : let R := repr (opowAux 0 a0 (oadd a0 n a' * ofNat m) k m) (k ≠ 0 → R < ((ω ^ repr a0) ^ succ (k : Ordinal))) ∧ ((ω ^ repr a0) ^ (k : Ordinal)) * ((ω ^ rep...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_opow_aux₂
null
repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o₁ ^ repr o₂ := by rcases e₁ : split o₁ with ⟨a, m⟩ obtain ⟨N₁, r₁⟩ := nf_repr_split e₁ obtain - | ⟨a0, n, a'⟩ := a · rcases m with - | m · by_cases h : o₂ = 0 <;> simp [opow_def, opowAux2, e₁, h, r₁] have := mt repr_inj.1 h rw [zero_opow...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_opow
null
fundamentalSequence : ONote → (Option ONote) ⊕ (ℕ → ONote) | zero => Sum.inl none | oadd a m b => match fundamentalSequence b with | Sum.inr f => Sum.inr fun i => oadd a m (f i) | Sum.inl (some b') => Sum.inl (some (oadd a m b')) | Sum.inl none => match fundamentalSequence a, m.natPred with ...
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fundamentalSequence
Given an ordinal, returns: * `inl none` for `0` * `inl (some a)` for `a + 1` * `inr f` for a limit ordinal `a`, where `f i` is a sequence converging to `a`
private exists_lt_add {α} [hα : Nonempty α] {o : Ordinal} {f : α → Ordinal} (H : ∀ ⦃a⦄, a < o → ∃ i, a < f i) {b : Ordinal} ⦃a⦄ (h : a < b + o) : ∃ i, a < b + f i := by rcases lt_or_ge a b with h | h' · obtain ⟨i⟩ := id hα exact ⟨i, h.trans_le (le_add_right _ _)⟩ · rw [← Ordinal.add_sub_cancel_of_le h', a...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
exists_lt_add
null
private exists_lt_mul_omega0' {o : Ordinal} ⦃a⦄ (h : a < o * ω) : ∃ i : ℕ, a < o * ↑i + o := by obtain ⟨i, hi, h'⟩ := (lt_mul_iff_of_isSuccLimit isSuccLimit_omega0).1 h obtain ⟨i, rfl⟩ := lt_omega0.1 hi exact ⟨i, h'.trans_le (le_add_right _ _)⟩
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
exists_lt_mul_omega0'
null
private exists_lt_omega0_opow' {α} {o b : Ordinal} (hb : 1 < b) (ho : IsSuccLimit o) {f : α → Ordinal} (H : ∀ ⦃a⦄, a < o → ∃ i, a < f i) ⦃a⦄ (h : a < b ^ o) : ∃ i, a < b ^ f i := by obtain ⟨d, hd, h'⟩ := (lt_opow_of_isSuccLimit (zero_lt_one.trans hb).ne' ho).1 h exact (H hd).imp fun i hi => h'.trans <| ...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
exists_lt_omega0_opow'
null
FundamentalSequenceProp (o : ONote) : (Option ONote) ⊕ (ℕ → ONote) → Prop | Sum.inl none => o = 0 | Sum.inl (some a) => o.repr = succ a.repr ∧ (o.NF → a.NF) | Sum.inr f => IsSuccLimit o.repr ∧ (∀ i, f i < f (i + 1) ∧ f i < o ∧ (o.NF → (f i).NF)) ∧ ∀ a, a < o.repr → ∃ i, a < (f i).repr
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
FundamentalSequenceProp
The property satisfied by `fundamentalSequence o`: * `inl none` means `o = 0` * `inl (some a)` means `o = succ a` * `inr f` means `o` is a limit ordinal and `f` is a strictly increasing sequence which converges to `o`
fundamentalSequenceProp_inl_none (o) : FundamentalSequenceProp o (Sum.inl none) ↔ o = 0 := Iff.rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fundamentalSequenceProp_inl_none
null
fundamentalSequenceProp_inl_some (o a) : FundamentalSequenceProp o (Sum.inl (some a)) ↔ o.repr = succ a.repr ∧ (o.NF → a.NF) := Iff.rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fundamentalSequenceProp_inl_some
null
fundamentalSequenceProp_inr (o f) : FundamentalSequenceProp o (Sum.inr f) ↔ IsSuccLimit o.repr ∧ (∀ i, f i < f (i + 1) ∧ f i < o ∧ (o.NF → (f i).NF)) ∧ ∀ a, a < o.repr → ∃ i, a < (f i).repr := Iff.rfl
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fundamentalSequenceProp_inr
null
fundamentalSequence_has_prop (o) : FundamentalSequenceProp o (fundamentalSequence o) := by induction o with | zero => exact rfl | oadd a m b iha ihb rw [fundamentalSequence] rcases e : b.fundamentalSequence with (⟨_ | b'⟩ | f) <;> simp only [FundamentalSequenceProp] <;> rw [e, FundamentalSequenceProp]...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fundamentalSequence_has_prop
null
fastGrowing : ONote → ℕ → ℕ | o => match fundamentalSequence o, fundamentalSequence_has_prop o with | Sum.inl none, _ => Nat.succ | Sum.inl (some a), h => have : a < o := by rw [lt_def, h.1]; apply lt_succ fun i => (fastGrowing a)^[i] i | Sum.inr f, h => fun i => have : f i < o := (h...
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing
The fast growing hierarchy for ordinal notations `< ε₀`. This is a sequence of functions `ℕ → ℕ` indexed by ordinals, with the definition: * `f_0(n) = n + 1` * `f_(α + 1)(n) = f_α^[n](n)` * `f_α(n) = f_(α[n])(n)` where `α` is a limit ordinal and `α[i]` is the fundamental sequence converging to `α`
fastGrowing_def {o : ONote} {x} (e : fundamentalSequence o = x) : fastGrowing o = match (motive := (x : Option ONote ⊕ (ℕ → ONote)) → FundamentalSequenceProp o x → ℕ → ℕ) x, e ▸ fundamentalSequence_has_prop o with | Sum.inl none, _ => Nat.succ | Sum.inl (some a), _ => fun i...
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing_def
null
fastGrowing_zero' (o : ONote) (h : fundamentalSequence o = Sum.inl none) : fastGrowing o = Nat.succ := by rw [fastGrowing_def h]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing_zero'
null
fastGrowing_succ (o) {a} (h : fundamentalSequence o = Sum.inl (some a)) : fastGrowing o = fun i => (fastGrowing a)^[i] i := by rw [fastGrowing_def h]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing_succ
null
fastGrowing_limit (o) {f} (h : fundamentalSequence o = Sum.inr f) : fastGrowing o = fun i => fastGrowing (f i) i := by rw [fastGrowing_def h] @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing_limit
null
fastGrowing_zero : fastGrowing 0 = Nat.succ := fastGrowing_zero' _ rfl @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing_zero
null
fastGrowing_one : fastGrowing 1 = fun n => 2 * n := by rw [@fastGrowing_succ 1 0 rfl]; funext i; rw [two_mul, fastGrowing_zero] suffices ∀ a b, Nat.succ^[a] b = b + a from this _ _ intro a b; induction a <;> simp [*, Function.iterate_succ', Nat.add_assoc, -Function.iterate_succ] @[simp]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing_one
null
fastGrowing_two : fastGrowing 2 = fun n => (2 ^ n) * n := by rw [@fastGrowing_succ 2 1 rfl] simp
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowing_two
null
fastGrowingε₀ (i : ℕ) : ℕ := fastGrowing ((fun a => a.oadd 1 0)^[i] 0) i
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowingε₀
We can extend the fast growing hierarchy one more step to `ε₀` itself, using `ω ^ (ω ^ (⋯ ^ ω))` as the fundamental sequence converging to `ε₀` (which is not an `ONote`). Extending the fast growing hierarchy beyond this requires a definition of fundamental sequence for larger ordinals.
fastGrowingε₀_zero : fastGrowingε₀ 0 = 1 := by simp [fastGrowingε₀]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowingε₀_zero
null
fastGrowingε₀_one : fastGrowingε₀ 1 = 2 := by simp [fastGrowingε₀, show oadd 0 1 0 = 1 from rfl]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowingε₀_one
null
fastGrowingε₀_two : fastGrowingε₀ 2 = 2048 := by norm_num [fastGrowingε₀, show oadd 0 1 0 = 1 from rfl, @fastGrowing_limit (oadd 1 1 0) _ rfl, show oadd 0 (2 : Nat).succPNat 0 = 3 from rfl, @fastGrowing_succ 3 2 rfl]
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
fastGrowingε₀_two
null
NONote := { o : ONote // o.NF }
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
NONote
The type of normal ordinal notations. It would have been nicer to define this right in the inductive type, but `NF o` requires `repr` which requires `ONote`, so all these things would have to be defined at once, which messes up the VM representation.
NF (o : NONote) : NF o.1 := o.2
instance
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
NF
null
mk (o : ONote) [h : ONote.NF o] : NONote := ⟨o, h⟩
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
mk
Construct a `NONote` from an ordinal notation (and infer normality)
noncomputable repr (o : NONote) : Ordinal := o.1.repr
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr
The ordinal represented by an ordinal notation. This function is noncomputable because ordinal arithmetic is noncomputable. In computational applications `NONote` can be used exclusively without reference to `Ordinal`, but this function allows for correctness results to be stated.
lt_wf : @WellFounded NONote (· < ·) := InvImage.wf repr Ordinal.lt_wf
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
lt_wf
null
ofNat (n : ℕ) : NONote := ⟨ONote.ofNat n, ⟨⟨_, nfBelow_ofNat _⟩⟩⟩
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
ofNat
Convert a natural number to an ordinal notation
cmp (a b : NONote) : Ordering := ONote.cmp a.1 b.1
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
cmp
Compare ordinal notations
cmp_compares : ∀ a b : NONote, (cmp a b).Compares a b | ⟨a, ha⟩, ⟨b, hb⟩ => by dsimp [cmp] have := ONote.cmp_compares a b cases h : ONote.cmp a b <;> simp only [h] at this <;> try exact this exact Subtype.mk_eq_mk.2 this
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
cmp_compares
null
below (a b : NONote) : Prop := NFBelow a.1 (repr b)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
below
Asserts that `repr a < ω ^ repr b`. Used in `NONote.recOn`.
oadd (e : NONote) (n : ℕ+) (a : NONote) (h : below a e) : NONote := ⟨_, NF.oadd e.2 n h⟩
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
oadd
The `oadd` pseudo-constructor for `NONote`
@[elab_as_elim] recOn {C : NONote → Sort*} (o : NONote) (H0 : C 0) (H1 : ∀ e n a h, C e → C a → C (oadd e n a h)) : C o := by obtain ⟨o, h⟩ := o; induction o with | zero => exact H0 | oadd e n a IHe IHa => exact H1 ⟨e, h.fst⟩ n ⟨a, h.snd⟩ h.snd' (IHe _) (IHa _)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
recOn
This is a recursor-like theorem for `NONote` suggesting an inductive definition, which can't actually be defined this way due to conflicting dependencies.
opow (x y : NONote) := mk (x.1 ^ y.1)
def
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
opow
Addition of ordinal notations -/ instance : Add NONote := ⟨fun x y => mk (x.1 + y.1)⟩ theorem repr_add (a b) : repr (a + b) = repr a + repr b := ONote.repr_add a.1 b.1 /-- Subtraction of ordinal notations -/ instance : Sub NONote := ⟨fun x y => mk (x.1 - y.1)⟩ theorem repr_sub (a b) : repr (a - b) = repr a - r...
repr_opow (a b) : repr (opow a b) = repr a ^ repr b := ONote.repr_opow a.1 b.1
theorem
SetTheory
[ "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Ordering.Lemmas", "Mathlib.Data.PNat.Basic", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.Tactic.NormNum" ]
Mathlib/SetTheory/Ordinal/Notation.lean
repr_opow
null
Principal (op : Ordinal → Ordinal → Ordinal) (o : Ordinal) : Prop := ∀ ⦃a b⦄, a < o → b < o → op a b < o
def
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
Principal
An ordinal `o` is said to be principal or indecomposable under an operation when the set of ordinals less than it is closed under that operation. In standard mathematical usage, this term is almost exclusively used for additive and multiplicative principal ordinals. For simplicity, we break usual convention and regard...
principal_swap_iff : Principal (Function.swap op) o ↔ Principal op o := by constructor <;> exact fun h a b ha hb => h hb ha
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
principal_swap_iff
null
not_principal_iff : ¬ Principal op o ↔ ∃ a < o, ∃ b < o, o ≤ op a b := by simp [Principal]
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
not_principal_iff
null
principal_iff_of_monotone (h₁ : ∀ a, Monotone (op a)) (h₂ : ∀ a, Monotone (Function.swap op a)) : Principal op o ↔ ∀ a < o, op a a < o := by use fun h a ha => h ha ha intro H a b ha hb obtain hab | hba := le_or_gt a b · exact (h₂ b hab).trans_lt <| H b hb · exact (h₁ a hba.le).trans_lt <| H a ha
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
principal_iff_of_monotone
null
not_principal_iff_of_monotone (h₁ : ∀ a, Monotone (op a)) (h₂ : ∀ a, Monotone (Function.swap op a)) : ¬ Principal op o ↔ ∃ a < o, o ≤ op a a := by simp [principal_iff_of_monotone h₁ h₂] @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
not_principal_iff_of_monotone
null
principal_zero : Principal op 0 := fun a _ h => (Ordinal.not_lt_zero a h).elim @[simp]
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
principal_zero
null
principal_one_iff : Principal op 1 ↔ op 0 0 = 0 := by refine ⟨fun h => ?_, fun h a b ha hb => ?_⟩ · rw [← lt_one_iff_zero] exact h zero_lt_one zero_lt_one · rwa [lt_one_iff_zero, ha, hb] at *
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
principal_one_iff
null
Principal.iterate_lt (hao : a < o) (ho : Principal op o) (n : ℕ) : (op a)^[n] a < o := by induction n with | zero => rwa [Function.iterate_zero] | succ n hn => rw [Function.iterate_succ'] exact ho hao hn
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
Principal.iterate_lt
null
op_eq_self_of_principal (hao : a < o) (H : IsNormal (op a)) (ho : Principal op o) (ho' : IsSuccLimit o) : op a o = o := by apply H.le_apply.antisymm' rw [H.apply_of_isSuccLimit ho', Ordinal.iSup_le_iff] exact fun ⟨b, hbo⟩ ↦ (ho hao hbo).le
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
op_eq_self_of_principal
null
nfp_le_of_principal (hao : a < o) (ho : Principal op o) : nfp (op a) a ≤ o := nfp_le fun n => (ho.iterate_lt hao n).le
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
nfp_le_of_principal
null
protected Principal.sSup {s : Set Ordinal} (H : ∀ x ∈ s, Principal op x) : Principal op (sSup s) := by have : Principal op (sSup ∅) := by simp by_cases hs : BddAbove s · obtain rfl | hs' := s.eq_empty_or_nonempty · assumption simp only [Principal, lt_csSup_iff hs hs', forall_exists_index, and_imp] ...
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
Principal.sSup
null
protected Principal.iSup {ι} {f : ι → Ordinal} (H : ∀ i, Principal op (f i)) : Principal op (⨆ i, f i) := Principal.sSup (by simpa)
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
Principal.iSup
null
private principal_nfp_iSup (op : Ordinal → Ordinal → Ordinal) (o : Ordinal) : Principal op (nfp (fun x ↦ ⨆ y : Set.Iio x ×ˢ Set.Iio x, succ (op y.1.1 y.1.2)) o) := by intro a b ha hb rw [lt_nfp_iff] at * obtain ⟨m, ha⟩ := ha obtain ⟨n, hb⟩ := hb obtain h | h := le_total ((fun x ↦ ⨆ y : Set.Iio x ×ˢ Se...
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
principal_nfp_iSup
We give an explicit construction for a principal ordinal larger or equal than `o`.
not_bddAbove_principal (op : Ordinal → Ordinal → Ordinal) : ¬ BddAbove { o | Principal op o } := by rintro ⟨a, ha⟩ exact ((le_nfp _ _).trans (ha (principal_nfp_iSup op (succ a)))).not_gt (lt_succ a) /-! #### Additive principal ordinals -/
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
not_bddAbove_principal
Principal ordinals under any operation are unbounded.
principal_add_one : Principal (· + ·) 1 := principal_one_iff.2 <| zero_add 0
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
principal_add_one
null
principal_add_of_le_one (ho : o ≤ 1) : Principal (· + ·) o := by rcases le_one_iff.1 ho with (rfl | rfl) · exact principal_zero · exact principal_add_one
theorem
SetTheory
[ "Mathlib.SetTheory.Ordinal.FixedPoint" ]
Mathlib/SetTheory/Ordinal/Principal.lean
principal_add_of_le_one
null