l3lab/ntp-mathlib huggingface dataset:
theorem div_mul_cancel : ∀ {a b : Ordinal}, a ≠ 0 → a ∣ b → a * (b / a) = b
  | a, _, a0, ⟨b, rfl⟩ => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u_4}
a0 : a ≠ 0
b : Ordinal.{u_4}
⊢ a * (a * b / a) = a * b

Next tactic:
rw [mul_div_cancel _ a0]
theorem le_of_dvd : ∀ {a b : Ordinal}, b ≠ 0 → a ∣ b → a ≤ b
  -- Porting note: `⟨b, rfl⟩ => by` → `⟨b, e⟩ => by subst e`
  | a, _, b0, ⟨b, e⟩ => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a x✝ : Ordinal.{u_4}
b0 : x✝ ≠ 0
b : Ordinal.{u_4}
e : x✝ = a * b
⊢ a ≤ x✝

Next tactic:
subst e
theorem le_of_dvd : ∀ {a b : Ordinal}, b ≠ 0 → a ∣ b → a ≤ b
  -- Porting note: `⟨b, rfl⟩ => by` → `⟨b, e⟩ => by subst e`
  | a, _, b0, ⟨b, e⟩ => by
    subst e
    -- Porting note: `Ne` is required.
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
b0 : a * b ≠ 0
⊢ a ≤ a * b

Next tactic:
simpa only [mul_one] using
      mul_le_mul_left'
        (one_le_iff_ne_zero.2 fun h : b = 0 => by
          simp only [h, mul_zero, Ne, not_true_eq_false] at b0) a
theorem le_of_dvd : ∀ {a b : Ordinal}, b ≠ 0 → a ∣ b → a ≤ b
  -- Porting note: `⟨b, rfl⟩ => by` → `⟨b, e⟩ => by subst e`
  | a, _, b0, ⟨b, e⟩ => by
    subst e
    -- Porting note: `Ne` is required.
    simpa only [mul_one] using
      mul_le_mul_left'
        (one_le_iff_ne_zero.2 fun h : b = 0 => by
          

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
b0 : a * b ≠ 0
h : b = 0
⊢ False

Next tactic:
simp only [h, mul_zero, Ne, not_true_eq_false] at b0
theorem dvd_antisymm {a b : Ordinal} (h₁ : a ∣ b) (h₂ : b ∣ a) : a = b :=
  if a0 : a = 0 then by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h₁ : a ∣ b
h₂ : b ∣ a
a0 : a = 0
⊢ a = b

Next tactic:
subst a
theorem dvd_antisymm {a b : Ordinal} (h₁ : a ∣ b) (h₂ : b ∣ a) : a = b :=
  if a0 : a = 0 then by subst a; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
b : Ordinal.{u_4}
h₁ : 0 ∣ b
h₂ : b ∣ 0
⊢ 0 = b

Next tactic:
exact (eq_zero_of_zero_dvd h₁).symm
theorem dvd_antisymm {a b : Ordinal} (h₁ : a ∣ b) (h₂ : b ∣ a) : a = b :=
  if a0 : a = 0 then by subst a; exact (eq_zero_of_zero_dvd h₁).symm
  else
    if b0 : b = 0 then by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h₁ : a ∣ b
h₂ : b ∣ a
a0 : ¬a = 0
b0 : b = 0
⊢ a = b

Next tactic:
subst b
theorem dvd_antisymm {a b : Ordinal} (h₁ : a ∣ b) (h₂ : b ∣ a) : a = b :=
  if a0 : a = 0 then by subst a; exact (eq_zero_of_zero_dvd h₁).symm
  else
    if b0 : b = 0 then by subst b; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u_4}
a0 : ¬a = 0
h₁ : a ∣ 0
h₂ : 0 ∣ a
⊢ a = 0

Next tactic:
exact eq_zero_of_zero_dvd h₂
@[simp]
theorem mod_zero (a : Ordinal) : a % 0 = a := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u_4}
⊢ a % 0 = a

Next tactic:
simp only [mod_def, div_zero, zero_mul, sub_zero]
theorem mod_eq_of_lt {a b : Ordinal} (h : a < b) : a % b = a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h : a < b
⊢ a % b = a

Next tactic:
simp only [mod_def, div_eq_zero_of_lt h, mul_zero, sub_zero]
@[simp]
theorem zero_mod (b : Ordinal) : 0 % b = 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
b : Ordinal.{u_4}
⊢ 0 % b = 0

Next tactic:
simp only [mod_def, zero_div, mul_zero, sub_self]
theorem mod_lt (a) {b : Ordinal} (h : b ≠ 0) : a % b < b :=
  (add_lt_add_iff_left (b * (a / b))).1 <| by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h : b ≠ 0
⊢ b * (a / b) + a % b < b * (a / b) + b

Next tactic:
rw [div_add_mod]
theorem mod_lt (a) {b : Ordinal} (h : b ≠ 0) : a % b < b :=
  (add_lt_add_iff_left (b * (a / b))).1 <| by rw [div_add_mod]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
h : b ≠ 0
⊢ a < b * (a / b) + b

Next tactic:
exact lt_mul_div_add a h
@[simp]
theorem mod_self (a : Ordinal) : a % a = 0 :=
  if a0 : a = 0 then by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u_4}
a0 : a = 0
⊢ a % a = 0

Next tactic:
simp only [a0, zero_mod]
@[simp]
theorem mod_self (a : Ordinal) : a % a = 0 :=
  if a0 : a = 0 then by simp only [a0, zero_mod]
  else by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u_4}
a0 : ¬a = 0
⊢ a % a = 0

Next tactic:
simp only [mod_def, div_self a0, mul_one, sub_self]
@[simp]
theorem mod_one (a : Ordinal) : a % 1 = 0 := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u_4}
⊢ a % 1 = 0

Next tactic:
simp only [mod_def, div_one, one_mul, sub_self]
theorem dvd_of_mod_eq_zero {a b : Ordinal} (H : a % b = 0) : b ∣ a :=
  ⟨a / b, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
H : a % b = 0
⊢ a = b * (a / b)

Next tactic:
simpa [H] using (div_add_mod a b).symm
theorem mod_eq_zero_of_dvd {a b : Ordinal} (H : b ∣ a) : a % b = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_4}
H : b ∣ a
⊢ a % b = 0

Next tactic:
rcases H with ⟨c, rfl⟩
theorem mod_eq_zero_of_dvd {a b : Ordinal} (H : b ∣ a) : a % b = 0 := by
  rcases H with ⟨c, rfl⟩
  

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
b c : Ordinal.{u_4}
⊢ b * c % b = 0

Next tactic:
rcases eq_or_ne b 0 with (rfl | hb)
theorem mod_eq_zero_of_dvd {a b : Ordinal} (H : b ∣ a) : a % b = 0 := by
  rcases H with ⟨c, rfl⟩
  rcases eq_or_ne b 0 with (rfl | hb)
  · 

Proof state:
case intro.inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
⊢ 0 * c % 0 = 0

Next tactic:
simp
theorem mod_eq_zero_of_dvd {a b : Ordinal} (H : b ∣ a) : a % b = 0 := by
  rcases H with ⟨c, rfl⟩
  rcases eq_or_ne b 0 with (rfl | hb)
  · simp
  · 

Proof state:
case intro.inr
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
b c : Ordinal.{u_4}
hb : b ≠ 0
⊢ b * c % b = 0

Next tactic:
simp [mod_def, hb]
@[simp]
theorem mul_add_mod_self (x y z : Ordinal) : (x * y + z) % x = z % x := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
x y z : Ordinal.{u_4}
⊢ (x * y + z) % x = z % x

Next tactic:
rcases eq_or_ne x 0 with rfl | hx
@[simp]
theorem mul_add_mod_self (x y z : Ordinal) : (x * y + z) % x = z % x := by
  rcases eq_or_ne x 0 with rfl | hx
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
y z : Ordinal.{u_4}
⊢ (0 * y + z) % 0 = z % 0

Next tactic:
simp
@[simp]
theorem mul_add_mod_self (x y z : Ordinal) : (x * y + z) % x = z % x := by
  rcases eq_or_ne x 0 with rfl | hx
  · simp
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
x y z : Ordinal.{u_4}
hx : x ≠ 0
⊢ (x * y + z) % x = z % x

Next tactic:
rwa [mod_def, mul_add_div, mul_add, ← sub_sub, add_sub_cancel, mod_def]
@[simp]
theorem mul_mod (x y : Ordinal) : x * y % x = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
x y : Ordinal.{u_4}
⊢ x * y % x = 0

Next tactic:
simpa using mul_add_mod_self x y 0
theorem mod_mod_of_dvd (a : Ordinal) {b c : Ordinal} (h : c ∣ b) : a % b % c = a % c := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b c : Ordinal.{u_4}
h : c ∣ b
⊢ a % b % c = a % c

Next tactic:
nth_rw 2 [← div_add_mod a b]
theorem mod_mod_of_dvd (a : Ordinal) {b c : Ordinal} (h : c ∣ b) : a % b % c = a % c := by
  nth_rw 2 [← div_add_mod a b]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b c : Ordinal.{u_4}
h : c ∣ b
⊢ a % b % c = (b * (a / b) + a % b) % c

Next tactic:
rcases h with ⟨d, rfl⟩
theorem mod_mod_of_dvd (a : Ordinal) {b c : Ordinal} (h : c ∣ b) : a % b % c = a % c := by
  nth_rw 2 [← div_add_mod a b]
  rcases h with ⟨d, rfl⟩
  

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a c d : Ordinal.{u_4}
⊢ a % (c * d) % c = (c * d * (a / (c * d)) + a % (c * d)) % c

Next tactic:
rw [mul_assoc, mul_add_mod_self]
/-- Converts a family indexed by an `Ordinal.{u}` to one indexed by a `Type u` using a specified
well-ordering. -/
def familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o} (ho : type r = o)
    (f : ∀ a < o, α) : ι → α := fun i =>
  f (typein r i)
    (by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
i : ι
⊢ typein r i < o

Next tactic:
rw [← ho]
/-- Converts a family indexed by an `Ordinal.{u}` to one indexed by a `Type u` using a specified
well-ordering. -/
def familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o} (ho : type r = o)
    (f : ∀ a < o, α) : ι → α := fun i =>
  f (typein r i)
    (by
      rw [← ho]
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
i : ι
⊢ typein r i < type r

Next tactic:
exact typein_lt_type r i
@[simp]
theorem bfamilyOfFamily'_typein {ι} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) (i) :
    bfamilyOfFamily' r f (typein r i) (typein_lt_type r i) = f i := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u_4
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
f : ι → α
i : ι
⊢ bfamilyOfFamily' r f (typein r i) (_ : typein r i < type r) = f i

Next tactic:
simp only [bfamilyOfFamily', enum_typein]
@[simp, nolint simpNF] -- Porting note: simp cannot prove this
theorem familyOfBFamily'_enum {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) (i hi) :
    familyOfBFamily' r ho f (enum r i (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
i : Ordinal.{u}
hi : i < o
⊢ i < type r

Next tactic:
rwa [ho]
@[simp, nolint simpNF] -- Porting note: simp cannot prove this
theorem familyOfBFamily'_enum {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) (i hi) :
    familyOfBFamily' r ho f (enum r i (by rwa [ho])) = f i hi := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
i : Ordinal.{u}
hi : i < o
⊢ familyOfBFamily' r ho f (enum r i (_ : i < type r)) = f i hi

Next tactic:
simp only [familyOfBFamily', typein_enum]
@[simp, nolint simpNF] -- Porting note: simp cannot prove this
theorem familyOfBFamily_enum (o : Ordinal) (f : ∀ a < o, α) (i hi) :
    familyOfBFamily o f
        (enum (· < ·) i
          (by
            

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{?u.274749}
f : (a : Ordinal.{?u.274749}) → a < o → α
i : Ordinal.{?u.274749}
hi : i < o
⊢ i < type fun x x_1 => x < x_1

Next tactic:
convert hi
@[simp, nolint simpNF] -- Porting note: simp cannot prove this
theorem familyOfBFamily_enum (o : Ordinal) (f : ∀ a < o, α) (i hi) :
    familyOfBFamily o f
        (enum (· < ·) i
          (by
            convert hi
            

Proof state:
case h.e'_4
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{?u.274749}
f : (a : Ordinal.{?u.274749}) → a < o → α
i : Ordinal.{?u.274749}
hi : i < o
⊢ (type fun x x_1 => x < x_1) = o

Next tactic:
exact type_lt _
@[simp]
theorem range_familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) : range (familyOfBFamily' r ho f) = brange o f := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
⊢ range (familyOfBFamily' r ho f) = brange o f

Next tactic:
refine' Set.ext fun a => ⟨_, _⟩
@[simp]
theorem range_familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) : range (familyOfBFamily' r ho f) = brange o f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
a : α
⊢ a ∈ range (familyOfBFamily' r ho f) → a ∈ brange o f

Next tactic:
rintro ⟨b, rfl⟩
@[simp]
theorem range_familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) : range (familyOfBFamily' r ho f) = brange o f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · rintro ⟨b, rfl⟩
    

Proof state:
case refine'_1.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
b : ι
⊢ familyOfBFamily' r ho f b ∈ brange o f

Next tactic:
apply mem_brange_self
@[simp]
theorem range_familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) : range (familyOfBFamily' r ho f) = brange o f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · rintro ⟨b, rfl⟩
    apply mem_brange_self
  · 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
a : α
⊢ a ∈ brange o f → a ∈ range (familyOfBFamily' r ho f)

Next tactic:
rintro ⟨i, hi, rfl⟩
@[simp]
theorem range_familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) : range (familyOfBFamily' r ho f) = brange o f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · rintro ⟨b, rfl⟩
    apply mem_brange_self
  · rintro ⟨i, hi, rfl⟩
    

Proof state:
case refine'_2.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
o : Ordinal.{u}
ho : type r = o
f : (a : Ordinal.{u}) → a < o → α
i : Ordinal.{u}
hi : i < o
⊢ f i hi ∈ range (familyOfBFamily' r ho f)

Next tactic:
exact ⟨_, familyOfBFamily'_enum _ _ _ _ _⟩
@[simp]
theorem brange_bfamilyOfFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) :
    brange _ (bfamilyOfFamily' r f) = range f := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
f : ι → α
⊢ brange (type r) (bfamilyOfFamily' r f) = range f

Next tactic:
refine' Set.ext fun a => ⟨_, _⟩
@[simp]
theorem brange_bfamilyOfFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) :
    brange _ (bfamilyOfFamily' r f) = range f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
f : ι → α
a : α
⊢ a ∈ brange (type r) (bfamilyOfFamily' r f) → a ∈ range f

Next tactic:
rintro ⟨i, hi, rfl⟩
@[simp]
theorem brange_bfamilyOfFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) :
    brange _ (bfamilyOfFamily' r f) = range f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · rintro ⟨i, hi, rfl⟩
    

Proof state:
case refine'_1.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
f : ι → α
i : Ordinal.{u}
hi : i < type r
⊢ bfamilyOfFamily' r f i hi ∈ range f

Next tactic:
apply mem_range_self
@[simp]
theorem brange_bfamilyOfFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) :
    brange _ (bfamilyOfFamily' r f) = range f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · rintro ⟨i, hi, rfl⟩
    apply mem_range_self
  · 

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
f : ι → α
a : α
⊢ a ∈ range f → a ∈ brange (type r) (bfamilyOfFamily' r f)

Next tactic:
rintro ⟨b, rfl⟩
@[simp]
theorem brange_bfamilyOfFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) :
    brange _ (bfamilyOfFamily' r f) = range f := by
  refine' Set.ext fun a => ⟨_, _⟩
  · rintro ⟨i, hi, rfl⟩
    apply mem_range_self
  · rintro ⟨b, rfl⟩
    

Proof state:
case refine'_2.intro
α : Type u_1
β : Type u_2
γ : Type u_3
r✝ : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
r : ι → ι → Prop
inst✝ : IsWellOrder ι r
f : ι → α
b : ι
⊢ f b ∈ brange (type r) (bfamilyOfFamily' r f)

Next tactic:
exact ⟨_, _, bfamilyOfFamily'_typein _ _ _⟩
@[simp]
theorem brange_const {o : Ordinal} (ho : o ≠ 0) {c : α} : (brange o fun _ _ => c) = {c} := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
ho : o ≠ 0
c : α
⊢ (brange o fun x x => c) = {c}

Next tactic:
rw [← range_familyOfBFamily]
@[simp]
theorem brange_const {o : Ordinal} (ho : o ≠ 0) {c : α} : (brange o fun _ _ => c) = {c} := by
  rw [← range_familyOfBFamily]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
o : Ordinal.{u_4}
ho : o ≠ 0
c : α
⊢ range (familyOfBFamily o fun x x => c) = {c}

Next tactic:
exact @Set.range_const _ o.out.α (out_nonempty_iff_ne_zero.2 ho) c
/-- The range of an indexed ordinal function, whose outputs live in a higher universe than the
    inputs, is always bounded above. See `Ordinal.lsub` for an explicit bound. -/
theorem bddAbove_range {ι : Type u} (f : ι → Ordinal.{max u v}) : BddAbove (Set.range f) :=
  ⟨(iSup (succ ∘ card ∘ f)).ord, by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
⊢ ord (iSup (succ ∘ card ∘ f)) ∈ upperBounds (range f)

Next tactic:
rintro a ⟨i, rfl⟩
/-- The range of an indexed ordinal function, whose outputs live in a higher universe than the
    inputs, is always bounded above. See `Ordinal.lsub` for an explicit bound. -/
theorem bddAbove_range {ι : Type u} (f : ι → Ordinal.{max u v}) : BddAbove (Set.range f) :=
  ⟨(iSup (succ ∘ card ∘ f)).ord, by
    rintro a ⟨i, rfl⟩
    

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
i : ι
⊢ f i ≤ ord (iSup (succ ∘ card ∘ f))

Next tactic:
exact le_of_lt (Cardinal.lt_ord.2 ((lt_succ _).trans_le
      (le_ciSup (Cardinal.bddAbove_range.{_, v} _) _)))
theorem sup_le_iff {ι : Type u} {f : ι → Ordinal.{max u v}} {a} : sup.{_, v} f ≤ a ↔ ∀ i, f i ≤ a :=
  (csSup_le_iff' (bddAbove_range.{_, v} f)).trans (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
a : Ordinal.{max u v}
⊢ (∀ x ∈ range f, x ≤ a) ↔ ∀ (i : ι), f i ≤ a

Next tactic:
simp
theorem lt_sup {ι : Type u} {f : ι → Ordinal.{max u v}} {a} : a < sup.{_, v} f ↔ ∃ i, a < f i := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
a : Ordinal.{max u v}
⊢ a < sup f ↔ ∃ i, a < f i

Next tactic:
simpa only [not_forall, not_le] using not_congr (@sup_le_iff.{_, v} _ f a)
theorem sup_not_succ_of_ne_sup {ι : Type u} {f : ι → Ordinal.{max u v}}
    (hf : ∀ i, f i ≠ sup.{_, v} f) {a} (hao : a < sup.{_, v} f) : succ a < sup.{_, v} f := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
hf : ∀ (i : ι), f i ≠ sup f
a : Ordinal.{max u v}
hao : a < sup f
⊢ succ a < sup f

Next tactic:
by_contra! hoa
theorem sup_not_succ_of_ne_sup {ι : Type u} {f : ι → Ordinal.{max u v}}
    (hf : ∀ i, f i ≠ sup.{_, v} f) {a} (hao : a < sup.{_, v} f) : succ a < sup.{_, v} f := by
  by_contra! hoa
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
hf : ∀ (i : ι), f i ≠ sup f
a : Ordinal.{max u v}
hao : a < sup f
hoa : sup f ≤ succ a
⊢ False

Next tactic:
exact
    hao.not_le (sup_le fun i => le_of_lt_succ <| (lt_of_le_of_ne (le_sup _ _) (hf i)).trans_le hoa)
@[simp]
theorem sup_eq_zero_iff {ι : Type u} {f : ι → Ordinal.{max u v}} :
    sup.{_, v} f = 0 ↔ ∀ i, f i = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
⊢ sup f = 0 ↔ ∀ (i : ι), f i = 0

Next tactic:
refine'
    ⟨fun h i => _, fun h =>
      le_antisymm (sup_le fun i => Ordinal.le_zero.2 (h i)) (Ordinal.zero_le _)⟩
@[simp]
theorem sup_eq_zero_iff {ι : Type u} {f : ι → Ordinal.{max u v}} :
    sup.{_, v} f = 0 ↔ ∀ i, f i = 0 := by
  refine'
    ⟨fun h i => _, fun h =>
      le_antisymm (sup_le fun i => Ordinal.le_zero.2 (h i)) (Ordinal.zero_le _)⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
h : sup f = 0
i : ι
⊢ f i = 0

Next tactic:
rw [← Ordinal.le_zero, ← h]
@[simp]
theorem sup_eq_zero_iff {ι : Type u} {f : ι → Ordinal.{max u v}} :
    sup.{_, v} f = 0 ↔ ∀ i, f i = 0 := by
  refine'
    ⟨fun h i => _, fun h =>
      le_antisymm (sup_le fun i => Ordinal.le_zero.2 (h i)) (Ordinal.zero_le _)⟩
  rw [← Ordinal.le_zero, ← h]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
ι : Type u
f : ι → Ordinal.{max u v}
h : sup f = 0
i : ι
⊢ f i ≤ sup f

Next tactic:
exact le_sup f i
theorem IsNormal.sup {f : Ordinal.{max u v} → Ordinal.{max u w}} (H : IsNormal f) {ι : Type u}
    (g : ι → Ordinal.{max u v}) [Nonempty ι] : f (sup.{_, v} g) = sup.{_, w} (f ∘ g) :=
  eq_of_forall_ge_iff fun a => by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{max u v} → Ordinal.{max u w}
H : IsNormal f
ι : Type u
g : ι → Ordinal.{max u v}
inst✝ : Nonempty ι
a : Ordinal.{max u w}
⊢ f (Ordinal.sup g) ≤ a ↔ Ordinal.sup (f ∘ g) ≤ a

Next tactic:
rw [sup_le_iff]
theorem IsNormal.sup {f : Ordinal.{max u v} → Ordinal.{max u w}} (H : IsNormal f) {ι : Type u}
    (g : ι → Ordinal.{max u v}) [Nonempty ι] : f (sup.{_, v} g) = sup.{_, w} (f ∘ g) :=
  eq_of_forall_ge_iff fun a => by
    rw [sup_le_iff]; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
f : Ordinal.{max u v} → Ordinal.{max u w}
H : IsNormal f
ι : Type u
g : ι → Ordinal.{max u v}
inst✝ : Nonempty ι
a : Ordinal.{max u w}
⊢ f (Ordinal.sup g) ≤ a ↔ ∀ (i : ι), (f ∘ g) i ≤ a

Next tactic:
simp only [comp]