Skip to content

Commit

Permalink
And more
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Dec 13, 2023
1 parent ce43ce7 commit cc5d761
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Mathlib/Computability/Ackermann.lean
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def ack : ℕ → ℕ → ℕ
| 0, n => n + 1
| m + 1, 0 => ack m 1
| m + 1, n + 1 => ack m (ack (m + 1) n)
termination_by ack m n => (m, n)
termination_by m n => (m, n)
#align ack ack

@[simp]
Expand Down Expand Up @@ -142,7 +142,7 @@ theorem ack_strictMono_right : ∀ m, StrictMono (ack m)
rw [ack_succ_succ, ack_succ_succ]
apply ack_strictMono_right _ (ack_strictMono_right _ _)
rwa [add_lt_add_iff_right] at h
termination_by ack_strictMono_right m x y h => (m, x)
termination_by m x y h => (m, x)
#align ack_strict_mono_right ack_strictMono_right

theorem ack_mono_right (m : ℕ) : Monotone (ack m) :=
Expand Down Expand Up @@ -183,7 +183,7 @@ theorem add_lt_ack : ∀ m n, m + n < ack m n
ack_mono_right m <| le_of_eq_of_le (by rw [succ_eq_add_one]; ring_nf)
<| succ_le_of_lt <| add_lt_ack (m + 1) n
_ = ack (m + 1) (n + 1) := (ack_succ_succ m n).symm
termination_by add_lt_ack m n => (m, n)
termination_by m n => (m, n)
#align add_lt_ack add_lt_ack

theorem add_add_one_le_ack (m n : ℕ) : m + n + 1 ≤ ack m n :=
Expand Down Expand Up @@ -213,7 +213,7 @@ private theorem ack_strict_mono_left' : ∀ {m₁ m₂} (n), m₁ < m₂ → ack
exact
(ack_strict_mono_left' _ <| (add_lt_add_iff_right 1).1 h).trans
(ack_strictMono_right _ <| ack_strict_mono_left' n h)
termination_by ack_strict_mono_left' x y => (x, y)
termination_by x y => (x, y)

theorem ack_strictMono_left (n : ℕ) : StrictMono fun m => ack m n := fun _m₁ _m₂ =>
ack_strict_mono_left' n
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Computability/PartrecCode.lean
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@ def evaln : ℕ → Code → ℕ → Option ℕ
pure m
else
evaln k (rfind' cf) (Nat.pair a (m + 1))
termination_by evaln k c => (k, c)
decreasing_by { decreasing_with simp (config := { arith := true }) [Zero.zero]; done }
termination_by k c => (k, c)
decreasing_by all_goals { decreasing_with simp (config := { arith := true }) [Zero.zero]; done }
#align nat.partrec.code.evaln Nat.Partrec.Code.evaln

theorem evaln_bound : ∀ {k c n x}, x ∈ evaln k c n → n < k
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/ByteArray.lean
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def String.toAsciiByteArray (s : String) : ByteArray :=
Nat.sub_lt_sub_left (Nat.lt_of_not_le <| mt decide_eq_true h)
(Nat.lt_add_of_pos_right (String.csize_pos _))
loop (s.next p) (out.push c.toUInt8)
termination_by => utf8ByteSize s - p.byteIdx
loop 0 ByteArray.empty
termination_by => utf8ByteSize s - p.byteIdx

/-- Convert a byte slice into a string. This does not handle non-ASCII characters correctly:
every byte will become a unicode character with codepoint < 256. -/
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Fintype/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ noncomputable def seqOfForallFinsetExistsAux {α : Type*} [DecidableEq α] (P :
(h
(Finset.image (fun i : Fin n => seqOfForallFinsetExistsAux P r h i)
(Finset.univ : Finset (Fin n))))
decreasing_by exact i.2
decreasing_by all_goals exact i.2
#align seq_of_forall_finset_exists_aux seqOfForallFinsetExistsAux

/-- Induction principle to build a sequence, by adding one point at a time satisfying a given
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Sym/Card.lean
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ theorem card_sym_fin_eq_multichoose : ∀ n k : ℕ, card (Sym (Fin n) k) = mult
refine Fintype.card_congr (Equiv.symm ?_)
apply (Sym.e1.symm.sumCongr Sym.e2.symm).trans
apply Equiv.sumCompl
termination_by card_sym_fin_eq_multichoose n k => n + k
termination_by n k => n + k
#align sym.card_sym_fin_eq_multichoose Sym.card_sym_fin_eq_multichoose

/-- For any fintype `α` of cardinality `n`, `card (Sym α k) = multichoose (card α) k`. -/
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/SetTheory/Game/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def mulCommRelabelling (x y : PGame.{u}) : x * y ≡r y * x :=
(mulCommRelabelling _ _).addCongr (mulCommRelabelling _ _)).subCongr
(mulCommRelabelling _ _) }
termination_by => (x, y)
decreasing_by pgame_wf_tac
decreasing_by all_goals pgame_wf_tac
#align pgame.mul_comm_relabelling SetTheory.PGame.mulCommRelabelling

theorem quot_mul_comm (x y : PGame.{u}) : (⟦x * y⟧ : Game) = ⟦y * x⟧ :=
Expand Down Expand Up @@ -477,7 +477,7 @@ def negMulRelabelling (x y : PGame.{u}) : -x * y ≡r -(x * y) :=
change -(mk xl xr xL xR * _) ≡r _
exact (negMulRelabelling _ _).symm
termination_by => (x, y)
decreasing_by pgame_wf_tac
decreasing_by all_goals pgame_wf_tac
#align pgame.neg_mul_relabelling SetTheory.PGame.negMulRelabelling

@[simp]
Expand Down Expand Up @@ -591,7 +591,7 @@ theorem quot_left_distrib (x y z : PGame) : (⟦x * (y + z)⟧ : Game) = ⟦x *
rw [quot_left_distrib (xR i) (mk yl yr yL yR) (zL k)]
abel
termination_by => (x, y, z)
decreasing_by pgame_wf_tac
decreasing_by all_goals pgame_wf_tac
#align pgame.quot_left_distrib SetTheory.PGame.quot_left_distrib

/-- `x * (y + z)` is equivalent to `x * y + x * z.`-/
Expand Down Expand Up @@ -816,7 +816,7 @@ theorem quot_mul_assoc (x y z : PGame) : (⟦x * y * z⟧ : Game) = ⟦x * (y *
rw [quot_mul_assoc (xR i) (yL j) (zL k)]
abel
termination_by => (x, y, z)
decreasing_by pgame_wf_tac
decreasing_by all_goals pgame_wf_tac
#align pgame.quot_mul_assoc SetTheory.PGame.quot_mul_assoc

/-- `x * y * z` is equivalent to `x * (y * z).`-/
Expand Down

0 comments on commit cc5d761

Please sign in to comment.