Skip to content
This repository was archived by the owner on Jan 5, 2025. It is now read-only.

Commit d05b7a0

Browse files
committed
翻訳開始
1 parent e3dd92a commit d05b7a0

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

Manual/Language/RecursiveDefs/Structural/CourseOfValuesExample.lean

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ open Lean.Elab.Tactic.GuardMsgs.WhitespaceMode
1818
#doc (Manual) "再帰の例(Recursion Example (for inclusion elsewhere))" =>
1919

2020

21-
:::example "Course-of-Values Tables"
21+
:::comment
22+
::example "Course-of-Values Tables"
23+
:::
24+
::::example "Course-of-Values Tables"
25+
:::comment
2226
This definition is equivalent to {name}`List.below`:
27+
:::
28+
29+
以下の定義は {name}`List.below` と同等です:
30+
2331
```lean
2432
def List.below' {α : Type u} {motive : List α → Sort u} : List α → Sort (max 1 u)
2533
| [] => PUnit
@@ -33,17 +41,32 @@ theorem List.below_eq_below' : @List.below = @List.below' := by
3341
congr
3442
```
3543

36-
In other words, for a given {tech}[動機]motive, {lean}`List.below'` is a type that contains a realization of the motive for all suffixes of the list.
44+
:::comment
45+
In other words, for a given {tech}[motive], {lean}`List.below'` is a type that contains a realization of the motive for all suffixes of the list.
46+
47+
:::
48+
49+
言い換えると、与えられた {tech}[動機] に対して、 {lean}`List.below'` はリストのすべての接尾辞に対する動機の実現を含む型です。
3750

51+
:::comment
3852
More recursive arguments require further nested iterations of the product type.
3953
For instance, binary trees have two recursive occurrences.
54+
:::
55+
56+
より再帰的な引数は直積型の反復をさらに入れ子にする必要があります。例えば、二分木には2つの再帰が出現します。
57+
4058
```lean
4159
inductive Tree (α : Type u) : Type u where
4260
| leaf
4361
| branch (left : Tree α) (val : α) (right : Tree α)
4462
```
4563

64+
:::comment
4665
It's corresponding course-of-values table contains the realizations of the motive for all subtrees:
66+
:::
67+
68+
対応する累積テーブルにはすべてのサブツリーに対する動機の実現が含まれています:
69+
4770
```lean
4871
def Tree.below' {α : Type u} {motive : Tree α → Sort u} : Tree α → Sort (max 1 u)
4972
| .leaf => PUnit
@@ -60,12 +83,22 @@ theorem Tree.below_eq_below' : @Tree.below = @Tree.below' := by
6083
congr
6184
```
6285

86+
:::comment
6387
For both lists and trees, the `brecOn` operator expects just a single case, rather than one per constructor.
6488
This case accepts a list or tree along with a table of results for all smaller values; from this, it should satisfy the motive for the provided value.
6589
Dependent case analysis of the provided value automatically refines the type of the memo table, providing everything needed.
6690

91+
:::
92+
93+
リストと木のどちらについても、`brecOn` 演算子はコンストラクタごとに1つではなく、1つのケースだけを想定しています。このエースはリストまたは木を、すべての小さい値に対する結果のテーブルと一緒に受け入れます;これにより、このケースは与えられた値に対する動機を満たすべきです。提供された値の依存ケース分析によって、メモテーブルの型が自動的に絞り込まれ、必要なものがすべて提供されます。
94+
95+
:::comment
6796
The following definitions are equivalent to {name}`List.brecOn` and {name}`Tree.brecOn`, respectively.
6897
The primitive recursive helpers {name}`List.brecOnTable` and {name}`Tree.brecOnTable` compute the course-of-values tables along with the final results, and the actual definitions of the `brecOn` operators simply project out the result.
98+
:::
99+
100+
以下の定義はそれぞれ {name}`List.brecOn` と {name}`Tree.brecOn` に同等です。プリミティブな再帰補助関数 {name}`List.brecOnTable` と {name}`Tree.brecOnTable` は最終結果と共に累積テーブルを計算し、実際の `brecOn` 演算子の定義は単に結果を射影します。
101+
69102
```lean
70103
def List.brecOnTable {α : Type u}
71104
{motive : List α → Sort u}
@@ -169,4 +202,4 @@ info: fun motive x z step =>
169202
#reduce fun motive x z step => Tree.brecOn (motive := motive) (.branch (.branch .leaf x .leaf) z .leaf) step
170203
```
171204

172-
:::
205+
::::

0 commit comments

Comments
 (0)