Lean’s Dependent Type Theory
- 80Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is Lean?
What is Lean?
80 questions
- 1
What is Lean?
- A
A proof assistant based on homotopy type theory
- B
A programming language based exclusively on set theory
- C
A hardware compiler based on untyped lambda calculus
- D
An open-source interactive theorem prover based on dependent type theory
Correct answer
DAn open-source interactive theorem prover based on dependent type theory
Explanation
Lean is an open-source interactive theorem prover based on dependent type theory, with programming and metaprogramming capabilities.
- A
- 2
Which characterization of Lean's logical foundation is correct?
- A
Lean is classical rather than intuitionistic and is based on homotopy type theory
- B
Lean is intuitionistic rather than classical and is based on homotopy type theory
- C
Lean is classical rather than intuitionistic and is not based on homotopy type theory
- D
Lean is intuitionistic rather than classical and is not based on type theory
Correct answer
CLean is classical rather than intuitionistic and is not based on homotopy type theory
Explanation
The content characterizes Lean as a classical system, as opposed to intuitionistic, and explicitly distinguishes it from homotopy type theory.
- A
- 3
Which system is Lean described as being similar to?
- A
The set theory associated with the ZFC model only
- B
The homotopy type theory associated with univalence
- C
The Calculus of Inductive Constructions associated with Coq
- D
The simply typed assembly calculus associated with LLVM
Correct answer
CThe Calculus of Inductive Constructions associated with Coq
Explanation
Lean is described as being very similar to the Calculus of Inductive Constructions, or CIC, associated with Coq.
- A
- 4
What was the original purpose of the untyped lambda calculus?
- A
To provide a simple model of computation
- B
To establish the consistency of classical set theory
- C
To encode only propositions with computational content
- D
To define a hierarchy of mathematical universes
Correct answer
ATo provide a simple model of computation
Explanation
Alonzo Church developed the untyped lambda calculus as a simple model of computation.
- A
- 5
How does the computational power of the untyped lambda calculus compare with that of Turing machines?
- A
The lambda calculus is strictly weaker than Turing machines
- B
The lambda calculus is strictly stronger than Turing machines
- C
They compute different classes of functions with no overlap
- D
They are equivalent in computational power
Correct answer
DThey are equivalent in computational power
Explanation
The untyped lambda calculus and Turing machines are equivalent in computational power.
- A
- 6
Which forms can an expression in the untyped lambda calculus take?
- A
A substitution, a context, or a typing judgment
- B
A proposition, a universe, or a recursor
- C
A variable, a product, or an inductive constructor
- D
A variable, an application, or a lambda abstraction
Correct answer
DA variable, an application, or a lambda abstraction
Explanation
An expression is either a variable, an application of one expression to another, or a lambda abstraction that binds a variable.
- A
- 7
What does beta reduction do in the lambda calculus?
- A
It changes every proposition into a proof regardless of its inhabitants
- B
It converts an inductive constructor into a universe level
- C
It replaces every type with the universe immediately above it
- D
It applies a lambda abstraction to an argument by substituting the argument for the bound variable
Correct answer
DIt applies a lambda abstraction to an argument by substituting the argument for the bound variable
Explanation
Beta reduction evaluates an application of a lambda by substituting its argument for the lambda's bound variable.
- A
- 8
What does nondeterministic reduction in the lambda calculus permit?
- A
Reduction can proceed at different available application sites
- B
Reduction is prohibited whenever more than one redex exists
- C
Every term must follow one predetermined evaluation order
- D
Only function arguments may be reduced, never function bodies
Correct answer
AReduction can proceed at different available application sites
Explanation
The nondeterministic relation allows reduction at any appropriate application site, so a term may have multiple possible reduction sequences.
- A
- 9
What does the Church–Rosser theorem assert about lambda-calculus reduction?
- A
Every term has exactly one immediate reduction step
- B
Every reduction sequence must terminate after finitely many steps
- C
Every syntactically different term has a different normal form
- D
Two terms reached from a common term can be reduced further to a common term
Correct answer
DTwo terms reached from a common term can be reduced further to a common term
Explanation
Confluence means that if a common term reduces to two terms, those terms can themselves be reduced to a common successor term, even though some sequences may be infinite.
- A
- 10
What is the main typing distinction between a simply typed lambda calculus and the untyped lambda calculus?
- A
Variables are replaced by inductive constructors
- B
Lambda-bound variables receive type annotations
- C
Applications are removed from all expressions
- D
Reduction is replaced entirely by set-theoretic equality
Correct answer
BLambda-bound variables receive type annotations
Explanation
In the simply typed system, lambda-bound variables are annotated with types.
- A
- 11
What does the application typing rule require?
- A
The function and argument must have identical types before application
- B
The function must have a base type and the argument must have a function type
- C
The argument must itself be a universe, regardless of the function's domain
- D
The function's domain must match the argument's type, producing its codomain
Correct answer
DThe function's domain must match the argument's type, producing its codomain
Explanation
If e1 has a function type from α to β and e2 has type α, then e1e2 has type β.
- A
- 12
When does a lambda abstraction have function type α→β?
- A
When the body is an untyped expression that contains no applications
- B
When its body has type β in a context extended with the variable having type α
- C
When its body has type α in the original context without the variable
- D
When its bound variable has type β and its body has type α
Correct answer
BWhen its body has type β in a context extended with the variable having type α
Explanation
The lambda rule extends the context with x:α and checks that the body e has type β.
- A
- 13
What important normalization property follows from simple typing?
- A
Only terms containing the Y combinator normalize
- B
Typing has no effect on the possible reduction behavior
- C
All well-typed terms strongly normalize
- D
All well-typed terms reduce forever
Correct answer
CAll well-typed terms strongly normalize
Explanation
Unlike the untyped lambda calculus, the simply typed system has strong normalization: every well-typed term normalizes.
- A
- 14
Why is the Y combinator unavailable in simple type theory?
- A
It has no valid typing in the simply typed system
- B
It violates the Church–Rosser theorem but is otherwise well typed
- C
It is an inductive proposition with no constructor
- D
It belongs only to the lowest universe of propositions
Correct answer
AIt has no valid typing in the simply typed system
Explanation
Terms such as the Y combinator can be written in the untyped calculus but do not receive valid types in simple type theory.
- A
- 15
What is the key feature of a dependent function type?
- A
The function cannot be applied until its result type is erased
- B
The codomain may refer to the argument supplied to the function
- C
The function may accept only propositions as arguments
- D
The domain and codomain must always be identical
Correct answer
BThe codomain may refer to the argument supplied to the function
Explanation
In a dependent Pi type, written here as ∀x∈α,β, the result type β may depend on x.
- A
- 16
How does the application rule for a dependent function differ from the simple function rule?
- A
The function is converted into an inductive type before application
- B
The argument is discarded before the result type is computed
- C
The result type substitutes the argument for the dependent variable
- D
The result type is always replaced by the function's domain
Correct answer
CThe result type substitutes the argument for the dependent variable
Explanation
Applying a dependent function substitutes the argument for the bound variable in the codomain.
- A
- 17
Why is a universe of types needed for a parametric identity function?
- A
The identity function must quantify over a variable whose value is itself a type
- B
The identity function can only be defined using classical choice
- C
The identity function requires an inductive constructor for every argument
- D
The identity function must be prevented from accepting ordinary terms
Correct answer
AThe identity function must quantify over a variable whose value is itself a type
Explanation
A parametric identity function generalizes over a type, so the system needs a type whose elements are types.
- A
- 18
What changes when terms and types are combined into one class of expressions?
- A
The system can express computations whose results are types
- B
The system makes every proposition automatically true
- C
The system loses all lambda abstractions
- D
The system can no longer represent ordinary functions
Correct answer
AThe system can express computations whose results are types
Explanation
Once terms and types are unified, lambdas can have types as results, enabling computation at the type level.
- A
- 19
Why is the rule that Type has type Type inconsistent?
- A
It forces every inductive type to have exactly one constructor
- B
It permits a version of Russell's paradox, making every proposition inhabited
- C
It prevents all dependent functions from being formed
- D
It makes beta reduction nonconfluent but preserves consistency
Correct answer
BIt permits a version of Russell's paradox, making every proposition inhabited
Explanation
Having a universe contain itself permits a type-theoretic version of Russell's paradox and leads to the collapse in which all propositions become provable.
- A
- 20
How do universe hierarchies avoid the circularity of Type:Type?
- A
They eliminate all universes except the universe of propositions
- B
They identify every universe with the largest available universe
- C
They place universe Un in the strictly higher universe Un+1
- D
They place every universe in itself but restrict applications
Correct answer
CThey place universe Un in the strictly higher universe Un+1
Explanation
The hierarchy assigns Un the type Un+1, preventing a universe from directly containing itself.
- A
- 21
How is the universe of a Pi type determined when its components live in different universes?
- A
It is placed at the larger universe level, subject to the special imax rule
- B
It is always placed in the smaller universe level
- C
It is placed in a new universe unrelated to either component
- D
It is always placed in the universe of the function domain
Correct answer
AIt is placed at the larger universe level, subject to the special imax rule
Explanation
The Pi universe rule uses the larger level, with imax modifying the behavior when the codomain is in the proposition universe.
- A
- 22
What is the Curry–Howard correspondence?
- A
Universes correspond to variables, and variables correspond to reduction rules
- B
Inductive types correspond to sets, and constructors correspond to cardinalities
- C
Functions correspond to propositions, and applications correspond to contradictions
- D
Propositions correspond to types, and proofs correspond to inhabitants of those types
Correct answer
DPropositions correspond to types, and proofs correspond to inhabitants of those types
Explanation
Under Curry–Howard, a proposition is treated as a type and a proof of that proposition is an inhabitant of the type.
- A
- 23
Under the Curry–Howard interpretation, what represents a false proposition?
- A
A universe containing all lower-level types
- B
An empty type with no inhabitants
- C
A function type with identical domain and codomain
- D
A singleton type with one constructor
Correct answer
BAn empty type with no inhabitants
Explanation
False propositions correspond to empty types, because they have no proof inhabitants.
- A
- 24
What is the purpose of the imax function in the universe rules?
- A
It keeps a Pi proposition in the lowest proposition universe when the codomain is there
- B
It removes all universe levels from dependent function types
- C
It forces every Pi type into the highest universe involved
- D
It makes every universe equal to the immediately lower universe
Correct answer
AIt keeps a Pi proposition in the lowest proposition universe when the codomain is there
Explanation
imax behaves like maximum except that when the relevant codomain universe is 0, it returns 0. This is the impredicative treatment of propositions.
- A
- 25
What problem does convertibility solve in dependent type theory?
- A
It allows definitionally equal types to be used interchangeably in typing judgments
- B
It prevents functions from depending on their arguments
- C
It replaces all ordinary equality proofs with computational reduction
- D
It allows any two propositions to be treated as definitionally equal
Correct answer
AIt allows definitionally equal types to be used interchangeably in typing judgments
Explanation
If types α and β are definitionally equal, an expression typed by α may also be assigned type β.
- A
- 26
Which properties make definitional equality an equivalence relation?
- A
Termination, determinism, and irrelevance
- B
Reflexivity, symmetry, and transitivity
- C
Associativity, commutativity, and distributivity
- D
Injectivity, surjectivity, and monotonicity
Correct answer
BReflexivity, symmetry, and transitivity
Explanation
The convertibility rules include reflexivity, symmetry, and transitivity, the defining properties of an equivalence relation.
- A
- 27
What do compatibility rules for definitional equality express?
- A
Reduction is permitted only when all terms have the same universe level
- B
Only variables can participate in definitional equality
- C
Definitionally equal components produce definitionally equal compound expressions
- D
Every compound expression is definitionally equal to each of its components
Correct answer
CDefinitionally equal components produce definitionally equal compound expressions
Explanation
Compatibility rules state that equality of corresponding parts is preserved when expressions are combined into larger terms.
- A
- 28
What does the eta rule state for functions?
- A
A function is definitionally equal to its domain type
- B
An application is definitionally equal to its function argument alone
- C
Every lambda abstraction is definitionally equal to its bound variable
- D
If e does not depend on x, then λx.ex is definitionally equal to e
Correct answer
DIf e does not depend on x, then λx.ex is definitionally equal to e
Explanation
The eta rule identifies a function with the lambda abstraction that applies it to an argument, provided the function does not depend on that argument.
- A
- 29
What is an inductive specification?
- A
A conversion rule identifying all proofs of a proposition
- B
A disjoint sum of labeled expressions whose labels serve as constructors
- C
A set-theoretic quotient generated by an arbitrary relation
- D
A hierarchy of universes ordered by cardinality
Correct answer
BA disjoint sum of labeled expressions whose labels serve as constructors
Explanation
An inductive specification describes a type through labeled constructor expressions, effectively forming a disjoint sum.
- A
- 30
How are the natural numbers represented as an inductive type?
- A
They have one constructor taking an arbitrary proposition as input
- B
They have a zero constructor and a successor function from naturals to naturals
- C
They have only a successor constructor and no base element
- D
They are defined as the quotient of integers by equality
Correct answer
BThey have a zero constructor and a successor function from naturals to naturals
Explanation
The natural numbers are freely generated by zero and succ:nat→nat.
- A
- 31
What does the natural-number recursor provide?
- A
A result at zero and a step that produces the result at the successor of each number
- B
A function from every proposition to a natural number
- C
A proof that every natural number is definitionally equal to zero
- D
A conversion from every type into the natural-number type
Correct answer
AA result at zero and a step that produces the result at the successor of each number
Explanation
The recursor requires a value at zero and a method for obtaining the value at succ(n) from the value at n.
- A
- 32
What does the recursor's computation rule do at zero?
- A
It replaces zero with its predecessor
- B
It applies the step function without a recursive result
- C
It reduces the recursor applied to zero to the supplied base case
- D
It converts zero into a proof of false
Correct answer
CIt reduces the recursor applied to zero to the supplied base case
Explanation
The recursor at zero reduces to the supplied value for the base case.
- A
- 33
What does the recursor's successor computation rule resemble?
- A
Quotient formation, identifying terms related by a relation
- B
Universe lifting, moving a type to a higher universe
- C
Function extensionality, identifying functions with equal outputs
- D
Primitive recursion, applying the step function to a number and its recursive result
Correct answer
DPrimitive recursion, applying the step function to a number and its recursive result
Explanation
At a successor, the recursor applies the step function to the predecessor and the recursively computed value, just as in primitive recursion.
- A
- 34
How does natural-number recursion support induction?
- A
Replacing successor with equality makes all numbers interchangeable
- B
Removing the zero constructor forces every proposition to be inductive
- C
Choosing a proposition-valued dependent family gives the induction principle
- D
Using a higher universe prevents recursive proofs from being formed
Correct answer
CChoosing a proposition-valued dependent family gives the induction principle
Explanation
When the recursor's family is proposition-valued, it yields the induction principle for natural numbers, corresponding to Peano induction.
- A
- 35
How is the proposition of falsehood represented inductively?
- A
As an inductive type with one constructor for each proof
- B
As an inductive type with exactly one constructor
- C
As a quotient type generated by the total relation
- D
As an inductive type with no constructors
Correct answer
DAs an inductive type with no constructors
Explanation
Bottom, or false, is represented by an inductive proposition with no constructors and therefore no inhabitants.
- A
- 36
How is the proposition of truth represented inductively?
- A
As a type whose constructors are all functions into false
- B
As a universe containing every proposition
- C
As an inductive type with no constructors
- D
As an inductive type with exactly one named constructor
Correct answer
DAs an inductive type with exactly one named constructor
Explanation
True is represented by an inductive type with exactly one constructor, providing one canonical inhabitant.
- A
- 37
How is conjunction represented as an inductive proposition?
- A
Its constructor takes a proof of p and a proof of q to produce a proof of p∧q
- B
It has no constructors unless p and q are definitionally equal
- C
It has two constructors, one for a proof of p and one for a proof of q
- D
Its constructor takes a proof of either p or q to produce a conjunction
Correct answer
AIts constructor takes a proof of p and a proof of q to produce a proof of p∧q
Explanation
Conjunction has an introduction constructor with two arguments: a proof of p and a proof of q.
- A
- 38
How is disjunction represented as an inductive proposition?
- A
It has no constructors because disjunction is not inductive
- B
It has one constructor requiring proofs of both p and q
- C
It has one constructor requiring a proof that p and q are equal
- D
It has one constructor from p and another constructor from q
Correct answer
DIt has one constructor from p and another constructor from q
Explanation
A proof of p produces a proof of p∨q, and a proof of q also produces a proof of p∨q.
- A
- 39
What restriction does strict positivity impose on an inductive definition?
- A
Every recursive occurrence must appear before all nonrecursive arguments
- B
The inductive type must belong to the proposition universe
- C
Every constructor must have exactly one argument
- D
The inductive type being defined cannot occur on the left side of the left side of an arrow
Correct answer
DThe inductive type being defined cannot occur on the left side of the left side of an arrow
Explanation
Strict positivity prevents the inductive type from occurring negatively, including on the left side of a function domain nested on the left.
- A
- 40
Why are non-strictly-positive inductive definitions dangerous?
- A
They make all natural numbers definitionally equal to one another
- B
They can imply an injection from a powerset-like type into itself and contradict Cantor's theorem
- C
They force every proposition to have infinitely many constructors
- D
They prevent the existence of any recursor
Correct answer
BThey can imply an injection from a powerset-like type into itself and contradict Cantor's theorem
Explanation
The prohibited example would yield an injection from the powerset of the bad type into the bad type, violating Cantor's theorem and producing inconsistency.
- A
- 41
How is equality represented as an inductive family?
- A
It has no constructors because equality is not a type
- B
It has a constructor witnessing that every pair of terms is equal
- C
It has a reflexivity constructor witnessing that each x equals itself
- D
It is defined as a quotient of every type by the empty relation
Correct answer
CIt has a reflexivity constructor witnessing that each x equals itself
Explanation
For each x, equality is generated by the constructor refl, which proves x=x.
- A
- 42
What principle does the equality recursor express?
- A
If x is a proof, then every term is a proof
- B
If x=y and a family holds of x, then it can be transported to hold of y
- C
If two types are isomorphic, they are automatically definitionally equal
- D
If x and y have the same type, they are definitionally equal
Correct answer
BIf x=y and a family holds of x, then it can be transported to hold of y
Explanation
The equality recursor gives substitution: equality permits replacing x with y in a dependent family.
- A
- 43
What does proof irrelevance assert in this system?
- A
Every proposition has exactly one proof term syntactically
- B
Any two proofs in the proposition universe are definitionally equal
- C
Proofs cannot be used in dependent types
- D
Only proofs of false are definitionally equal
Correct answer
BAny two proofs in the proposition universe are definitionally equal
Explanation
Proof irrelevance identifies any two elements of the lowest universe of propositions as definitionally equal.
- A
- 44
Why does proof irrelevance conflict with univalence?
- A
Univalence removes function types, while proof irrelevance depends on function types
- B
Univalence eliminates all inductive types, while proof irrelevance requires them
- C
Proof irrelevance makes universe levels cumulative, while univalence forbids universes
- D
Univalence can produce unequal inhabitants of equality, contradicting proof irrelevance
Correct answer
DUnivalence can produce unequal inhabitants of equality, contradicting proof irrelevance
Explanation
With univalence, one can derive equality types having multiple unequal inhabitants, contradicting proof irrelevance or axiom K.
- A
- 45
What is a subsingleton type?
- A
A type with at most one element
- B
A type that cannot be used as a proposition
- C
A type with exactly one constructor but infinitely many elements
- D
A type whose elements all belong to different universes
Correct answer
AA type with at most one element
Explanation
A subsingleton is a type containing at most one element.
- A
- 46
What is small elimination for a proposition?
- A
Any proposition may eliminate into every universe without restriction
- B
A proposition with no constructors may eliminate only into natural numbers
- C
An inductive type outside Prop may eliminate only into Prop
- D
An inductive proposition with multiple inhabitants may eliminate only into propositions
Correct answer
DAn inductive proposition with multiple inhabitants may eliminate only into propositions
Explanation
When an inductive type in Prop has multiple possible inhabitants, its recursor is restricted to elimination into the proposition universe.
- A
- 47
When can a proposition have subsingleton elimination into higher universes?
- A
When its constructors contain no recursive arguments and no target type
- B
When it has infinitely many constructors in different universes
- C
When it is defined using quotient formation rather than induction
- D
When its nonrecursive arguments are propositions or occur appropriately in the result type
Correct answer
DWhen its nonrecursive arguments are propositions or occur appropriately in the result type
Explanation
The stated condition permits certain propositions to eliminate into higher universes; equality is an example of such a subsingleton-eliminating type.
- A
- 48
Why can equality eliminate into any universe despite being a proposition?
- A
Equality is a subsingleton-eliminating inductive family
- B
Equality has infinitely many non-propositional constructors
- C
Equality is implemented as a quotient rather than an inductive family
- D
Equality is not actually located in the proposition universe
Correct answer
AEquality is a subsingleton-eliminating inductive family
Explanation
The content identifies equality as a subsingleton-eliminating type, allowing its recursor to target any universe.
- A
- 49
What does propositional extensionality assert?
- A
If two proofs have the same type, then their propositions are unequal
- B
If two types have the same cardinality, then they are definitionally equal
- C
If two functions have equal domains, then their codomains are equal
- D
If two propositions imply each other, then they are equal
Correct answer
DIf two propositions imply each other, then they are equal
Explanation
Propositional extensionality identifies propositions p and q when there are inhabitants of both p→q and q→p.
- A
- 50
How do quotient types differ from freely generated inductive types?
- A
Quotient types have no constructors or eliminators
- B
Quotient types require every related pair to be definitionally identical
- C
Quotient types can contain only propositions and never ordinary data
- D
Quotient types are generated up to a relation rather than freely generated
Correct answer
DQuotient types are generated up to a relation rather than freely generated
Explanation
A quotient is generated subject to a relation r, unlike an ordinary inductive type, which is freely generated by its constructors.
- A
- 51
What computational interpretation does the axiom of choice have in this presentation?
- A
It converts every quotient into a freely generated inductive type
- B
It guarantees strong normalization for all untyped terms
- C
It has no computational interpretation and supports classical mathematics
- D
It directly evaluates every existential proof into a concrete data value
Correct answer
CIt has no computational interpretation and supports classical mathematics
Explanation
The content states that the choice principle has no computational interpretation and is included to support classical mathematics.
- A
- 52
What logical consequence is obtained from the axiom of choice in this system?
- A
The law of excluded middle, yielding fully classical logic
- B
The rejection of proof irrelevance
- C
The elimination of all quotient types
- D
The failure of propositional extensionality
Correct answer
AThe law of excluded middle, yielding fully classical logic
Explanation
The presentation states that choice implies the law of excluded middle, making the logic fully classical.
- A
- 53
What is the central issue behind the undecidability result for Lean's type system?
- A
The system has no typing rules for applications
- B
The interaction of features such as subsingleton elimination can encode nondecidable behavior in definitional equality
- C
Universe levels are always finite and therefore cannot be compared
- D
The lambda calculus lacks confluence in every well-typed context
Correct answer
BThe interaction of features such as subsingleton elimination can encode nondecidable behavior in definitional equality
Explanation
The presentation constructs examples using recursive subsingleton elimination that make definitional equality depend on nondecidable propositions.
- A
- 54
What does the accessibility type acc express?
- A
An element is accessible when all elements smaller than it are accessible
- B
An element is accessible only when it is equal to zero
- C
An element is accessible when it belongs to the proposition universe
- D
An element is accessible when it has infinitely many predecessors
Correct answer
AAn element is accessible when all elements smaller than it are accessible
Explanation
Accessibility is inductively generated by the clause that x is accessible if every smaller element is accessible, expressing well-foundedness.
- A
- 55
Why is the accessibility type important in the undecidability construction?
- A
It is recursive yet permits subsingleton elimination into arbitrary types
- B
It has no constructor and therefore cannot be eliminated
- C
It is nonrecursive and therefore prevents all unfolding
- D
It belongs to a higher universe and cannot represent propositions
Correct answer
AIt is recursive yet permits subsingleton elimination into arbitrary types
Explanation
Accessibility has a recursive constructor and is nevertheless subsingleton eliminating, allowing repeated reductions without the usual computational cost.
- A
- 56
What behavior does the constructed recursive function exhibit on a decidable proposition P(n)?
- A
It advances only when P(n) fails and returns zero when P(n) holds
- B
It immediately returns a proof of every P(n)
- C
It always returns the current number regardless of P(n)
- D
It advances to the next number when P(n) holds and returns zero when P(n) fails
Correct answer
DIt advances to the next number when P(n) holds and returns zero when P(n) fails
Explanation
The function proceeds to the next natural number when the proposition is true and reduces to zero at the first failure.
- A
- 57
Why does the accessibility construction threaten decidability of definitional equality?
- A
It makes application typing depend only on syntax rather than reduction
- B
Whether two terms are definitionally equal can encode whether a proposition holds for all natural numbers
- C
It makes every reduction sequence terminate in exactly one step
- D
It removes all distinctions between terms in different universes
Correct answer
BWhether two terms are definitionally equal can encode whether a proposition holds for all natural numbers
Explanation
The reduction behavior can encode a proposition such as whether P(n) holds for every n, a property that may be undecidable.
- A
- 58
What is the relationship between Lean's algorithmic typing judgment and the ideal typing rules?
- A
The algorithmic judgment is an underapproximation and may reject terms that are ideally well typed
- B
The algorithmic judgment is a complete decision procedure for the ideal rules
- C
The algorithmic judgment is deliberately broader than the ideal typing relation
- D
The algorithmic judgment accepts every term accepted by syntax alone
Correct answer
AThe algorithmic judgment is an underapproximation and may reject terms that are ideally well typed
Explanation
Lean uses an underapproximation that may fail to recognize some ideal definitional equalities in order to remain computationally manageable.
- A
- 59
Why can Lean's practical definitional equality relation fail to be transitive?
- A
Universe levels cannot be compared by any typing rule
- B
Beta reduction is inherently nonconfluent in Lean
- C
Proof irrelevance makes symmetry impossible
- D
Transitivity would recover the undecidable ideal relation that the algorithmic procedure approximates
Correct answer
DTransitivity would recover the undecidable ideal relation that the algorithmic procedure approximates
Explanation
The algorithmic relation sacrifices transitivity so that it can remain an underapproximation rather than recovering the undecidable full relation.
- A
- 60
How can identity functions sometimes help Lean recognize a desired conversion?
- A
They break one difficult conversion into smaller conversion steps the algorithm can discover
- B
They prevent all reduction from occurring inside the expression
- C
They erase all types before the expression is checked
- D
They make unrelated types definitionally equal by axiom
Correct answer
AThey break one difficult conversion into smaller conversion steps the algorithm can discover
Explanation
Inserting identity functions at suitable types can expose smaller conversion steps instead of requiring Lean to find one difficult transitive jump.
- A
- 61
What is subject reduction?
- A
The property that reduction preserves typing
- B
The property that every function has a normal form
- C
The property that every type has a unique universe
- D
The property that every proposition has at most one proof
Correct answer
AThe property that reduction preserves typing
Explanation
Subject reduction means that if a term is well typed, reducing it preserves its typing.
- A
- 62
What is the status of subject reduction in the described Lean system?
- A
The presentation states that subject reduction is the main reason all terms normalize
- B
The presentation states that Lean does not have subject reduction for the relevant evaluation behavior
- C
The presentation states that subject reduction follows automatically from choice
- D
The presentation states that subject reduction is identical to proof irrelevance
Correct answer
BThe presentation states that Lean does not have subject reduction for the relevant evaluation behavior
Explanation
The discussion explicitly states that Lean does not have subject reduction in the relevant setting, especially when identity wrappers and unusual reductions are involved.
- A
- 63
How are types and terms interpreted in the set-theoretic model described?
- A
Types are interpreted as sets and elements of types as elements of those sets
- B
Types are interpreted as syntax trees and elements as universe levels
- C
Types are interpreted as functions and elements as reduction sequences
- D
Types are interpreted as propositions only and elements as constructors
Correct answer
ATypes are interpreted as sets and elements of types as elements of those sets
Explanation
The model interprets types as sets and terms inhabiting those types as elements of the corresponding sets.
- A
- 64
What does the set-theoretic model assign to the proposition universe under the stated classical assumptions?
- A
A distinct set for every proof of every proposition
- B
A universal set containing all types and proofs
- C
The natural numbers for false and the integers for true
- D
The empty set for false and a singleton set for true
Correct answer
DThe empty set for false and a singleton set for true
Explanation
Because of classical axioms and proof irrelevance, the proposition universe is modeled with two propositions: the empty set and a singleton set.
- A
- 65
What kind of set-theoretic objects are used to model the larger universes?
- A
Ordinary subsets of the proposition universe only
- B
Quotients associated with the law of excluded middle
- C
Finite sets associated with successor natural numbers
- D
Grothendieck universes associated with inaccessible cardinals
Correct answer
DGrothendieck universes associated with inaccessible cardinals
Explanation
The larger universes must be closed under the relevant type constructions, so they are modeled using Grothendieck universes, corresponding to inaccessible cardinals.
- A
- 66
What does the soundness theorem establish for a typing judgment e:α?
- A
The interpretation of e is an element of the interpretation of α
- B
The type α must be a proposition in U0
- C
The syntax of e is identical to the syntax of α
- D
The term e must reduce to a constructor in one step
Correct answer
AThe interpretation of e is an element of the interpretation of α
Explanation
Soundness states that if e has type α, then the interpreted term belongs to the interpreted type.
- A
- 67
What does soundness imply about definitional equality in the model?
- A
Definitionally equal expressions cannot be interpreted in any universe
- B
Definitionally equal expressions are interpreted only as propositions
- C
Definitionally equal expressions receive the same ordinary semantic interpretation
- D
Definitionally equal expressions must have different set-theoretic interpretations
Correct answer
CDefinitionally equal expressions receive the same ordinary semantic interpretation
Explanation
A definitional equality is mapped to an ordinary equality in the semantic interpretation.
- A
- 68
What does the unique typing theorem state?
- A
If an expression has two types, those types are definitionally equal
- B
Every type has exactly one inhabitant
- C
Every universe contains exactly one type
- D
Every expression has exactly one syntactic representation
Correct answer
AIf an expression has two types, those types are definitionally equal
Explanation
Unique typing says that if e has both types α and β, then α and β are definitionally equal.
- A
- 69
Why is unique typing useful for the semantic model?
- A
It replaces the need for any interpretation of function types
- B
It proves that all propositions are inhabited
- C
It ensures that a type has a well-defined universe level
- D
It allows arbitrary non-strictly-positive inductive definitions
Correct answer
CIt ensures that a type has a well-defined universe level
Explanation
The model needs to know which universe interprets a type, and unique typing ensures that the universe assignment is not ambiguous.
- A
- 70
Why is the exact Lean-style unique typing result complicated in Coq?
- A
Coq uses only intuitionistic logic and no universe hierarchy
- B
Coq lacks dependent types entirely
- C
Coq has universe cumulativity, allowing types to move through a subtyping relation
- D
Coq does not support inductive types or equality
Correct answer
CCoq has universe cumulativity, allowing types to move through a subtyping relation
Explanation
Universe cumulativity in Coq means that a type may be viewed at related universe levels without those levels being definitionally equal.
- A
- 71
What is the strongest general way described for proving that two types are unequal?
- A
Show that their definitions use different syntax
- B
Show that they have different cardinalities
- C
Show that their constructors have different names
- D
Show that they are not definitionally identical as written
Correct answer
BShow that they have different cardinalities
Explanation
The presentation says that cardinality is the main way to distinguish types semantically: equal types must have the same cardinality.
- A
- 72
What can be proved about two separately defined natural-number types with identical constructors?
- A
They can be shown isomorphic, but their inequality may not be provable
- B
They cannot be related because inductive types have no isomorphisms
- C
They are necessarily definitionally equal in every context
- D
They must be proved unequal because their declarations differ
Correct answer
AThey can be shown isomorphic, but their inequality may not be provable
Explanation
The content states that even identical copies such as nat and nat′ may not be provably unequal; one can prove that they are isomorphic.
- A
- 73
What does Lean's virtual machine do with casts during evaluation?
- A
It converts every cast into a quotient constructor
- B
It rejects every term containing a cast before evaluation
- C
It ignores casts rather than evaluating their recursors down to reflexivity
- D
It proves that the source and target types are definitionally equal
Correct answer
CIt ignores casts rather than evaluating their recursors down to reflexivity
Explanation
The VM sidesteps some reduction issues by ignoring casts during evaluation instead of reducing them to a reflexivity proof.
- A
- 74
What is the purpose of a type-erasure map?
- A
It replaces every term with a proof of its type
- B
It maps every universe to the proposition universe
- C
It removes types from terms while preserving the result of computation
- D
It changes ordinary equality into heterogeneous equality
Correct answer
CIt removes types from terms while preserving the result of computation
Explanation
A type-erasure map removes type information and is intended to preserve computational results.
- A
- 75
Why would a theory of type erasure be useful for VM overrides?
- A
It would eliminate the need for inductive recursors
- B
It would prove that all VM definitions are definitionally equal
- C
It would make the type system intuitionistic
- D
It could help show that replacing one definition with another preserves computation
Correct answer
DIt could help show that replacing one definition with another preserves computation
Explanation
A formal erasure theory could establish when a VM replacement is valid without changing the result of evaluation.
- A
- 76
What is the proposed trade-off between decidability and a more complete reduction procedure?
- A
A semi-decision procedure may eventually find equal terms but may fail to halt
- B
Adding more reduction always makes the relation decidable and transitive
- C
Removing all reduction rules guarantees both completeness and decidability
- D
A complete decision procedure can always preserve every rule without limitation
Correct answer
AA semi-decision procedure may eventually find equal terms but may fail to halt
Explanation
A more complete reduction can act as a semi-decision procedure: it eventually succeeds when terms are definitionally equal but may not terminate otherwise.
- A
- 77
What change was suggested as a relatively less damaging way to recover decidability?
- A
Allow every inductive definition regardless of positivity
- B
Remove all universe levels from the type theory
- C
Replace all dependent types with untyped lambda terms
- D
Restrict subsingleton elimination so that recursive types such as accessibility cannot use it
Correct answer
DRestrict subsingleton elimination so that recursive types such as accessibility cannot use it
Explanation
The discussion suggests restricting subsingleton elimination, potentially excluding recursive types such as acc while retaining it for nonrecursive equality-like cases.
- A
- 78
What is one motivation for separating Prop from the universe U0?
- A
It could avoid special universe rules such as imax and simplify the hierarchy
- B
It would force every proof to have a distinct semantic value
- C
It would eliminate universe polymorphism from definitions
- D
It would make all propositions computationally relevant
Correct answer
AIt could avoid special universe rules such as imax and simplify the hierarchy
Explanation
Separating Prop from U0 could avoid the special behavior that arises when propositions are identified with the lowest universe.
- A
- 79
Why might separating Prop from the other universes cause practical difficulties?
- A
It would make ordinary function types impossible to express
- B
Universe-parametric definitions can behave as propositions in some instances and ordinary types in others
- C
It would prevent all definitions from being polymorphic over universe levels
- D
It would eliminate the distinction between proofs and data
Correct answer
BUniverse-parametric definitions can behave as propositions in some instances and ordinary types in others
Explanation
Universe variables and expressions involving them allow definitions to be parametric over levels and sometimes to inhabit Prop, causing the distinction to propagate through the language.
- A
- 80
What practical benefit can universe parametricity provide?
- A
It removes the need for any constructors in inductive types
- B
It makes all universe levels definitionally equal
- C
It can reduce duplication by allowing one definition to work across universe levels
- D
It ensures that every proposition has multiple computational proofs
Correct answer
CIt can reduce duplication by allowing one definition to work across universe levels
Explanation
Universe-parametric definitions can avoid writing separate versions for different universe levels or for propositions versus ordinary data.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.