l3lab/ntp-mathlib huggingface dataset:
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        

Proof state:
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ 1 + (e - 1) = e

Next tactic:
refine' repr_inj.1 _
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        

Proof state:
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ repr (1 + (e - 1)) = repr e

Next tactic:
simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
        

Proof state:
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ 1 + (repr e - 1) = repr e

Next tactic:
have := mt repr_inj.1 e0
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
        have := mt repr_inj.1 e0
        

Proof state:
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : ¬repr e = repr 0
⊢ 1 + (repr e - 1) = repr e

Next tactic:
refine' Ordinal.add_sub_cancel_of_le _
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
        have := mt repr_inj.1 e0
        refine' Ordinal.add_sub_cancel_of_le _
        

Proof state:
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : ¬repr e = repr 0
⊢ 1 ≤ repr e

Next tactic:
have := (one_le_iff_ne_zero.2 this)
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
        have := mt repr_inj.1 e0
        refine' Ordinal.add_sub_cancel_of_le _
        have := (one_le_iff_ne_zero.2 this)
        

Proof state:
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝² : NF e
this✝¹ : NF a
this✝ : ¬repr e = repr 0
this : 1 ≤ repr e
⊢ 1 ≤ repr e

Next tactic:
exact this
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
        have := mt repr_inj.1 e0
        refine' Ordinal.add_sub_cancel_of_le _
        have := (one_le_iff_ne_zero.2 this)
        exact this
      

Proof state:
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : 1 + (e - 1) = e
⊢ oadd (e - 1) n a' = o' → m' = m → oadd e n (scale 1 a') = scale 1 o' ∧ m' = m

Next tactic:
intros
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
        have := mt repr_inj.1 e0
        refine' Ordinal.add_sub_cancel_of_le _
        have := (one_le_iff_ne_zero.2 this)
        exact this
      intros
      

Proof state:
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : 1 + (e - 1) = e
a✝¹ : oadd (e - 1) n a' = o'
a✝ : m' = m
⊢ oadd e n (scale 1 a') = scale 1 o' ∧ m' = m

Next tactic:
substs o' m
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      exact ⟨rfl, rfl⟩
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      simp only [split_eq_scale_split' h', and_imp]
      have : 1 + (e - 1) = e := by
        refine' repr_inj.1 _
        simp only [repr_add, repr, opow_zero, Nat.succPNat_coe, Nat.cast_one, mul_one, add_zero,
          repr_sub]
        have := mt repr_inj.1 e0
        refine' Ordinal.add_sub_cancel_of_le _
        have := (one_le_iff_ne_zero.2 this)
        exact this
      intros
      substs o' m
      

Proof state:
case neg.mk
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
this : 1 + (e - 1) = e
⊢ oadd e n (scale 1 a') = scale 1 (oadd (e - 1) n a') ∧ m' = m'

Next tactic:
simp [scale, this]
theorem nf_repr_split' : ∀ {o o' m} [NF o], split' o = (o', m) → NF o' ∧ repr o = ω * repr o' + m
  | 0, o', m, _, p => by 

Proof state:
o' : ONote
m : ℕ
x✝ : NF 0
p : split' 0 = (o', m)
⊢ NF o' ∧ repr 0 = ω * repr o' + ↑m

Next tactic:
injection p
theorem 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; 

Proof state:
o' : ONote
m : ℕ
x✝ : NF 0
fst_eq✝ : 0 = o'
snd_eq✝ : 0 = m
⊢ NF o' ∧ repr 0 = ω * repr o' + ↑m

Next tactic:
substs o' m
theorem 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; 

Proof state:
x✝ : NF 0
⊢ NF 0 ∧ repr 0 = ω * repr 0 + ↑0

Next tactic:
simp [NF.zero]
theorem 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
    

Proof state:
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
⊢ NF o' ∧ repr (oadd e n a) = ω * repr o' + ↑m

Next tactic:
by_cases e0 : e = 0
theorem 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 <;> 

Proof state:
case pos
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
e0 : e = 0
⊢ NF o' ∧ repr (oadd e n a) = ω * repr o' + ↑m

Next tactic:
simp [e0, split, split'] at p ⊢
theorem 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 <;> 

Proof state:
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
p : split' (oadd e n a) = (o', m)
e0 : ¬e = 0
⊢ NF o' ∧ repr (oadd e n a) = ω * repr o' + ↑m

Next tactic:
simp [e0, split, split'] at p ⊢
theorem 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 [e0, split, split'] at p ⊢
    · 

Proof state:
case pos
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : e = 0
p : 0 = o' ∧ ↑n = m
⊢ NF o' ∧ ↑↑n + repr a = ω * repr o' + ↑m

Next tactic:
rcases p with ⟨rfl, rfl⟩
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      

Proof state:
case pos.intro
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : e = 0
⊢ NF 0 ∧ ↑↑n + repr a = ω * repr 0 + ↑↑n

Next tactic:
simp [h.zero_of_zero e0, NF.zero]
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · 

Proof state:
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
p : oadd (e - 1) n (split' a).1 = o' ∧ (split' a).2 = m
⊢ NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m

Next tactic:
revert p
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      

Proof state:
case neg
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
⊢ oadd (e - 1) n (split' a).1 = o' ∧ (split' a).2 = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m

Next tactic:
cases' h' : split' a with a' m'
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      

Proof state:
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
⊢ oadd (e - 1) n (a', m').1 = o' ∧ (a', m').2 = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m

Next tactic:
haveI := h.fst
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      

Proof state:
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this : NF e
⊢ oadd (e - 1) n (a', m').1 = o' ∧ (a', m').2 = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m

Next tactic:
haveI := h.snd
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      

Proof state:
case neg.mk
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
⊢ oadd (e - 1) n (a', m').1 = o' ∧ (a', m').2 = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m

Next tactic:
cases' nf_repr_split' h' with IH₁ IH₂
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      

Proof state:
case neg.mk.intro
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ oadd (e - 1) n (a', m').1 = o' ∧ (a', m').2 = m → NF o' ∧ ω ^ repr e * ↑↑n + repr a = ω * repr o' + ↑m

Next tactic:
simp only [IH₂, and_imp]
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      

Proof state:
case neg.mk.intro
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ oadd (e - 1) n a' = o' → m' = m → NF o' ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr o' + ↑m

Next tactic:
intros
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      intros
      

Proof state:
case neg.mk.intro
e : ONote
n : ℕ+
a o' : ONote
m : ℕ
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
a✝¹ : oadd (e - 1) n a' = o'
a✝ : m' = m
⊢ NF o' ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr o' + ↑m

Next tactic:
substs o' m
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      intros
      substs o' m
      

Proof state:
case neg.mk.intro
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ NF (oadd (e - 1) n a') ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr (oadd (e - 1) n a') + ↑m'

Next tactic:
have : (ω : Ordinal.{0}) ^ repr e = ω ^ (1 : Ordinal.{0}) * ω ^ (repr e - 1) := by
        have := mt repr_inj.1 e0
        rw [← opow_add, Ordinal.add_sub_cancel_of_le (one_le_iff_ne_zero.2 this)]
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      intros
      substs o' m
      have : (ω : Ordinal.{0}) ^ repr e = ω ^ (1 : Ordinal.{0}) * ω ^ (repr e - 1) := by
        

Proof state:
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝ : NF e
this : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
⊢ ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)

Next tactic:
have := mt repr_inj.1 e0
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      intros
      substs o' m
      have : (ω : Ordinal.{0}) ^ repr e = ω ^ (1 : Ordinal.{0}) * ω ^ (repr e - 1) := by
        have := mt repr_inj.1 e0
        

Proof state:
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ¬repr e = repr 0
⊢ ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)

Next tactic:
rw [← opow_add, Ordinal.add_sub_cancel_of_le (one_le_iff_ne_zero.2 this)]
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      intros
      substs o' m
      have : (ω : Ordinal.{0}) ^ repr e = ω ^ (1 : Ordinal.{0}) * ω ^ (repr e - 1) := by
        have := mt repr_inj.1 e0
        rw [← opow_add, Ordinal.add_sub_cancel_of_le (one_le_iff_ne_zero.2 this)]
      

Proof state:
case neg.mk.intro
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ NF (oadd (e - 1) n a') ∧ ω ^ repr e * ↑↑n + (ω * repr a' + ↑m') = ω * repr (oadd (e - 1) n a') + ↑m'

Next tactic:
refine' ⟨NF.oadd (by infer_instance) _ _, _⟩
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      intros
      substs o' m
      have : (ω : Ordinal.{0}) ^ repr e = ω ^ (1 : Ordinal.{0}) * ω ^ (repr e - 1) := by
        have := mt repr_inj.1 e0
        rw [← opow_add, Ordinal.add_sub_cancel_of_le (one_le_iff_ne_zero.2 this)]
      refine' ⟨NF.oadd (by 

Proof state:
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ NF (e - 1)

Next tactic:
infer_instance
theorem 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 [e0, split, split'] at p ⊢
    · rcases p with ⟨rfl, rfl⟩
      simp [h.zero_of_zero e0, NF.zero]
    · revert p
      cases' h' : split' a with a' m'
      haveI := h.fst
      haveI := h.snd
      cases' nf_repr_split' h' with IH₁ IH₂
      simp only [IH₂, and_imp]
      intros
      substs o' m
      have : (ω : Ordinal.{0}) ^ repr e = ω ^ (1 : Ordinal.{0}) * ω ^ (repr e - 1) := by
        have := mt repr_inj.1 e0
        rw [← opow_add, Ordinal.add_sub_cancel_of_le (one_le_iff_ne_zero.2 this)]
      refine' ⟨NF.oadd (by infer_instance) _ _, _⟩
      · 

Proof state:
case neg.mk.intro.refine'_1
e : ONote
n : ℕ+
a : ONote
h : NF (oadd e n a)
e0 : ¬e = 0
a' : ONote
m' : ℕ
h' : split' a = (a', m')
this✝¹ : NF e
this✝ : NF a
IH₁ : NF a'
IH₂ : repr a = ω * repr a' + ↑m'
this : ω ^ repr e = ω ^ 1 * ω ^ (repr e - 1)
⊢ NFBelow a' (repr (e - 1))

Next tactic:
simp at this ⊢