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

Commit 7b07502

Browse files
committed
用語の暫定対応
1 parent b630270 commit 7b07502

File tree

9 files changed

+33
-33
lines changed

9 files changed

+33
-33
lines changed

Manual/Elaboration.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ To provide a uniform interface to functions defined via structural and well-foun
431431
In the function's namespace, `eq_unfold` relates the function directly to its definition, `eq_def` relates it to the definition after instantiating implicit parameters, and $`N` lemmas `eq_N` relate each case of its pattern-matching to the corresponding right-hand side, including sufficient assumptions to indicate that earlier branches were not taken.
432432
:::
433433

434-
構造的に単純な再帰関数の場合、その翻訳は型の再帰子を使用します。このような関数はカーネルで実行すると比較的効率的である傾向があり、定義された等式が定義上成立し、理解も容易です。型の再帰子で捕捉できないその他のパターンの再帰を使用する関数は {deftech}[整礎再帰] (well-founded recursion)を使用して翻訳されます。これは各再帰呼び出しのたびに何かしらの基準が減少することの証明のもとの構造的な再帰です。Lean はこれらのケースの多くを自動的に導出できますが、手作業での証明が必要なものもあります。整礎再帰はより柔軟なものですが、基準が減少することを示す証明項が定義する等式が成立するのは命題上だけであるため、結果として得られる関数はカーネルでの実行速度が遅くなることが多いです。構造的で整礎な再帰によって定義された関数に統一されたインタフェースを提供し、それ自身の正しさをチェックするために、エラボレータは関数をもとの定義に関連付ける等式の補題を証明します。関数の名前空間において、`eq_unfold` は関数を直接定義に関連付け、`eq_def` は暗黙のパラメータをインスタンス化した後の定義に関連付け、 $`N` 個の補題 `eq_N` はパターンマッチの各ケースと対応する右辺を関連付けます。これにはそれより前の分岐が取られないことの十分な仮定を含みます。
434+
構造的に単純な再帰関数の場合、その翻訳は型の再帰子を使用します。このような関数はカーネルで実行すると比較的効率的である傾向があり、定義された等式が定義上成立し、理解も容易です。型の再帰子で捕捉できないその他のパターンの再帰を使用する関数は {deftech}[整礎再帰] (well-founded recursion)を使用して翻訳されます。これは各再帰呼び出しのたびに何かしらの {deftech}_測度_ (measure)が減少することの証明のもとの構造的な再帰です。Lean はこれらのケースの多くを自動的に導出できますが、手作業での証明が必要なものもあります。整礎再帰はより柔軟なものですが、基準が減少することを示す証明項が定義する等式が成立するのは命題上だけであるため、結果として得られる関数はカーネルでの実行速度が遅くなることが多いです。構造的で整礎な再帰によって定義された関数に統一されたインタフェースを提供し、それ自身の正しさをチェックするために、エラボレータは関数をもとの定義に関連付ける等式の補題を証明します。関数の名前空間において、`eq_unfold` は関数を直接定義に関連付け、`eq_def` は暗黙のパラメータをインスタンス化した後の定義に関連付け、 $`N` 個の補題 `eq_N` はパターンマッチの各ケースと対応する右辺を関連付けます。これにはそれより前の分岐が取られないことの十分な仮定を含みます。
435435

436436
:::::keepEnv
437437
:::comment

Manual/IO.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tag := "io"
3232

3333

3434
Lean is a pure functional programming language.
35-
While Lean code is strictly evaluated at run time, the order of evaluation that is used during type checking, especially while checking {tech}[definitional equality], is formally unspecified and makes use of a number of heuristics that improve performance but are subject to change.
35+
While Lean code is strictly evaluated at run time, the order of evaluation that is used during type checking, especially while checking {tech}[定義上の等価性]definitional equality, is formally unspecified and makes use of a number of heuristics that improve performance but are subject to change.
3636
This means that simply adding operations that perform side effects (such as file I/O, exceptions, or mutable references) would lead to programs in which the order of effects is unspecified.
3737
During type checking, even terms with free variables are reduced; this would make side effects even more difficult to predict.
3838
Finally, a basic principle of Lean's logic is that functions are _functions_ that map each element of the domain to a unique element of the range.
@@ -129,7 +129,7 @@ example : BaseIO = EIO Empty := rfl
129129
## Errors and Error Handling
130130

131131
Error handling in the {lean}`IO` monad uses the same facilities as any other {tech}[exception monad].
132-
In particular, throwing and catching exceptions uses the methods of the {name}`MonadExceptOf` {tech}[type class].
132+
In particular, throwing and catching exceptions uses the methods of the {name}`MonadExceptOf` {tech}[型クラス]type class.
133133
The exceptions thrown in {lean}`IO` have the type {lean}`IO.Error`.
134134
The constructors of this type represent the low-level errors that occur on most operating systems, such as files not existing.
135135
The most-used constructor is {name IO.Error.userError}`userError`, which covers all other cases and includes a string that describes the problem.

Manual/Language/RecursiveDefs.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ tag := "recursive-definitions"
2121
%%%
2222

2323
Allowing arbitrary recursive function definitions would make Lean's logic inconsistent.
24-
General recursion makes it possible to write circular proofs: "{tech}[proposition] $`P` is true because proposition $`P` is true".
24+
General recursion makes it possible to write circular proofs: "{tech}[命題]proposition $`P` is true because proposition $`P` is true".
2525
Outside of proofs, an infinite loop could be assigned the type {name}`Empty`, which can be used with {keywordOf Lean.Parser.Term.nomatch}`nomatch` or {name Empty.rec}`Empty.rec` to prove any theorem.
2626

27-
Banning recursive function definitions outright would render Lean far less useful: {tech}[inductive types] are key to defining both predicates and data, and they have a recursive structure.
27+
Banning recursive function definitions outright would render Lean far less useful: {tech}[帰納型]inductive types are key to defining both predicates and data, and they have a recursive structure.
2828
Furthermore, most useful recursive functions do not threaten soundness, and infinite loops usually indicate mistakes in definitions rather than intentional behavior.
2929
Instead of banning recursive functions, Lean requires that each recursive function is defined safely.
3030
While elaborating recursive definitions, the Lean elaborator also produces a justification that the function being defined is safe.{margin}[The section on {ref "elaboration-results"}[the elaborator's output] in the overview of elaboration contextualizes the elaboration of recursive definitions in the overall context of the elaborator.]
@@ -33,15 +33,15 @@ There are four main kinds of recursive functions that can be defined:
3333

3434
: Structurally recursive functions
3535

36-
Structurally recursive functions take an argument such that the function makes recursive calls only on strict sub-components of said argument.{margin}[Strictly speaking, arguments whose types are {tech}[indexed families] are grouped together with their indices, with the whole collection considered as a unit.]
37-
The elaborator translates the recursion into uses of the argument's {tech}[recursor].
36+
Structurally recursive functions take an argument such that the function makes recursive calls only on strict sub-components of said argument.{margin}[Strictly speaking, arguments whose types are {tech}[添字族]indexed families are grouped together with their indices, with the whole collection considered as a unit.]
37+
The elaborator translates the recursion into uses of the argument's {tech}[再帰子]recursor.
3838
Because every type-correct use of a recursor is guaranteed to avoid infinite regress, this translation is evidence that the function terminates.
3939
Applications of functions defined via recursors are definitionally equal to the result of the recursion, and are typically relatively efficient inside the kernel.
4040

4141
: Recursion over well-founded relations
4242

4343
Many functions are also difficult to convert to structural recursion; for instance, a function may terminate because the difference between an array index and the size of the array decreases as the index increases, but {name}`Nat.rec` isn't applicable because the index that increases is the function's argument.
44-
Here, there is a {tech}[measure] of termination that decreases at each recursive call, but the measure is not itself an argument to the function.
44+
Here, there is a {tech}[測度]measure of termination that decreases at each recursive call, but the measure is not itself an argument to the function.
4545
In these cases, {tech}[well-founded recursion] can be used to define the function.
4646
Well-founded recursion is a technique for systematically transforming recursive functions with a decreasing measure into recursive functions over proofs that every sequence of reductions to the measure eventually terminates at a minimum.
4747
Applications of functions defined via well-founded recursion are not necessarily definitionally equal to their return values, but this equality can be proved as a proposition.

Manual/Language/RecursiveDefs/Structural.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Next, for each group of parameters, a translation using `brecOn` is attempted.
3737
{spliceContents Manual.Language.RecursiveDefs.Structural.CourseOfValuesExample}
3838

3939
The `below` construction is a mapping from each value of a type to the results of some function call on _all_ smaller values; it can be understood as a memoization table that already contains the results for all smaller values.
40-
Recursors expect an argument for each of the inductive type's constructors; these arguments are called with the constructor's arguments (and the result of recursion on recursive parameters) during {tech}[ι-reduction].
40+
Recursors expect an argument for each of the inductive type's constructors; these arguments are called with the constructor's arguments (and the result of recursion on recursive parameters) during {tech}[ι簡約]ι-reduction.
4141
The course-of-values recursion operator `brecOn`, on the other hand, expects just a single case that covers all constructors at once.
4242
This case is provided with a value and a `below` table that contains the results of recursion on all values smaller than the given value; it should use the contents of the table to satisfy the motive for the provided value.
4343
If the function is structurally recursive over a given parameter (or parameter group), then the results of all recursive calls will be present in this table already.

Manual/Language/RecursiveDefs/Structural/CourseOfValuesExample.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ theorem List.below_eq_below' : @List.below = @List.below' := by
3030
congr
3131
```
3232

33-
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.
33+
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.
3434

3535
More recursive arguments require further nested iterations of the product type.
3636
For instance, binary trees have two recursive occurrences.

Manual/Monads/Syntax.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ for $[$[$h :]? $x in $y],* do
532532
:::
533533

534534
A {keywordOf Lean.Parser.Term.doFor}`for`​`…`​{keywordOf Lean.Parser.Term.doFor}`in` loop requires at least one clause that specifies the iteration to be performed, which consists of an optional membership proof name followed by a colon (`:`), a pattern to bind, the keyword {keywordOf Lean.Parser.Term.doFor}`in`, and a collection term.
535-
The pattern, which may just be an {tech}[identifier], must match any element of the collection; patterns in this position cannot be used as implicit filters.
535+
The pattern, which may just be an {tech}[識別子]identifier, must match any element of the collection; patterns in this position cannot be used as implicit filters.
536536
Further clauses may be provided by separating them with commas.
537537
Each collection is iterated over at the same time, and iteration stops when any of the collections runs out of elements.
538538

Manual/Monads/Zoo.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ For example, there might be a mutable {lean}`Nat` and a mutable {lean}`String` o
157157
As long as they have different types, it should be convenient to access both.
158158
In typical use, some monadic operations that are overloaded in type classes have type information available for {tech key:="synthesis"}[instance synthesis], while others do not.
159159
For example, the argument passed to {name MonadState.set}`set` determines the type of the state to be used, while {name MonadState.get}`get` takes no such argument.
160-
The type information present in applications of {name MonadState.set}`set` can be used to pick the correct instance when multiple states are available, which suggests that the type of the mutable state should be an input parameter or {tech}[semi-output parameter] so that it can be used to select instances.
161-
The lack of type information present in uses of {name MonadState.get}`get`, on the other hand, suggests that the type of the mutable state should be an {tech}[output parameter] in {lean}`MonadState`, so type class synthesis determines the state's type from the monad itself.
160+
The type information present in applications of {name MonadState.set}`set` can be used to pick the correct instance when multiple states are available, which suggests that the type of the mutable state should be an input parameter or {tech}[半出力パラメータ]semi-output parameter so that it can be used to select instances.
161+
The lack of type information present in uses of {name MonadState.get}`get`, on the other hand, suggests that the type of the mutable state should be an {tech}[出力パラメータ]output parameter in {lean}`MonadState`, so type class synthesis determines the state's type from the monad itself.
162162

163163
This dichotomy is solved by having two versions of many of the effect type classes.
164164
The version with a semi-output parameter has the suffix `-Of`, and its operations take types explicitly as needed.
@@ -270,7 +270,7 @@ Providing the state type explicitly using {name}`getThe` from {name}`MonadStateO
270270
(getThe String, getThe Nat) : M String × M Nat
271271
```
272272

273-
Setting a state works for either type, because the state type is a {tech}[semi-output parameter] on {name}`MonadStateOf`.
273+
Setting a state works for either type, because the state type is a {tech}[半出力パラメータ]semi-output parameter on {name}`MonadStateOf`.
274274
```lean (name := setNat)
275275
#check (set 4 : M Unit)
276276
```

Manual/Monads/Zoo/Combined.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ In one ordering, state changes are rolled back when exceptions are caught; in th
6060
The latter option matches the semantics of most imperative programming languages, but the former is very useful for search-based problems.
6161
Often, some but not all state should be rolled back; this can be achieved by “sandwiching” {name}`ExceptT` between two separate uses of {name}`StateT`.
6262

63-
To avoid yet another layer of indirection via the use of {lean}`StateT σ (EStateM ε σ') α`, {name}`EStateM` offers the {name}`EStateM.Backtrackable` {tech}[type class].
63+
To avoid yet another layer of indirection via the use of {lean}`StateT σ (EStateM ε σ') α`, {name}`EStateM` offers the {name}`EStateM.Backtrackable` {tech}[型クラス]type class.
6464
This class specifies some part of the state that can be saved and restored.
6565
{name}`EStateM` then arranges for the saving and restoring to take place around error handling.
6666

0 commit comments

Comments
 (0)