The Lean Reference Manual
Release 3.3.0Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.5 Constructors, Projections, and Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.6 Structured Proofs type α or report an error if it fails. Lean supports anonymous constructor notation, anonymous projections, and various forms of match syntax, including destructuring λ and let. These, as well as notation 2 → a^n + b^n ̸= c^n def unbounded (f : N → N) : Prop := ∀ M, ∃ n, f n ≥ M 3.5 Constructors, Projections, and Matching Lean’s foundation, the Calculus of Inductive Constructions, supports the declaration0 码力 | 67 页 | 266.23 KB | 1 年前3
Agda User Manual v2.6.4.1signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private (continues allowed: -- third (cons _ (cons _ (cons x _))) = x Instead, you can use the record fields as projections: third str = str .tl .tl .hd The constructor can be used as usual in the right-hand side of definitions: their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type0 码力 | 311 页 | 1.38 MB | 1 年前3
Agda User Manual v2.6.4.3signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private (continues allowed: -- third (cons _ (cons _ (cons x _))) = x Instead, you can use the record fields as projections: third str = str .tl .tl .hd The constructor can be used as usual in the right-hand side of definitions: their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type0 码力 | 311 页 | 1.38 MB | 1 年前3
Agda User Manual v2.6.4.2signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private (continues allowed: -- third (cons _ (cons _ (cons x _))) = x Instead, you can use the record fields as projections: third str = str .tl .tl .hd The constructor can be used as usual in the right-hand side of definitions: their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type0 码力 | 311 页 | 1.38 MB | 1 年前3
Agda User Manual v2.6.4signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private (continues allowed: -- third (cons _ (cons _ (cons x _))) = x Instead, you can use the record fields as projections: third str = str .tl .tl .hd The constructor can be used as usual in the right-hand side of definitions: their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type0 码力 | 313 页 | 1.38 MB | 1 年前3
Agda User Manual v2.6.3signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private allowed: -- third (cons _ (cons _ (cons x _))) = x Instead, you can use the record fields as projections: third str = str .tl .tl .hd The constructor can be used as usual in the right-hand side of definitions: their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type0 码力 | 379 页 | 354.83 KB | 1 年前3
Agda User Manual v2.6.2.2signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type -> (x : Subset A P) -> P (Subset.elem x) certificate (a # p) = irrAx p Example 4. Irrelevant projections are justified by the irrelevance axiom. .unsquash' : ∀ {A} → Squash A → A unsquash' (squash x)0 码力 | 354 页 | 433.60 KB | 1 年前3
Agda User Manual v2.6.3signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private posZ : allowed: -- third (cons _ (cons _ (cons x _))) = x Instead, you can use the record fields as projections: third str = str .tl .tl .hd The constructor can be used as usual in the right-hand side of definitions: their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type0 码力 | 288 页 | 1.24 MB | 1 年前3
Agda User Manual v2.6.2.2signatures, even when in an abstract block! To work around this we have to define aliases for the projections functions: -- A property about the representation of zero integers: abstract private posZ : their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type -> (x : Subset A P) -> P (Subset.elem x) certificate (a # p) = irrAx p Example 4. Irrelevant projections are justified by the irrelevance axiom. .unsquash' : ∀ {A} → Squash A → A unsquash' (squash x)0 码力 | 257 页 | 1.16 MB | 1 年前3
Agda User Manual v2.6.1.3their name with a dot in the definition of the record type. Projections for irrelevant fields are only created if option --irrelevant-projections is supplied (since Agda > 2.5.4). Example 1. A record type inconsistency. This might be fixed in the future. --experimental-irrelevance and --irrelevant-projections; enables potentially unsound irrelevance features (irrelevant levels, irrelevant data matching time. We can for instance prove that any pair is equal to the pairing of its first and second projections, a property commonly called eta-equality: eta : (p@(a , b) : Σ A B) → p ≡ (a , b) eta p = refl0 码力 | 305 页 | 375.80 KB | 1 年前3
共 145 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15













