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

Commit 3052ee0

Browse files
authored
翻訳準備(3回目) (#27)
* 準備開始 * 用語の暫定対応 * 用語暫定対応 * 章のタグ位置修正 * 用語対策
1 parent 5bfca57 commit 3052ee0

File tree

19 files changed

+637
-88
lines changed

19 files changed

+637
-88
lines changed

GLOSSARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@
293293
| underscore | アンダースコア | |
294294
| unification | 単一化 | |
295295
| union | 合併 | |
296+
| unit-like type | unit-like 型 | |
296297
| unit type | ユニット型 | |
297298
| universe | 宇宙 | |
298299
| universe level | 宇宙レベル | |

Manual.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ file := some "the-index"
170170

171171
翻訳に際して、機械翻訳サービス [DeepL翻訳](https://www.deepl.com/ja/translator) を参考にしました。
172172

173-
この翻訳は原文のcommit [ade9c553a5ab008113cf33f88ced657c5146fe24](https://github.com/leanprover/reference-manual/commit/ade9c553a5ab008113cf33f88ced657c5146fe24) に基づいています。
173+
この翻訳は原文のcommit [27f733b339554f1cc0b3b70e9ca3054397075b97](https://github.com/leanprover/reference-manual/commit/27f733b339554f1cc0b3b70e9ca3054397075b97) に基づいています。
174174

175175
::::::draft
176176

Manual/BasicTypes.lean

Lines changed: 154 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,44 +202,94 @@ tag := "char-api-classes"
202202

203203
{include 0 Manual.BasicTypes.String}
204204

205+
# ユニット型(The Unit Type
206+
207+
:::comment
205208
# The Unit Type
209+
:::
206210

211+
:::comment
207212
The unit type is the least informative type.
208213
It is used when a value is needed, but no further information is relevant.
209214
There are two varieties of the unit type:
210215

216+
:::
217+
218+
ユニット型は最も情報量の少ない型です。これは、値は必要だがそれ以上の情報は必要ない場合に使用されます。ユニット型には2種類あります:
219+
220+
:::comment
211221
* {lean}`Unit` is a {lean}`Type` that exists in the smallest non-propositional {tech}[universe].
212222

223+
:::
224+
225+
* {lean}`Unit` は {lean}`Type` であり、最小の非命題 {tech}[宇宙] に存在します。
226+
227+
:::comment
213228
* {lean}`PUnit` is {tech key:="universe polymorphism"}[universe polymorphic] and can be used in any non-propositional {tech}[universe].
214229

230+
:::
231+
232+
* {lean}`PUnit` は {tech}[宇宙多相] であり、任意の非命題 {tech}[宇宙] で使用することができます。
233+
234+
:::comment
215235
If in doubt, use {lean}`Unit` until universe errors occur.
216236

237+
:::
238+
239+
悩ましい場合は、宇宙に関するエラーが発生するまでは {lean}`Unit` を使ってください。
240+
217241
{docstring Unit}
218242

219243
{docstring Unit.unit}
220244

221245
{docstring PUnit}
222246

247+
:::comment
223248
## Definitional Equality
249+
:::
250+
251+
## 定義上の等価性(Definitional Equality)
224252

253+
254+
:::comment
225255
{deftech}_Unit-like types_ are inductive types that have a single constructor which takes no non-proof parameters.
226256
{lean}`PUnit` is one such type.
227257
All elements of unit-like types are {tech key:="definitional equality"}[definitionally equal] to all other elements.
228258

229-
:::example "Definitional Equality of {lean}`Unit`"
259+
:::
260+
261+
{deftech}_unit-like 型_ (unit-like type)は非証明のパラメータを取らない単一のコンストラクタを持つ帰納型です。 {lean}`PUnit` はそのような型の1つです。unit-like 型のすべての要素は、他のすべての要素を {tech key:="定義上の等価性"}[定義上等しいです] 。
262+
263+
:::comment
264+
::example "Definitional Equality of {lean}`Unit`"
265+
:::
266+
::::example "{lean}`Unit` の定義上の等価性"
267+
:::comment
230268
Every term with type {lean}`Unit` is definitionally equal to every other term with type {lean}`Unit`:
231269

270+
:::
271+
272+
{lean}`Unit` 型を持つすべての項は、 {lean}`Unit` 型を持つすべての項と定義上等しいです:
273+
232274
```lean
233275
example (e1 e2 : Unit) : e1 = e2 := rfl
234276
```
235-
:::
277+
::::
236278

237-
::::keepEnv
238-
:::example "Definitional Equality of Unit-Like Types"
279+
:::::keepEnv
280+
:::comment
281+
::example "Definitional Equality of Unit-Like Types"
282+
:::
283+
::::example "unit-like 型の定義上の等価性"
239284

285+
:::comment
240286
Both {lean}`CustomUnit` and {lean}`AlsoUnit` are unit-like types, with a single constructor that takes no parameters.
241287
Every pair of terms with either type is definitionally equal.
242288

289+
:::
290+
291+
{lean}`CustomUnit` と {lean}`AlsoUnit` はどちらも unit-like 型であり、パラメータを取らないコンストラクタを1つ持ちます。どちらの型を持つ項のペアも定義上等しいです。
292+
243293
```lean
244294
inductive CustomUnit where
245295
| customUnit
@@ -251,16 +301,26 @@ structure AlsoUnit where
251301
example (e1 e2 : AlsoUnit) : e1 = e2 := rfl
252302
```
253303

304+
:::comment
254305
Types with parameters, such as {lean}`WithParam`, are also unit-like if they have a single constructor that does not take parameters.
255306

307+
:::
308+
309+
{lean}`WithParam` のようなパラメータを持つ型も、パラメータを取らないコンストラクタが1つあれば unit-like です。
310+
256311
```lean
257312
inductive WithParam (n : Nat) where
258313
| mk
259314

260315
example (x y : WithParam 3) : x = y := rfl
261316
```
262317

318+
:::comment
263319
Constructors with non-proof parameters are not unit-like, even if the parameters are all unit-like types.
320+
:::
321+
322+
証明ではないパラメータを持つコンストラクタは、パラメータがすべて unit-like 型であっても unit-like になりません。
323+
264324
```lean
265325
inductive NotUnitLike where
266326
| mk (u : Unit)
@@ -278,15 +338,20 @@ but is expected to have type
278338
e1 = e2 : Prop
279339
```
280340

341+
:::comment
281342
Constructors of unit-like types may take parameters that are proofs.
343+
:::
344+
345+
unit-like 型のコンストラクタは証明であるパラメータを取ることができます。
346+
282347
```lean
283348
inductive ProofUnitLike where
284349
| mk : 2 = 2 → ProofUnitLike
285350

286351
example (e1 e2 : ProofUnitLike) : e1 = e2 := rfl
287352
```
288-
:::
289353
::::
354+
:::::
290355

291356
# The Empty Type
292357

@@ -300,24 +365,54 @@ example (e1 e2 : ProofUnitLike) : e1 = e2 := rfl
300365

301366
{docstring PEmpty}
302367

368+
:::comment
303369
# Booleans
370+
:::
371+
372+
# 真偽値(Booleans)
373+
304374

305375
{docstring Bool}
306376

377+
:::comment
307378
The constructors {lean}`Bool.true` and {lean}`Bool.false` are exported from the {lean}`Bool` namespace, so they can be written {lean}`true` and {lean}`false`.
308379

380+
:::
381+
382+
コンストラクタ {lean}`Bool.true` と {lean}`Bool.false` は {lean}`Bool` 名前空間からエクスポートされるため、 {lean}`true` と {lean}`false` と書くことができます。
383+
384+
:::comment
309385
## Run-Time Representation
386+
:::
387+
388+
## ランタイム表現(Run-Time Representation)
389+
310390

391+
:::comment
311392
Because {lean}`Bool` is an {tech}[enum inductive] type, it is represented by a single byte in compiled code.
312393

394+
:::
395+
396+
{lean}`Bool` は {tech}[列挙帰納的] 型であるため、コンパイルされたコードでは1バイトで表現されます。
397+
398+
:::comment
313399
## Booleans and Propositions
400+
:::
401+
402+
## 真偽値と命題(Booleans and Propositions)
403+
314404

405+
:::comment
315406
Both {lean}`Bool` and {lean}`Prop` represent notions of truth.
316407
From a purely logical perspective, they are equivalent: {tech}[propositional extensionality] means that there are fundamentally only two propositions, namely {lean}`True` and {lean}`False`.
317408
However, there is an important pragmatic difference: {lean}`Bool` classifies _values_ that can be computed by programs, while {lean}`Prop` classifies statements for which code generation doesn't make sense.
318409
In other words, {lean}`Bool` is the notion of truth and falsehood that's appropriate for programs, while {lean}`Prop` is the notion that's appropriate for mathematics.
319410
Because proofs are erased from compiled programs, keeping {lean}`Bool` and {lean}`Prop` distinct makes it clear which parts of a Lean file are intended for computation.
320411

412+
:::
413+
414+
{lean}`Bool` と {lean}`Prop` はどちらも真理の概念を表します。純粋論理の観点から見ると、両者は同等です: {tech}[propositional extensionality] は基本的に2つの命題、すなわち {lean}`True` と {lean}`False` しか存在しないことを意味します。しかし、実用上は重要な違いがあります: {lean}`Bool` はプログラムで計算できる _値_ を分類し、 {lean}`Prop` はコード生成が意味を為さない文を分類します。言い換えると、 {lean}`Bool` はプログラムに適した真偽の概念であり、 {lean}`Prop` は数学に適した概念です。コンパイルされたプログラムから証明は消去されるため、 {lean}`Bool` と {lean}`Prop` を区別しておくことで Lean ファイルのどの部分が計算を目的としているかが明確になります。
415+
321416
```lean (show := false)
322417
section BoolProp
323418

@@ -332,29 +427,49 @@ example : (true = true) = True := by simp
332427
#check decide
333428
```
334429

430+
:::comment
335431
A {lean}`Bool` can be used wherever a {lean}`Prop` is expected.
336432
There is a {tech}[coercion] from every {lean}`Bool` {lean}`b` to the proposition {lean}`b = true`.
337433
By {lean}`propext`, {lean}`true = true` is equal to {lean}`True`, and {lean}`false = true` is equal to {lean}`False`.
338434

435+
:::
436+
437+
{lean}`Bool` は {lean}`Prop` が期待されているところではどこでも使うことができます。すべての {lean}`Bool` {lean}`b` から命題 {lean}`b = true` への {tech}[coercion] が存在します。 {lean}`propext` により、 {lean}`true = true` は {lean}`True` に、 {lean}`false = true` は {lean}`False` にそれぞれ等しいです。
438+
439+
:::comment
339440
Not every proposition can be used by programs to make run-time decisions.
340441
Otherwise, a program could branch on whether the Collatz conjecture is true or false!
341442
Many propositions, however, can be checked algorithmically.
342443
These propositions are called {tech}_decidable_ propositions, and have instances of the {lean}`Decidable` type class.
343444
The function {name}`Decidable.decide` converts a proof-carrying {lean}`Decidable` result into a {lean}`Bool`.
344445
This function is also a coercion from decidable propositions to {lean}`Bool`, so {lean}`(2 = 2 : Bool)` evaluates to {lean}`true`.
345446

447+
:::
448+
449+
全ての命題をプログラムがランタイム時の判断に使えるわけではありません。そうでなければコラッツ予想が真か偽かでプログラムが分岐してしまいます!しかし、多くの命題はアルゴリズムでチェックすることができます。これらの命題は {tech}_決定可能_ な命題と呼ばれ、 {lean}`Decidable` 型クラスを持ちます。関数 {name}`Decidable.decide` は証明を格納した {lean}`Decidable` の結果を {lean}`Bool` に変換します。この関数は決定可能な命題から {lean}`Bool` への強制演算でもあるため、 {lean}`(2 = 2 : Bool)` は {lean}`true` と評価されます。
450+
346451
```lean (show := false)
347452
/-- info: true -/
348453
#guard_msgs in
349454
#eval (2 = 2 : Bool)
350455
end BoolProp
351456
```
352457

458+
:::comment
353459
## Syntax
460+
:::
461+
462+
## 構文(Syntax)
354463

355-
:::syntax term
464+
465+
::::syntax term
466+
:::comment
356467
The infix operators `&&`, `||`, and `^^` are notations for {lean}`Bool.and`, {lean}`Bool.or`, and {lean}`Bool.xor`, respectively.
357468

469+
:::
470+
471+
中置演算子 `&&``||``^^` はそれぞれ {lean}`Bool.and` ・ {lean}`Bool.or` ・ {lean}`Bool.xor` の表記です。
472+
358473
```grammar
359474
$_:term && $_:term
360475
```
@@ -364,30 +479,50 @@ $_:term || $_:term
364479
```grammar
365480
$_:term ^^ $_:term
366481
```
367-
:::
482+
::::
368483

369-
:::syntax term
484+
::::syntax term
485+
:::comment
370486
The prefix operator `!` is notation for {lean}`Bool.not`.
487+
:::
488+
489+
前置演算子 `!` は {lean}`Bool.not` の表記です。
490+
371491
```grammar
372492
!$_:term
373493
```
374-
:::
494+
::::
375495

376496

497+
:::comment
377498
## API Reference
499+
:::
378500

501+
## API リファレンス(API Reference)
502+
503+
504+
:::comment
379505
### Logical Operations
506+
:::
507+
508+
### 論理演算子(Logical Operations)
509+
380510

381511
```lean (show := false)
382512
section ShortCircuit
383513

384514
axiom BIG_EXPENSIVE_COMPUTATION : Bool
385515
```
386516

517+
:::comment
387518
The functions {name}`cond`, {name Bool.and}`and`, and {name Bool.or}`or` are short-circuiting.
388519
In other words, {lean}`false && BIG_EXPENSIVE_COMPUTATION` does not need to execute {lean}`BIG_EXPENSIVE_COMPUTATION` before returning `false`.
389520
These functions are defined using the {attr}`macro_inline` attribute, which causes the compiler to replace calls to them with their definitions while generating code, and the definitions use nested pattern matching to achieve the short-circuiting behavior.
390521

522+
:::
523+
524+
関数 {name}`cond` ・ {name Bool.and}`and` ・ {name Bool.or}`or` は短絡します。つまり、 {lean}`false && BIG_EXPENSIVE_COMPUTATION` は `false` を返す前に {lean}`BIG_EXPENSIVE_COMPUTATION` を実行する必要はありません。これらの関数は {attr}`macro_inline` 属性を使用して定義されています。これによりコンパイラはコードを生成する際に関数の呼び出しを定義に置き換え、入れ子のパターンマッチを用いる定義が短絡評価されるようになります。
525+
391526
```lean (show := false)
392527
end ShortCircuit
393528
```
@@ -405,11 +540,21 @@ end ShortCircuit
405540

406541
{docstring Bool.atLeastTwo}
407542

543+
:::comment
408544
### Comparisons
545+
:::
546+
547+
### 比較(Comparisons)
548+
409549

410550
{docstring Bool.decEq}
411551

552+
:::comment
412553
### Conversions
554+
:::
555+
556+
### 変換(Conversions)
557+
413558

414559
{docstring Bool.toISize}
415560

Manual/Classes/BasicClasses.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ Lean の型クラスの多くは、加算や配列インデックスのような
5656

5757
:::comment
5858
# Decidability
59-
%%%
60-
tag := "decidable-propositions"
61-
%%%
6259

6360
:::
6461

6562
# 決定可能性(Decidability)
63+
%%%
64+
tag := "decidable-propositions"
65+
%%%
6666

6767
:::comment
6868
A proposition is {deftech}_decidable_ if it can be checked algorithmically.{index}[decidable]{index subterm:="decidable"}[proposition]

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.

0 commit comments

Comments
 (0)