l3lab/ntp-mathlib huggingface dataset:
instance 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 m m
  · cases k <;> exact NF.zero
  cases' k with k k
  · exact NF.oadd_zero _ _
  · haveI := nf_opowAux e a0 a k
    simp only [Nat.succ_ne_zero m]; 

Proof state:
case succ.succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
m k : ℕ
this : ∀ (m : ℕ), NF (opowAux e a0 a k m)
⊢ NF (scale (e + mulNat a0 k) a + opowAux e a0 a k (Nat.succ m))

Next tactic:
infer_instance
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  

Proof state:
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
⊢ NF (o₁ ^ o₂)

Next tactic:
cases' e₁ : split o₁ with a m
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  

Proof state:
case mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
⊢ NF (o₁ ^ o₂)

Next tactic:
have na := (nf_repr_split e₁).1
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  

Proof state:
case mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
na : NF a
⊢ NF (o₁ ^ o₂)

Next tactic:
cases' e₂ : split' o₂ with b' k
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  

Proof state:
case mk.mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
na : NF a
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
⊢ NF (o₁ ^ o₂)

Next tactic:
haveI := (nf_repr_split' e₂).1
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  

Proof state:
case mk.mk
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
a : ONote
m : ℕ
e₁ : split o₁ = (a, m)
na : NF a
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
⊢ NF (o₁ ^ o₂)

Next tactic:
cases' a with a0 n a'
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · 

Proof state:
case mk.mk.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
e₁ : split o₁ = (zero, m)
na : NF zero
⊢ NF (o₁ ^ o₂)

Next tactic:
cases' m with m
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · 

Proof state:
case mk.mk.zero.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
⊢ NF (o₁ ^ o₂)

Next tactic:
by_cases o₂ = 0
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> 

Proof state:
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
h✝ : o₂ = 0
⊢ NF (o₁ ^ o₂)

Next tactic:
simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *]
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> 

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
h✝ : ¬o₂ = 0
⊢ NF (o₁ ^ o₂)

Next tactic:
simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *]
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> 

Proof state:
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
h✝ : o₂ = 0
⊢ NF (if True then 1 else 0)

Next tactic:
decide
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> 

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
e₁ : split o₁ = (zero, Nat.zero)
h✝ : ¬o₂ = 0
⊢ NF (if False then 1 else 0)

Next tactic:
decide
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · 

Proof state:
case mk.mk.zero.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
⊢ NF (o₁ ^ o₂)

Next tactic:
by_cases m = 0
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · 

Proof state:
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
h✝ : m = 0
⊢ NF (o₁ ^ o₂)

Next tactic:
simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        

Proof state:
case pos
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
h✝ : m = 0
⊢ NF 1

Next tactic:
decide
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · 

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
h✝ : ¬m = 0
⊢ NF (o₁ ^ o₂)

Next tactic:
simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        

Proof state:
case neg
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
na : NF zero
m : ℕ
e₁ : split o₁ = (zero, Nat.succ m)
h✝ : ¬m = 0
⊢ NF (oadd b' (Monoid.npow k (Nat.succPNat m)) 0)

Next tactic:
infer_instance
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · 

Proof state:
case mk.mk.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
⊢ NF (o₁ ^ o₂)

Next tactic:
simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    

Proof state:
case mk.mk.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
⊢ NF
    (match (scale 1 b', k) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)

Next tactic:
have := na.fst
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    

Proof state:
case mk.mk.oadd
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
k : ℕ
e₂ : split' o₂ = (b', k)
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
⊢ NF
    (match (scale 1 b', k) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)

Next tactic:
cases' k with k
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> 

Proof state:
case mk.mk.oadd.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.zero)
⊢ NF
    (match (scale 1 b', Nat.zero) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)

Next tactic:
simp
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> 

Proof state:
case mk.mk.oadd.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
⊢ NF
    (match (scale 1 b', Nat.succ k) with
    | (b, 0) => oadd (a0 * b) 1 0
    | (b, Nat.succ k) => scale (a0 * b + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * b) a0 (oadd a0 n a' * ↑m) k m)

Next tactic:
simp
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · 

Proof state:
case mk.mk.oadd.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.zero)
⊢ NF (oadd (a0 * scale 1 b') 1 0)

Next tactic:
infer_instance
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · infer_instance
    · 

Proof state:
case mk.mk.oadd.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
k : ℕ
e₂ : split' o₂ = (b', Nat.succ k)
⊢ NF (scale (a0 * scale 1 b' + a0 * ↑k) (oadd a0 n a') + opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) k m)

Next tactic:
cases k
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · infer_instance
    · cases k <;> 

Proof state:
case mk.mk.oadd.succ.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.succ Nat.zero)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑Nat.zero) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) Nat.zero m)

Next tactic:
cases m
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · infer_instance
    · cases k <;> 

Proof state:
case mk.mk.oadd.succ.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
m : ℕ
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
e₁ : split o₁ = (oadd a0 n a', m)
na : NF (oadd a0 n a')
this : NF a0
n✝ : ℕ
e₂ : split' o₂ = (b', Nat.succ (Nat.succ n✝))
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑(Nat.succ n✝)) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑m) (Nat.succ n✝) m)

Next tactic:
cases m
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · infer_instance
    · cases k <;> cases m <;> 

Proof state:
case mk.mk.oadd.succ.zero.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.succ Nat.zero)
e₁ : split o₁ = (oadd a0 n a', Nat.zero)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑Nat.zero) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑Nat.zero) Nat.zero Nat.zero)

Next tactic:
infer_instance
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · infer_instance
    · cases k <;> cases m <;> 

Proof state:
case mk.mk.oadd.succ.zero.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
e₂ : split' o₂ = (b', Nat.succ Nat.zero)
n✝ : ℕ
e₁ : split o₁ = (oadd a0 n a', Nat.succ n✝)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑Nat.zero) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑(Nat.succ n✝)) Nat.zero (Nat.succ n✝))

Next tactic:
infer_instance
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · infer_instance
    · cases k <;> cases m <;> 

Proof state:
case mk.mk.oadd.succ.succ.zero
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
n✝ : ℕ
e₂ : split' o₂ = (b', Nat.succ (Nat.succ n✝))
e₁ : split o₁ = (oadd a0 n a', Nat.zero)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑(Nat.succ n✝)) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑Nat.zero) (Nat.succ n✝) Nat.zero)

Next tactic:
infer_instance
instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by
  cases' e₁ : split o₁ with a m
  have na := (nf_repr_split e₁).1
  cases' e₂ : split' o₂ with b' k
  haveI := (nf_repr_split' e₂).1
  cases' a with a0 n a'
  · cases' m with m
    · by_cases o₂ = 0 <;> simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *] <;> decide
    · by_cases m = 0
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, *, zero_def]
        decide
      · simp only [(· ^ ·), Pow.pow, pow, opow, opowAux2, mulNat_eq_mul, ofNat, *]
        infer_instance
  · simp [(· ^ ·),Pow.pow,pow, opow, opowAux2, e₁, e₂, split_eq_scale_split' e₂]
    have := na.fst
    cases' k with k <;> simp
    · infer_instance
    · cases k <;> cases m <;> 

Proof state:
case mk.mk.oadd.succ.succ.succ
o₁ o₂ : ONote
inst✝¹ : NF o₁
inst✝ : NF o₂
b' : ONote
this✝ : NF b'
a0 : ONote
n : ℕ+
a' : ONote
na : NF (oadd a0 n a')
this : NF a0
n✝¹ : ℕ
e₂ : split' o₂ = (b', Nat.succ (Nat.succ n✝¹))
n✝ : ℕ
e₁ : split o₁ = (oadd a0 n a', Nat.succ n✝)
⊢ NF
    (scale (a0 * scale 1 b' + a0 * ↑(Nat.succ n✝¹)) (oadd a0 n a') +
      opowAux (a0 * scale 1 b') a0 (oadd a0 n a' * ↑(Nat.succ n✝)) (Nat.succ n✝¹) (Nat.succ n✝))

Next tactic:
infer_instance
theorem 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 

Proof state:
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
m : ℕ
⊢ repr (opowAux e a0 a 0 m) = ω ^ repr e * repr (opowAux 0 a0 a 0 m)

Next tactic:
cases m
theorem 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 <;> 

Proof state:
case zero
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
⊢ repr (opowAux e a0 a 0 Nat.zero) = ω ^ repr e * repr (opowAux 0 a0 a 0 Nat.zero)

Next tactic:
simp [opowAux]
theorem 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 <;> 

Proof state:
case succ
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
n✝ : ℕ
⊢ repr (opowAux e a0 a 0 (Nat.succ n✝)) = ω ^ repr e * repr (opowAux 0 a0 a 0 (Nat.succ n✝))

Next tactic:
simp [opowAux]
theorem 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
    

Proof state:
e a0 a : ONote
inst✝² : NF e
inst✝¹ : NF a0
inst✝ : NF a
k m : ℕ
⊢ repr (opowAux e a0 a (k + 1) m) = ω ^ repr e * repr (opowAux 0 a0 a (k + 1) m)

Next tactic:
by_cases h : m = 0