instruction
stringlengths
80
13k
completion
stringlengths
225
5.71k
conversations
listlengths
2
2
Is there a Proof assistant which also is an esoteric programming language? If so, then how many there are, approximately?
Yes, there are proof assistants that also function as esoteric programming languages. An example of this is Coq, which is primarily a proof assistant but has been used in various esoteric programming language contexts. Another example is Agda, which is similar in that it can be used for both proof development and progr...
[ { "from": "human", "value": "Is there a Proof assistant which also is an esoteric programming language? If so, then how many there are, approximately?\n" }, { "from": "gpt", "value": "Yes, there are proof assistants that also function as esoteric programming languages. An example of this is Coq,...
In proof mode, if I know an expression e of type T, I can write pose foo : T := e to add foo := e : T as a hypothesis. Often, I don't care about that foo is the same as e, I only care that foo has type T, so in the hypotheses list I would like to see foo : T instead of foo := e : T to reduce mental clutter. How can I d...
In proof mode, if you want to add a hypothesis that only states the type of a term without tying it to an explicit definition, you can use the `assert` tactic instead of `pose`. The `assert` tactic allows you to introduce a hypothesis that has a specified type without implying that it is equal to a particular expressio...
[ { "from": "human", "value": "In proof mode, if I know an expression e of type T, I can write pose foo : T := e to add foo := e : T as a hypothesis. Often, I don't care about that foo is the same as e, I only care that foo has type T, so in the hypotheses list I would like to see foo : T instead of foo := e ...
Is there a Proof assistant which also is an esoteric programming language? If so, then how many there are, approximately?
Yes, there are a few proof assistants that also qualify as esoteric programming languages. The most notable examples include: 1. **Coq**: While primarily a proof assistant, it has been used in a playful manner, and some implementations have elements that can be considered esoteric. 2. **Agda**: Similar to Coq, Agda i...
[ { "from": "human", "value": "Is there a Proof assistant which also is an esoteric programming language? If so, then how many there are, approximately?\n" }, { "from": "gpt", "value": "Yes, there are a few proof assistants that also qualify as esoteric programming languages. The most notable exam...
If I had a module declared as follows in file A.v: Section A. Context { : Set}. Inductive abt := Abt_leaf (x : ) | Abt_node. End A. And in another file, B.v, I had: Require Import A. Definition := nat. Inductive typ := Tpe_num | Typ_str. Definition typ_to_abt (t : typ) : abt (* @abt *) := Abt_node. The implicit...
To let Coq know that you always want to use the implicit argument of the type `abt` in file `B.v`, you can set the implicit arguments in your current context. Coq allows you to manage implicit arguments using the `Arguments` command, which can specify the default behavior for arguments in a given context. In your `B.v...
[ { "from": "human", "value": "If I had a module declared as follows in file A.v:\nSection A.\n Context { : Set}.\n Inductive abt := Abt_leaf (x : ) | Abt_node.\nEnd A.\n\nAnd in another file, B.v, I had:\nRequire Import A.\nDefinition := nat.\nInductive typ := Tpe_num | Typ_str.\nDefinition typ_to_abt (t ...
There is a function which is usually called range in other languages: it takes a natural n, and returns a list of naturals [0,1,2,...,n-1]. Does the Coq standard library have this function, and if so, what is it called?
Yes, the Coq standard library includes a function that behaves like the `range` function found in other programming languages. This function is called `seq`. It is part of the `Coq.Init.Nat` module and can be used to generate a list of natural numbers from `0` to `n-1`. The syntax for using the `seq` function is as f...
[ { "from": "human", "value": "There is a function which is usually called range in other languages: it takes a natural n, and returns a list of naturals [0,1,2,...,n-1]. Does the Coq standard library have this function, and if so, what is it called?\n" }, { "from": "gpt", "value": "Yes, the Coq s...
As mentioned in another question, the way that VSCode and other editors implement unicode characters that cannot be typed directly from most keyboards is an editor feature. As such, different editors could do it differently, so that for instance, $\varphi$ and $\phi$ could be entered as \varphi, \phi, the other way aro...
The handling of Unicode characters in text editors is not governed by a single official standard or recommendation; rather, it is typically determined by the design choices made by the developers of each editor. Different text editors, IDEs, and programming environments adopt their own conventions and methods for enter...
[ { "from": "human", "value": "As mentioned in another question, the way that VSCode and other editors implement unicode characters that cannot be typed directly from most keyboards is an editor feature.\nAs such, different editors could do it differently, so that for instance, $\\varphi$ and $\\phi$ could be...
Since Agda is software and sometimes software has breaking changes, e.g. Python 2 vs Python 3 (ref), does Agda have any significant breaking changes that one would need to be concerned about? Also see related question: When installing Agda does one have to be attentive to a version?
Yes, Agda, like many programming languages and systems, can introduce breaking changes between major versions. While it is not as common as in some other languages, there have been instances where updates to Agda included changes that might affect existing codebases. ### Significant Breaking Changes: 1. **Syntax Chang...
[ { "from": "human", "value": "Since Agda is software and sometimes software has breaking changes, e.g. Python 2 vs Python 3 (ref), does Agda have any significant breaking changes that one would need to be concerned about?\n\nAlso see related question:\nWhen installing Agda does one have to be attentive to a ...
As mentioned in another question, the way that VSCode and other editors implement unicode characters that cannot be typed directly from most keyboards is an editor feature. As such, different editors could do it differently, so that for instance, $\varphi$ and $\phi$ could be entered as \varphi, \phi, the other way aro...
There is no official, universally accepted standard for how text editors should implement the input of Unicode characters that cannot be easily typed from most keyboards. Different editors and development environments have their own conventions and features, often tailored to specific use cases or user needs. However,...
[ { "from": "human", "value": "As mentioned in another question, the way that VSCode and other editors implement unicode characters that cannot be typed directly from most keyboards is an editor feature.\nAs such, different editors could do it differently, so that for instance, $\\varphi$ and $\\phi$ could be...
There was already a question here of this type but I would like to ask more generally: If I see some strange unicode symbols being used in Lean, is there a recommended way to find out how to type them, and finding out what they mean, other than asking here at Proof Assistants or at the Zulip chat? Is the best source th...
If you encounter strange Unicode symbols in Lean and want to understand how to type them and their meanings, here are some recommended approaches beyond asking in forums: 1. **Official Documentation**: The most reliable source is the official Lean documentation. Lean 3 and Lean 4 have their own documentation that ofte...
[ { "from": "human", "value": "There was already a question here of this type but I would like to ask more generally:\nIf I see some strange unicode symbols being used in Lean, is there a recommended way to find out how to type them, and finding out what they mean, other than asking here at Proof Assistants o...
Let's say I have a simple structure structure foo : Type := (a : ℕ) (b : list (fin a)) when defining the field b I can reference a. If I try to define a function to construct new foo's like so def bar (p : foo) : foo := { a := p.a + 1, b := list (fin a) } where I tried to reference the a I constructed on the fi...
In Lean, when you are constructing a new instance of a structure, you need to refer to the fields of the existing structure through the instance variable itself. In your case, when you want to access the field `a` of the structure `foo`, you should use `p.a` instead of just `a`. Additionally, when you are constructin...
[ { "from": "human", "value": "Let's say I have a simple structure\nstructure foo : Type :=\n (a : ℕ)\n (b : list (fin a))\n\nwhen defining the field b I can reference a. If I try to define a function to construct new foo's like so\ndef bar (p : foo) : foo :=\n{ a := p.a + 1,\n b := list (fin a)\n}\n\nwher...
If I had a module declared as follows in file A.v: Section A. Context { : Set}. Inductive abt := Abt_leaf (x : ) | Abt_node. End A. And in another file, B.v, I had: Require Import A. Definition := nat. Inductive typ := Tpe_num | Typ_str. Definition typ_to_abt (t : typ) : abt (* @abt *) := Abt_node. The implicit...
To make Coq infer the implicit arguments for the `abt` type in your file `B.v`, you can use the `Set` as an implicit argument and provide an explicit type for `abt` by making `abt` a global definition with respect to some type in `B.v`. Here's how you can achieve that: 1. First, modify the context in `A.v` so that it ...
[ { "from": "human", "value": "If I had a module declared as follows in file A.v:\nSection A.\n Context { : Set}.\n Inductive abt := Abt_leaf (x : ) | Abt_node.\nEnd A.\n\nAnd in another file, B.v, I had:\nRequire Import A.\nDefinition := nat.\nInductive typ := Tpe_num | Typ_str.\nDefinition typ_to_abt (t ...
Andrea Vezzosi said Cubical Agda made cubical subtyping coercion-based (inS and outS) because it's a bad idea to introduce more subtyping relations which complicates the system. Also Agda did not have cumulative universes (it is added now). So does Agda support any subtyping relations? Without using rewriting and cumul...
In Agda, subtyping is not natively supported in the same way as in some other languages that have explicit subtyping relations. Instead, Agda uses a form of type inference and implicit coercions primarily based on dependent types. However, while Agda doesn't have a traditional subtyping system, there are ways to simu...
[ { "from": "human", "value": "Andrea Vezzosi said Cubical Agda made cubical subtyping coercion-based (inS and outS) because it's a bad idea to introduce more subtyping relations which complicates the system. Also Agda did not have cumulative universes (it is added now).\nSo does Agda support any subtyping re...
Every community can have inside jokes among it, and April Fool’s jokes are a common variety, but proof assistants are particularly susceptible to April Fool’s jokes. They have strong guarantees of correctness so one could claim both that these claims are wrong or that one found irrefutable proof of something crazy. Mo...
Sure! Here's a lighthearted April Fool's joke idea related to proof assistants: **The "Infinite Proof" Feature Announcement** Announce the release of a new feature in a popular proof assistant (like Coq, Lean, or Agda) that allows users to write "infinite proofs"—proofs that contain no finite steps but still somehow ...
[ { "from": "human", "value": "Every community can have inside jokes among it, and April Fool’s jokes are a common variety, but proof assistants are particularly susceptible to April Fool’s jokes. They have strong guarantees of correctness so one could claim both that these claims are wrong or that one found ...
How would you explain to a beginner in simple terms, what a Proof Assistant is?
A Proof Assistant is a type of computer software that helps people create and check mathematical proofs. Think of it as a very smart calculator for logic and reasoning. When you make a mathematical argument, you need to show that your conclusions are true based on certain rules. A Proof Assistant helps you write down...
[ { "from": "human", "value": "How would you explain to a beginner in simple terms, what a Proof Assistant is?\n" }, { "from": "gpt", "value": "A Proof Assistant is a type of computer software that helps people create and check mathematical proofs. Think of it as a very smart calculator for logic ...
Every community can have inside jokes among it, and April Fool’s jokes are a common variety, but proof assistants are particularly susceptible to April Fool’s jokes. They have strong guarantees of correctness so one could claim both that these claims are wrong or that one found irrefutable proof of something crazy. Mo...
Here’s a classic April Fool’s joke that could be made about proof assistants: **Joke:** Announce the release of a new proof assistant that utilizes “AI-driven intuition” to automatically generate proofs without user intervention. The assistant claims to have solved some of the hardest problems in mathematics using an ...
[ { "from": "human", "value": "Every community can have inside jokes among it, and April Fool’s jokes are a common variety, but proof assistants are particularly susceptible to April Fool’s jokes. They have strong guarantees of correctness so one could claim both that these claims are wrong or that one found ...
In Ulf Norell's PhD thesis, which is considered the standard reference of the Agda 2 language, the universes are cumulative, say, Set i is not just an instance of Set (suc i), but also a subtype of it. However, in the implementation of Agda, this is not true. We only have the "instance of" relation, not the subtype rel...
Cumulative universes in type theory allow for a hierarchy of types where each universe can contain all lower universes. This can be beneficial in terms of expressiveness and flexibility, as you noted. However, there are several reasons why the designers of Agda may have opted to implement a simpler universe system init...
[ { "from": "human", "value": "In Ulf Norell's PhD thesis, which is considered the standard reference of the Agda 2 language, the universes are cumulative, say, Set i is not just an instance of Set (suc i), but also a subtype of it.\nHowever, in the implementation of Agda, this is not true. We only have the \...
Every community can have inside jokes among it, and April Fool’s jokes are a common variety, but proof assistants are particularly susceptible to April Fool’s jokes. They have strong guarantees of correctness so one could claim both that these claims are wrong or that one found irrefutable proof of something crazy. Mo...
Here's a classic joke that plays on the common experience of proof assistants: **"Introducing 'Proof Assistant 2.0': Now with built-in telepathy!"** The joke claims that the latest version of a proof assistant can automatically understand and implement the user's thoughts without needing any formal input or commands....
[ { "from": "human", "value": "Every community can have inside jokes among it, and April Fool’s jokes are a common variety, but proof assistants are particularly susceptible to April Fool’s jokes. They have strong guarantees of correctness so one could claim both that these claims are wrong or that one found ...
Jon Sterling said Conor McBride's universe polymorphism proposal to be: seems to have worked well in Swedish experiments I wonder, what does "Swedish" mean here? What kind of type theory or Proof Assistant practice is considered Swedish? Are there other styles (my guess would be French, but I'm unsure)?
In the context of type theory and proof assistants, the term "Swedish" often refers to a particular approach to type systems and polymorphism that is associated with the work of researchers such as Conor McBride and his contributions to functional programming and dependently typed programming. Specifically, the "Swedi...
[ { "from": "human", "value": "Jon Sterling said Conor McBride's universe polymorphism proposal to be:\n\nseems to have worked well in Swedish experiments\n\nI wonder, what does \"Swedish\" mean here? What kind of type theory or Proof Assistant practice is considered Swedish? Are there other styles (my guess ...
If I had a module declared as follows in file A.v: Section A. Context { : Set}. Inductive abt := Abt_leaf (x : ) | Abt_node. End A. And in another file, B.v, I had: Require Import A. Definition := nat. Inductive typ := Tpe_num | Typ_str. Definition typ_to_abt (t : typ) : abt (* @abt *) := Abt_node. The implicit...
To inform Coq that you want to use the inductive type `abt` with the implicit arguments globally in file `B.v`, you can use the `Set Implicit Arguments` command. This command tells Coq to automatically infer implicit arguments for the definitions and constructions in the module. Here’s how you can modify your file `B....
[ { "from": "human", "value": "If I had a module declared as follows in file A.v:\nSection A.\n Context { : Set}.\n Inductive abt := Abt_leaf (x : ) | Abt_node.\nEnd A.\n\nAnd in another file, B.v, I had:\nRequire Import A.\nDefinition := nat.\nInductive typ := Tpe_num | Typ_str.\nDefinition typ_to_abt (t ...
If I had a module declared as follows in file A.v: Section A. Context { : Set}. Inductive abt := Abt_leaf (x : ) | Abt_node. End A. And in another file, B.v, I had: Require Import A. Definition := nat. Inductive typ := Tpe_num | Typ_str. Definition typ_to_abt (t : typ) : abt (* @abt *) := Abt_node. The implicit...
To avoid having to explicitly specify the implicit arguments of the `abt` inductive type in file `B.v`, you can use the `Arguments` command to set the implicit arguments globally for the `abt` type. This can be done in file `A.v` where you define `abt`. By declaring the arguments as implicit, you will be able to use th...
[ { "from": "human", "value": "If I had a module declared as follows in file A.v:\nSection A.\n Context { : Set}.\n Inductive abt := Abt_leaf (x : ) | Abt_node.\nEnd A.\n\nAnd in another file, B.v, I had:\nRequire Import A.\nDefinition := nat.\nInductive typ := Tpe_num | Typ_str.\nDefinition typ_to_abt (t ...
The following snippet can't pass type checking. From mathcomp Require Import choice. Definition exfn (A:countType) := false. (* Fail *) Check exfn nat. Failed with message: The term "nat" has type "Set" while it is expected to have type "countType". How to instantiate A with nat properly?
In Coq's Mathematical Components library (MathComp), `countType` is a type class that represents types with a countable structure. The natural numbers (`nat`) do not directly have an instance of `countType` in the way you might be expecting. To make `nat` work with the `countType` type class, you can use `nat` as a `c...
[ { "from": "human", "value": "The following snippet can't pass type checking.\nFrom mathcomp Require Import choice.\nDefinition exfn (A:countType) := false.\n(* Fail *) Check exfn nat.\n\nFailed with message: The term \"nat\" has type \"Set\" while it is expected to have type \"countType\".\nHow to instantia...
I am learning Coq with ssreflect. Just to understand things, I've proved forall a b : bool, a == b -> a = b but I can't figure out how to prove forall m n : nat, m == n -> m = n. I've tried using the elim tactic first on m, then on n, but in the end I was left with a subgoal I couldn't prove. I've tried destruct m and ...
To prove the lemma `eqn_impl_eq` that states for all natural numbers `m` and `n`, if `m == n` (using the equality operator from the `mathcomp` library) implies that `m = n` (the standard Coq equality), you can leverage the structural properties of natural numbers in Coq. Here's how you can complete the proof: 1. Star...
[ { "from": "human", "value": "I am learning Coq with ssreflect. Just to understand things, I've proved forall a b : bool, a == b -> a = b but I can't figure out how to prove forall m n : nat, m == n -> m = n. I've tried using the elim tactic first on m, then on n, but in the end I was left with a subgoal I c...
Say I'm formalizing something in group theory, and I'm working with some action $\cdot$ of $(G, +)$ on a set. In my math textbook, the identity of $\cdot$ is explicitly mentioned once (if that), and then left implicit. In my formalization, do I have to constantly keep specifying $(G, \cdot)$, or can I temporarily set $...
In formalizing a concept in group theory, it is common and acceptable to adopt a shorthand notation for a group action, provided that you have previously defined what the action is. This is particularly true in mathematical writing, where once you establish the context—such as specifying that \( G \) is a group acting ...
[ { "from": "human", "value": "Say I'm formalizing something in group theory, and I'm working with some action $\\cdot$ of $(G, +)$ on a set. In my math textbook, the identity of $\\cdot$ is explicitly mentioned once (if that), and then left implicit. In my formalization, do I have to constantly keep specifyi...
The most well-known tutorials/learning materials, including Book 1, Chapter 2 of Software Foundations for Coq and the Natural Number Game for Lean, use natural numbers to introduce induction. But there are multiple complaints by new learners that having to prove trivial facts of natural numbers via induction feels unin...
Yes, there has been increasing recognition within the community that starting with natural numbers for teaching induction can be intimidating for new learners. As a result, several alternative approaches and tutorials have emerged that use different structures to introduce inductive reasoning and proofs. One such appr...
[ { "from": "human", "value": "The most well-known tutorials/learning materials, including Book 1, Chapter 2 of Software Foundations for Coq and the Natural Number Game for Lean, use natural numbers to introduce induction. But there are multiple complaints by new learners that having to prove trivial facts of...
Is there a library (for any proof assistant) which provides formalized definitions of unsolved problems? To clarify, I mean some collection that correctly defines unsolved problems in the language of a proof assistant, without attempting to provide any solutions. By unsolved problems, I mean one which haven't been solv...
Yes, there are libraries and formalizations in proof assistants that specifically address unsolved problems in mathematics. While these libraries do not attempt to provide solutions, they define the problems formally within the framework of the proof assistant. Here are some notable examples: 1. **Lean**: The Lean the...
[ { "from": "human", "value": "Is there a library (for any proof assistant) which provides formalized definitions of unsolved problems? To clarify, I mean some collection that correctly defines unsolved problems in the language of a proof assistant, without attempting to provide any solutions.\nBy unsolved pr...
In proof mode, if I know an expression e of type T, I can write pose foo : T := e to add foo := e : T as a hypothesis. Often, I don't care about that foo is the same as e, I only care that foo has type T, so in the hypotheses list I would like to see foo : T instead of foo := e : T to reduce mental clutter. How can I d...
In Coq, if you want to introduce a hypothesis that merely asserts the type of an expression without binding the expression itself to a name in a way that reflects its equality, you can use the `assert` tactic or the `pose proof` tactic without associating the expression directly with the hypothesis. Here’s how you can...
[ { "from": "human", "value": "In proof mode, if I know an expression e of type T, I can write pose foo : T := e to add foo := e : T as a hypothesis. Often, I don't care about that foo is the same as e, I only care that foo has type T, so in the hypotheses list I would like to see foo : T instead of foo := e ...
Some time ago I asked this question on Stack Overflow but got no answer: https://stackoverflow.com/questions/60521384/tracing-tactics-in-isabelle Section 9.4 The Classical Reasoner of the Isar Reference Manual writes: The tactics can be traced, and their components can be called directly; in this manner, any proof can...
To trace the classical reasoner in Isabelle, you can use the `trace_tactic` command available in the interactive environment. Although the specific details about tracing the classical reasoner may not be explicitly documented, you can generally apply a few strategies to achieve this. Here’s how you can start tracing t...
[ { "from": "human", "value": "Some time ago I asked this question on Stack Overflow but got no answer:\nhttps://stackoverflow.com/questions/60521384/tracing-tactics-in-isabelle\nSection 9.4 The Classical Reasoner of the Isar Reference Manual writes:\n\nThe tactics can be traced, and their components can be c...
What was the first proof assistant? What was it used for? When and by who was it created? Is it still used today? And what was its purpose?
The first proof assistant is generally considered to be **"Automath,"** which was developed in the late 1960s and early 1970s by **Nicolas Bourbaki** (a pseudonymous group of mathematicians) and further developed by **Adrian K. (Tony) M. Feigenbaum** and others, particularly at the University of Amsterdam by **Jan von ...
[ { "from": "human", "value": "What was the first proof assistant? What was it used for? When and by who was it created? Is it still used today? And what was its purpose?\n" }, { "from": "gpt", "value": "The first proof assistant is generally considered to be **\"Automath,\"** which was developed ...
This is a related question to Is there a consolidated or partial list noting the use of quasiquotation with provers? for which it seems there is no answer. However as there might be an answer some day am leaving that question and asking this question that others are dancing with in the comments of that question. As t...
Here’s a list of theorem provers and proof assistants that utilize systems of quoting or quasiquotation influenced by Lisp: 1. **Coq**: Coq employs a system of quotations, particularly in its metaprogramming extensions such as Ltac. Ltac allows for quoted tactics, which can be manipulated and executed dynamically, som...
[ { "from": "human", "value": "This is a related question to\n\nIs there a consolidated or partial list noting the use of quasiquotation with provers?\n\nfor which it seems there is no answer. However as there might be an answer some day am leaving that question and asking this question that others are dancin...
In proof mode, if I know an expression e of type T, I can write pose foo : T := e to add foo := e : T as a hypothesis. Often, I don't care about that foo is the same as e, I only care that foo has type T, so in the hypotheses list I would like to see foo : T instead of foo := e : T to reduce mental clutter. How can I d...
In proof mode, you can use the `pose` tactic in a slightly different way to achieve what you're looking for. Instead of using the regular `pose` tactic which binds the expression directly to a name while showing its definition, you can use the `assert` tactic instead. This will allow you to state that something of a ce...
[ { "from": "human", "value": "In proof mode, if I know an expression e of type T, I can write pose foo : T := e to add foo := e : T as a hypothesis. Often, I don't care about that foo is the same as e, I only care that foo has type T, so in the hypotheses list I would like to see foo : T instead of foo := e ...
My understanding of most automated theorem provers (which is possibly an incorrect understanding!) is that they start with some premises stored as unprocessed statements, and repeatedly select one to "process", generating different consequences and substitutions. Because the total number of statements is so big, they r...
Your understanding of automated theorem provers (ATPs) is largely correct; they typically start with a set of axioms and conjectures, systematically exploring the implications of these statements using inference rules. However, there are several factors that contribute to their limitations in comparison to human mathem...
[ { "from": "human", "value": "My understanding of most automated theorem provers (which is possibly an incorrect understanding!) is that they start with some premises stored as unprocessed statements, and repeatedly select one to \"process\", generating different consequences and substitutions. Because the t...
I have this function: Definition bexp x y := bexp_r x y [true]. And I have this goal: value (bexp [] y) = 0 ^ value y I want to replace the call to bexp with the underlying bexp_r. I tried to use the simpl tactic but it did not replace it.
In order to replace the call to the `bexp` function with its underlying definition `bexp_r`, you can use the `rewrite` tactic if you have the definition available in your context. Here’s how you can do it: 1. Ensure that the definition of `bexp` is in scope. If it is defined in a module, you may need to import that mo...
[ { "from": "human", "value": "I have this function:\nDefinition bexp x y := bexp_r x y [true].\n\nAnd I have this goal:\nvalue (bexp [] y) = 0 ^ value y\n\nI want to replace the call to bexp with the underlying bexp_r.\nI tried to use the simpl tactic but it did not replace it.\n" }, { "from": "gpt",...
I want to simplify the expression 0 * 1 * 1 * 1 * 0 using simp only [mul_zero, zero_mul]. I would like mul_zero to fire first, so that the entire expression is simplified to zero in only one step. If mul_zero fires first, I would expect the simplification process to take 4 steps, due to there being one step to eliminat...
In Lean, the simplifier uses a set of rules to determine how to simplify expressions, but it does not allow you to directly specify the order in which specific rules are applied. However, you can control the simplification process by manipulating the structure of the expression or by using specific tactics to force the...
[ { "from": "human", "value": "I want to simplify the expression 0 * 1 * 1 * 1 * 0 using simp only [mul_zero, zero_mul]. I would like mul_zero to fire first, so that the entire expression is simplified to zero in only one step. If mul_zero fires first, I would expect the simplification process to take 4 steps...
I found a site where I can use Coq in my browser: jsCoq Interactive Online System. Are there any major differences between the experience I'm getting on this site and the downloadable version(s)?
Using Coq through the jsCoq Interactive Online System in your browser offers several conveniences and advantages, but there are also some differences compared to using a local installation of Coq. Here are the major points to consider: ### Advantages of jsCoq: 1. **No Installation Required**: You can start using Coq i...
[ { "from": "human", "value": "I found a site where I can use Coq in my browser: jsCoq Interactive Online System. Are there any major differences between the experience I'm getting on this site and the downloadable version(s)?\n" }, { "from": "gpt", "value": "Using Coq through the jsCoq Interactiv...
Suppose two separate files define decidability instances for a particular predicate in different ways. If I import both of these files, and attempt to run #eval to_bool ... to evaluate the predicate for a particular input, how does Lean decide which instance to use in the evaluation?
In Lean, when you import multiple files (modules) that define the same predicate, the resolution of which instance to use during evaluation depends on several factors, including the order of imports and the specific namespace where the instances are defined. Here are the key points to consider: 1. **Import Order**: W...
[ { "from": "human", "value": "Suppose two separate files define decidability instances for a particular predicate in different ways. If I import both of these files, and attempt to run #eval to_bool ... to evaluate the predicate for a particular input, how does Lean decide which instance to use in the evalua...
Suppose two separate files define decidability instances for a particular predicate in different ways. If I import both of these files, and attempt to run #eval to_bool ... to evaluate the predicate for a particular input, how does Lean decide which instance to use in the evaluation?
In Lean, when you import multiple files (modules) that define the same instance (in this case, the decidability instance for a predicate), the resolution of which instance to use during evaluation depends on the specific order of imports and Lean's handling of instances. 1. **Instance Resolution**: Lean uses an implic...
[ { "from": "human", "value": "Suppose two separate files define decidability instances for a particular predicate in different ways. If I import both of these files, and attempt to run #eval to_bool ... to evaluate the predicate for a particular input, how does Lean decide which instance to use in the evalua...
Is there a library (for any proof assistant) which provides formalized definitions of unsolved problems? To clarify, I mean some collection that correctly defines unsolved problems in the language of a proof assistant, without attempting to provide any solutions. By unsolved problems, I mean one which haven't been solv...
Yes, there are some libraries and projects in various proof assistants that focus on formalizing mathematical concepts and problems, including some unsolved problems. However, it's important to note that these libraries often don't aim to solve these problems but rather to provide formal definitions, formulations, and ...
[ { "from": "human", "value": "Is there a library (for any proof assistant) which provides formalized definitions of unsolved problems? To clarify, I mean some collection that correctly defines unsolved problems in the language of a proof assistant, without attempting to provide any solutions.\nBy unsolved pr...
For example, if I want to define multiplication inverse on the rational type, intuitively we would define: ÷ : Q -> <Q \ {0}> -> Q But how would I remove a zero from the second argument? One solution would be to add an extra parameter ÷ : Q -> (q : Q) -> q ≠ 0 -> Q, but this makes the signature ugly as it's no longer ...
In type theory and functional programming, handling operations that involve restrictions on the types of inputs—like division where the divisor cannot be zero—can indeed lead to some complex type signatures. Your suggestion to add an additional parameter representing the non-zero condition is valid, but as you mentione...
[ { "from": "human", "value": "For example, if I want to define multiplication inverse on the rational type, intuitively we would define:\n÷ : Q -> <Q \\ {0}> -> Q\n\nBut how would I remove a zero from the second argument?\nOne solution would be to add an extra parameter ÷ : Q -> (q : Q) -> q ≠ 0 -> Q, but th...
The paper in question: An Implementation of a Dependently Typed Lambda Calculus by Andres Löh, Conor McBride and Wouter Swierstra. I'm wondering whether it's correct in what's it is doing. Precisely on page 7. In type checker. It's got these evaluations with empty environments. Eg. let v = eval↓ t []. Precisely when th...
In the context of the paper "An Implementation of a Dependently Typed Lambda Calculus" by Löh, McBride, and Swierstra, the type checker and evaluator are designed to work with dependently typed terms in a way that ensures that types and terms are checked correctly. On page 7, the evaluation of terms with an empty envi...
[ { "from": "human", "value": "The paper in question: An Implementation of a Dependently Typed Lambda Calculus by Andres Löh, Conor McBride and Wouter Swierstra.\nI'm wondering whether it's correct in what's it is doing. Precisely on page 7. In type checker. It's got these evaluations with empty environments....
How would you explain so a beginner in simple terms why Proof Assistants are important, and how / why they are used?
Proof assistants are like powerful tools that help us check the correctness of mathematical proofs and computer programs. Here’s a simple way to understand why they are important and how they are used: ### Why They Are Important: 1. **Accuracy**: Just like how a calculator helps avoid mistakes in math, proof assistan...
[ { "from": "human", "value": "How would you explain so a beginner in simple terms why Proof Assistants are important, and how / why they are used?\n" }, { "from": "gpt", "value": "Proof assistants are like powerful tools that help us check the correctness of mathematical proofs and computer progr...
The AFP entry Deriving provides a way to derive the following classes: class description comparator generate comparators for given types compare register types in class compare compare_order register types in class compare_order countable register datatypes is class countable equality generate an equali...
In the context of the AFP (Algebraic Framework for Programming), the `register_derive` function is used to register new classes that you want to derive alongside the existing ones. It allows you to extend the framework's functionality by adding custom classes, similar to how the existing classes like `comparator`, `cou...
[ { "from": "human", "value": "The AFP entry Deriving provides a way to derive the following classes:\n\n\n\n\nclass\ndescription\n\n\n\n\ncomparator\ngenerate comparators for given types\n\n\ncompare\nregister types in class compare\n\n\ncompare_order\nregister types in class compare_order\n\n\ncountable\nre...
The documentation for the E Theorem Prover explains this as the first step in its process: A clausification algorithm translates first-order input into clause normal form, such that the resulting formula is unsatisfiable if and only of the original problem is provable. Does this simply mean that it will attempt to fi...
The process described in the documentation for the E Theorem Prover regarding the clausification algorithm is indeed related to transforming first-order logic statements into clause normal form (CNF) for the purpose of automated theorem proving. ### Key Points: 1. **Clause Normal Form (CNF)**: CNF is a standardized ...
[ { "from": "human", "value": "The documentation for the E Theorem Prover explains this as the first step in its process:\n\nA clausification algorithm translates first-order input into clause\nnormal form, such that the resulting formula is unsatisfiable if and\nonly of the original problem is provable.\n\nD...
There are many resources (1, 2, 3, 4) to learn about various techniques for manipulating syntax with variable binding, however, I haven't seen many descriptions of which specific techniques are actually used in existing proof assistants. Is there some existing chart for this kind of information, or is it "folklore"?
The landscape of proof assistants is indeed rich, and while there are many resources discussing techniques for manipulating syntax with variable binding, a comprehensive chart that systematically categorizes which techniques are used in which proof assistants is not commonly available. Instead, much of this information...
[ { "from": "human", "value": "There are many resources (1, 2, 3, 4) to learn about various techniques for manipulating syntax with variable binding, however, I haven't seen many descriptions of which specific techniques are actually used in existing proof assistants. Is there some existing chart for this kin...
I am learning about the categorical semantics of type theory. I've written some preliminary results in Agda. In particular, I partially proved that the contexts and substitutions of simply-typed lambda calculus ($\lambda^\to$) forms a cartesian closed category, and I think I can prove that it is the free one over its b...
Your intuition about the relationship between the simply typed lambda calculus (STLC) and the simply typed lambda calculus with pairs (STLC with products) is indeed correct. To clarify, when we extend the simply typed lambda calculus to include binary products, the resulting system still retains a Cartesian closed stru...
[ { "from": "human", "value": "I am learning about the categorical semantics of type theory. I've written some preliminary results in Agda. In particular, I partially proved that the contexts and substitutions of simply-typed lambda calculus ($\\lambda^\\to$) forms a cartesian closed category, and I think I c...
In Lean, explicit function arguments are enclosed in round brackets and implicit ones in curly brackets, as in this example: lemma surjective.comp {g : β → φ} {f : α → β} (hg : surjective g) (hf : surjective f) : surjective (g ∘ f) := ... However, occasionally we see some strange double curly brackets like this: def...
In Lean, the double curly brackets `⦃ ⦄` are used to indicate "implicit arguments" that are **not** explicitly mentioned in the function signature. In the context of your example, `injective`, the variables `a₁` and `a₂` are implicit parameters in the proof of the property being defined, which means they can be inferre...
[ { "from": "human", "value": "In Lean, explicit function arguments are enclosed in round brackets and implicit ones in curly brackets, as in this example:\nlemma surjective.comp {g : β → φ} {f : α → β} (hg : surjective g) (hf : surjective f) :\n surjective (g ∘ f) := ...\n\nHowever, occasionally we see some...
I am a math teacher in college. I’m very interested in type theory. So far, I got the general idea of it but I would like to go deeper. I am interested in philosophy of maths, in foundations of maths, in topos theory. I would like to understand the univalence axiom. I think learning how to use a proof assistant could h...
Given your interests in type theory, philosophy of mathematics, foundations of mathematics, and topos theory, as well as your goal to understand the univalence axiom, I would recommend learning **Coq** or **Lean** as your proof assistant. ### Coq - **Type Theory**: Coq is based on the Calculus of Inductive Constructio...
[ { "from": "human", "value": "I am a math teacher in college. I’m very interested in type theory. So far, I got the general idea of it but I would like to go deeper. I am interested in philosophy of maths, in foundations of maths, in topos theory. I would like to understand the univalence axiom.\nI think lea...
In Agda with --guardedness, we can define productive definitions using copatterns like the following repeat : ∀ {A} -> (a : A) -> Stream A repeat a .head = a repeat a .tail = repeat a Given the coinductive definition of Stream. Similarly we can define zipWith: zipWith : ∀ {A B C} -> (A -> B -> C) -> Stream A -> Stream...
In Agda, when using guardedness, you can indeed run into issues when trying to define certain non-trivial coinductive structures like the Fibonacci stream due to the limitations of the productivity checker. The key is to ensure that your definitions remain productive while adhering to the rules of guardedness. One way...
[ { "from": "human", "value": "In Agda with --guardedness, we can define productive definitions using copatterns like the following\nrepeat : ∀ {A} -> (a : A) -> Stream A\nrepeat a .head = a\nrepeat a .tail = repeat a\n\nGiven the coinductive definition of Stream. Similarly we can define zipWith:\nzipWith : ∀...
Metamath Zero (MM0) is a proof assistant developed by Mario Carneiro. It has a metalogic very similar to the metalogic of MetaMath, but it also borrows design choices from Lean (and maybe other sources). It will also (when complete) have novel features such as a fully verified byte code kernel. My understanding is th...
MM0, being inspired by both Metamath and various modern proof assistants, indeed has a unique approach to handling proofs and their underlying logic. Here's how MM0 is designed to interact with systems like Lean and Coq, particularly concerning judgemental equality and type checking: ### 1. Proof Extraction from the K...
[ { "from": "human", "value": "Metamath Zero (MM0) is a proof assistant developed by Mario Carneiro. It has a metalogic very similar to the metalogic of MetaMath, but it also borrows design choices from Lean (and maybe other sources). It will also (when complete) have novel features such as a fully verified...
I am learning Coq with ssreflect. Just to understand things, I've proved forall a b : bool, a == b -> a = b but I can't figure out how to prove forall m n : nat, m == n -> m = n. I've tried using the elim tactic first on m, then on n, but in the end I was left with a subgoal I couldn't prove. I've tried destruct m and ...
To prove the lemma `forall m n : nat, m == n -> m = n` using Coq with ssreflect, we will leverage the equality provided by the `==` operator from the mathcomp library. The `==` operator is a syntactic equality test that provides a decidable equality for natural numbers, and it can be proven by case analysis on the va...
[ { "from": "human", "value": "I am learning Coq with ssreflect. Just to understand things, I've proved forall a b : bool, a == b -> a = b but I can't figure out how to prove forall m n : nat, m == n -> m = n. I've tried using the elim tactic first on m, then on n, but in the end I was left with a subgoal I c...
From Lean 4 tutorial, I learned that In the Lean standard library, you often see Greek letters to denote types, and the Unicode symbol → as a more compact version of -> and you can also type the arrow symbol → as either \to or \r. The use of Unicode worries me a little bit just as when I first saw the different zeros...
In Lean, while the default representation of certain symbols (like Greek letters and arrows) is Unicode, you can indeed use ASCII representations for many of them. This can alleviate concerns about distinguishing similar Unicode characters, especially if you're more comfortable with ASCII. 1. **Lean File Encoding**: L...
[ { "from": "human", "value": "From Lean 4 tutorial, I learned that\n\nIn the Lean standard library, you often see Greek letters to denote\ntypes, and the Unicode symbol → as a more compact version of ->\n\nand you can also type the arrow symbol → as either \\to or \\r.\nThe use of Unicode worries me a little...
Off and on I have heard of the jargon "commuting conversion" but I don't really know what it means. I've heard commuting conversions are problematic but I don't know why.
"Commuting conversion" typically refers to a process in the context of urban planning, transportation, or labor economics. While the term itself might not be universally recognized, it can generally relate to the phenomenon of converting spaces, such as residential areas, to accommodate commuting patterns or the conver...
[ { "from": "human", "value": "Off and on I have heard of the jargon \"commuting conversion\" but I don't really know what it means.\nI've heard commuting conversions are problematic but I don't know why.\n" }, { "from": "gpt", "value": "\"Commuting conversion\" typically refers to a process in th...
The documentation for the E Theorem Prover explains this as the first step in its process: A clausification algorithm translates first-order input into clause normal form, such that the resulting formula is unsatisfiable if and only of the original problem is provable. Does this simply mean that it will attempt to fi...
Yes, the process described in the E theorem prover’s documentation refers to transforming a first-order logic formula into clause normal form (CNF) through a clausification algorithm. In this context, clause normal form means that the formula is expressed as a conjunction of disjunctions of literals. The key point he...
[ { "from": "human", "value": "The documentation for the E Theorem Prover explains this as the first step in its process:\n\nA clausification algorithm translates first-order input into clause\nnormal form, such that the resulting formula is unsatisfiable if and\nonly of the original problem is provable.\n\nD...
I followed Lean documentation to install Lean 4 on my Ubuntu Linux (20.04 LTS) using the elan option described there, and updated it to Lean4 m3 using: elan self update elan default leanprover/lean4:stable elan update I noticed that my Lean folder ~/.elan is now taking a lot of space (1.5G). Most space is taken by sub...
To manage your Lean installations with `elan`, you can follow these steps to ensure that you only have the desired branch installed and to remove the unused branches. Here’s how to do it: ### 1. Set the Default Toolchain You can set the default toolchain to only the one you want to keep. Since you mentioned that you w...
[ { "from": "human", "value": "I followed Lean documentation to install Lean 4 on my Ubuntu Linux (20.04 LTS) using the elan option described there, and updated it to Lean4 m3 using:\nelan self update\nelan default leanprover/lean4:stable\nelan update\n\nI noticed that my Lean folder ~/.elan is now taking a l...
If I want to install Agda do I have to be attentive to versions, breaking changes, etc.? A comment from an earlier question noted Agda version for installed libraries
Yes, when installing Agda, you should be attentive to versions, as different versions may introduce breaking changes or deprecate features that were present in earlier releases. Here's a general guideline on how to navigate versioning when installing Agda and libraries: 1. **Check Agda Version Compatibility**: Make su...
[ { "from": "human", "value": "If I want to install Agda do I have to be attentive to versions, breaking changes, etc.?\nA comment from an earlier question noted\n\nAgda version for installed libraries\n\n" }, { "from": "gpt", "value": "Yes, when installing Agda, you should be attentive to version...
Andrea Vezzosi said Cubical Agda made cubical subtyping coercion-based (inS and outS) because it's a bad idea to introduce more subtyping relations which complicates the system. Also Agda did not have cumulative universes (it is added now). So does Agda support any subtyping relations? Without using rewriting and cumul...
In Agda, subtyping is not directly supported in the same way that some other languages (like TypeScript or Scala) implement it. Instead, Agda uses a rich type system with dependent types, and while it does not have traditional subtyping relations, it employs techniques such as type classes, implicit parameters, and oth...
[ { "from": "human", "value": "Andrea Vezzosi said Cubical Agda made cubical subtyping coercion-based (inS and outS) because it's a bad idea to introduce more subtyping relations which complicates the system. Also Agda did not have cumulative universes (it is added now).\nSo does Agda support any subtyping re...
In my experience, one of the most common applications of computer-assisted proofs in math is establishing that a given system of constraints is infeasible. Here are some examples of settings and tools in this vein: Boolean formula (by SAT solver) System of complex polynomial equations (by computing a Groebner basis) S...
The conversion of computer-assisted proof tools to formal proof systems is an active area of research, and several notable efforts have been made to formalize the proofs generated by various computational techniques. Below is an overview of the progress in different areas: 1. **SAT Solvers**: The results produced by S...
[ { "from": "human", "value": "In my experience, one of the most common applications of computer-assisted proofs in math is establishing that a given system of constraints is infeasible. Here are some examples of settings and tools in this vein:\n\nBoolean formula (by SAT solver)\nSystem of complex polynomial...
Here is a stripped down version of something that is causing me trouble. variables {α : Type*} [decidable_eq α] def S (a : α) : set α := λ b, b = a def P (a : α) : decidable_pred (λ (c : α), c = a) := by { apply_instance, } def Q (a : α) : decidable_pred (λ (c : α), c ∈ (S a)) := by { simp[S], apply_instance, } ...
The issue you are encountering in Lean is related to how the tactic `mk_instance` is handling the predicates you are defining. While the predicates in both `P` and `Q` are indeed equivalent, the way they are structured makes a difference in how Lean's typeclass resolution can infer the necessary instances. In the case...
[ { "from": "human", "value": "Here is a stripped down version of something that is causing me trouble.\nvariables {α : Type*} [decidable_eq α]\n\ndef S (a : α) : set α := λ b, b = a\n\ndef P (a : α) : decidable_pred (λ (c : α), c = a) := \n by { apply_instance, }\n\ndef Q (a : α) : decidable_pred (λ (c : α),...
In my experience, one of the most common applications of computer-assisted proofs in math is establishing that a given system of constraints is infeasible. Here are some examples of settings and tools in this vein: Boolean formula (by SAT solver) System of complex polynomial equations (by computing a Groebner basis) S...
The integration of computer-assisted proofs into formal proof systems is an ongoing area of research and development in the field of mathematical logic and computer science. Here's an overview of how various tools used for proving infeasibility in different mathematical settings have been related to formal proof system...
[ { "from": "human", "value": "In my experience, one of the most common applications of computer-assisted proofs in math is establishing that a given system of constraints is infeasible. Here are some examples of settings and tools in this vein:\n\nBoolean formula (by SAT solver)\nSystem of complex polynomial...
Isabelle has the frontend Isar which mimics some features of the Mizar system. I'm curious if Coq has anything similar, i.e. an alternative to tactic scripts that's designed to be readable or similar to the mathematical vernacular. This discussion on the Coq forums mentions Czar and SSReflect.
Yes, Coq has several alternatives and extensions that can facilitate a more readable or mathematical vernacular style of writing proofs, similar to Isar in Isabelle. 1. **Czar**: Czar is a proof system that builds on Coq to provide a more structured and readable format for proofs. It emphasizes a declarative style tha...
[ { "from": "human", "value": "Isabelle has the frontend Isar which mimics some features of the Mizar system.\nI'm curious if Coq has anything similar, i.e. an alternative to tactic scripts that's designed to be readable or similar to the mathematical vernacular.\nThis discussion on the Coq forums mentions Cz...
We have the lovely dependent pattern matching on refl constructor of identity type in systems like Agda, but the same feature is missing for Cubical Agda. People want (well, at least Martin Escardo who created the ticket) to have this feature, and I'm thinking about how to do it. In normal Agda, pattern matching on ref...
The question you are asking revolves around the possibility of implementing dependent pattern matching on the identity type, particularly in the context of Cubical Agda, which utilizes cubical type theory. You've outlined the two key aspects of this pattern matching: rewriting the context and the computational behavior...
[ { "from": "human", "value": "We have the lovely dependent pattern matching on refl constructor of identity type in systems like Agda, but the same feature is missing for Cubical Agda. People want (well, at least Martin Escardo who created the ticket) to have this feature, and I'm thinking about how to do it...
In Lean, when proving basic theorems, one runs into the following kind of thing: import tactic variables (P : Prop) example : P → P := begin intro p, exact p, end After the intro p, step, the tactic state is P : Prop p : P ⊢ P At this point, we need to use the exact tactic to close the goal. All exact seems to d...
The behavior you've observed in Lean regarding the use of the `exact` tactic relates to its design philosophy and the underlying principles of proof theory and type theory. 1. **Explicitness in Proofs**: Lean is designed to make the structure of proofs explicit. When you use tactics like `exact`, you are clearly stati...
[ { "from": "human", "value": "In Lean, when proving basic theorems, one runs into the following kind of thing:\nimport tactic\nvariables (P : Prop)\n\nexample : P → P :=\nbegin\n intro p,\n exact p,\nend\n\nAfter the intro p, step, the tactic state is\nP : Prop\np : P\n⊢ P\n\nAt this point, we need to use ...
I am learning about the categorical semantics of type theory. I've written some preliminary results in Agda. In particular, I partially proved that the contexts and substitutions of simply-typed lambda calculus ($\lambda^\to$) forms a cartesian closed category, and I think I can prove that it is the free one over its b...
Your intuition is correct that adding binary products (i.e., pairs) to simply-typed lambda calculus (STLC) does not change the property of the resulting category being a free cartesian closed category (CCC) over its base types. Let’s break this down a bit. 1. **Simply-Typed Lambda Calculus ($\lambda^\to$)**: In this s...
[ { "from": "human", "value": "I am learning about the categorical semantics of type theory. I've written some preliminary results in Agda. In particular, I partially proved that the contexts and substitutions of simply-typed lambda calculus ($\\lambda^\\to$) forms a cartesian closed category, and I think I c...
Suppose two separate files define decidability instances for a particular predicate in different ways. If I import both of these files, and attempt to run #eval to_bool ... to evaluate the predicate for a particular input, how does Lean decide which instance to use in the evaluation?
In Lean, when you import two separate files that define a predicate with the same name but different definitions, the way Lean resolves which instance to use depends on several factors, including the import order and the specific way the imports are structured. 1. **Import Order**: If both files are imported in the sa...
[ { "from": "human", "value": "Suppose two separate files define decidability instances for a particular predicate in different ways. If I import both of these files, and attempt to run #eval to_bool ... to evaluate the predicate for a particular input, how does Lean decide which instance to use in the evalua...
I have this function: Definition bexp x y := bexp_r x y [true]. And I have this goal: value (bexp [] y) = 0 ^ value y I want to replace the call to bexp with the underlying bexp_r. I tried to use the simpl tactic but it did not replace it.
To replace a call to `bexp` with its underlying definition `bexp_r`, you typically need to ensure that the definition is in scope and that you are using a tactic that allows you to perform the replacement effectively. In many proof assistants, such as Coq, you can use the `rewrite` tactic if you have a lemma stating t...
[ { "from": "human", "value": "I have this function:\nDefinition bexp x y := bexp_r x y [true].\n\nAnd I have this goal:\nvalue (bexp [] y) = 0 ^ value y\n\nI want to replace the call to bexp with the underlying bexp_r.\nI tried to use the simpl tactic but it did not replace it.\n" }, { "from": "gpt",...
Is "simple type theory" a folklore, or does it have a formal definition? On nlab, it's only discussed "practically": In practice any type theory is called a simple type theory if type formation is not indexed, that is the judgment that a type A is well-formed has no other inputs Do we use simply-typed $\lambda$-calcu...
"Simple type theory" refers to a specific type system that is often associated with the simply-typed \(\lambda\)-calculus. While it can sometimes be used informally to describe type systems that lack complexity (for example, systems without dependent types or other advanced features), it does have a formal definition w...
[ { "from": "human", "value": "Is \"simple type theory\" a folklore, or does it have a formal definition? On nlab, it's only discussed \"practically\":\n\nIn practice any type theory is called a simple type theory if type formation is not indexed, that is the judgment that a type A is well-formed has no other...
I am learning Coq with ssreflect. Just to understand things, I've proved forall a b : bool, a == b -> a = b but I can't figure out how to prove forall m n : nat, m == n -> m = n. I've tried using the elim tactic first on m, then on n, but in the end I was left with a subgoal I couldn't prove. I've tried destruct m and ...
To prove the lemma `eqn_impl_eq` in Coq using the SSReflect library, we will utilize the fact that the equality `==` for natural numbers behaves like an equivalence relation. The `==` operator is defined to be a boolean representation of equality, which allows us to derive the actual equality. Here's how you can prove...
[ { "from": "human", "value": "I am learning Coq with ssreflect. Just to understand things, I've proved forall a b : bool, a == b -> a = b but I can't figure out how to prove forall m n : nat, m == n -> m = n. I've tried using the elim tactic first on m, then on n, but in the end I was left with a subgoal I c...
In Agda, irrelevance is an annotation which marks a parameter, record field, or definition which "will only be typechecked but never evaluated", with the consequence that irrelevant arguments and record fields are ignored when checking equality. You can define records with irrelevant fields, e.g. this "Squash" type who...
The `--irrelevant-projections` flag in Agda allows you to define projections from records that have irrelevant fields, which makes those fields accessible in a way that they otherwise wouldn’t be. However, this can lead to issues concerning the soundness and safety of the type system, particularly in how it deals with ...
[ { "from": "human", "value": "In Agda, irrelevance is an annotation which marks a parameter, record field, or definition which \"will only be typechecked but never evaluated\", with the consequence that irrelevant arguments and record fields are ignored when checking equality.\nYou can define records with ir...
Suppose I want to make bool (i.e. the type {ff,tt} of boolean values) into a commutative ring. The following works: instance : comm_ring bool := { zero := ff, add := bxor, neg := id, one := tt, mul := band, zero_add := by { repeat { rintro ⟨_⟩ }; refl }, add_zero := by { repeat { rintro ⟨_⟩ };...
It sounds like you're encountering some changes in the Lean ecosystem regarding how the `refine_struct` tactic works and how it constructs goals for instances of structures like `comm_ring`. To clarify, `refine_struct` is designed to automate the process of filling in the fields of a structure and generating goals to...
[ { "from": "human", "value": "Suppose I want to make bool (i.e. the type {ff,tt} of boolean values) into a commutative ring. The following works:\ninstance : comm_ring bool := {\n zero := ff,\n add := bxor,\n neg := id,\n one := tt,\n mul := band,\n zero_add := by { repeat { rintro ⟨_⟩ }; refl }...
I have this function: Definition bexp x y := bexp_r x y [true]. And I have this goal: value (bexp [] y) = 0 ^ value y I want to replace the call to bexp with the underlying bexp_r. I tried to use the simpl tactic but it did not replace it.
It looks like you are working with a Coq proof, and you want to replace a call to a function `bexp` with its definition that involves `bexp_r`. To do this effectively, we often use the `rewrite` tactic or `unfold` tactic in Coq. Here’s a step-by-step approach you can follow: 1. **Use `unfold`**: The `unfold` tactic i...
[ { "from": "human", "value": "I have this function:\nDefinition bexp x y := bexp_r x y [true].\n\nAnd I have this goal:\nvalue (bexp [] y) = 0 ^ value y\n\nI want to replace the call to bexp with the underlying bexp_r.\nI tried to use the simpl tactic but it did not replace it.\n" }, { "from": "gpt",...
There are many resources (1, 2, 3, 4) to learn about various techniques for manipulating syntax with variable binding, however, I haven't seen many descriptions of which specific techniques are actually used in existing proof assistants. Is there some existing chart for this kind of information, or is it "folklore"?
The specific techniques for manipulating syntax with variable binding used in proof assistants can often be considered part of the "folklore" of the community, as there isn't a single authoritative source that comprehensively charts these methods across different proof assistants. However, many proof assistants do shar...
[ { "from": "human", "value": "There are many resources (1, 2, 3, 4) to learn about various techniques for manipulating syntax with variable binding, however, I haven't seen many descriptions of which specific techniques are actually used in existing proof assistants. Is there some existing chart for this kin...
There are many resources (1, 2, 3, 4) to learn about various techniques for manipulating syntax with variable binding, however, I haven't seen many descriptions of which specific techniques are actually used in existing proof assistants. Is there some existing chart for this kind of information, or is it "folklore"?
As of my last knowledge update in October 2023, there isn't a widely accepted or centralized chart that outlines the specific techniques used for variable binding and manipulation in various proof assistants. The information about variable binding techniques in proof assistants tends to be more anecdotal and part of th...
[ { "from": "human", "value": "There are many resources (1, 2, 3, 4) to learn about various techniques for manipulating syntax with variable binding, however, I haven't seen many descriptions of which specific techniques are actually used in existing proof assistants. Is there some existing chart for this kin...
The choice of the proof assistant to use for formalisation depends on the area quite a bit; e.g. they say that algebraic topology comes easy in HoTT assistants. What would be the most natural choices for combinatorial constructions in the spirit of, say, block designs/Steiner systems. That is, where one explicitly mani...
For formalizing combinatorial constructions, particularly those related to block designs, Steiner systems, and properties of finite vector spaces, you have several strong candidates among proof assistants. Here are a few recommendations, each with its own strengths: 1. **Coq**: Coq is a popular proof assistant that is...
[ { "from": "human", "value": "The choice of the proof assistant to use for formalisation depends on the area quite a bit; e.g. they say that algebraic topology comes easy in HoTT assistants.\nWhat would be the most natural choices for combinatorial constructions in the spirit of, say, block designs/Steiner s...
I am just practicing a bit with coq, doing some UniMath exercises and am trying to prove (0 = 1) -> empty. However, for some reason, I seem unable to reason based on 0 = 1: Require Import UniMath.Foundations.PartD. Theorem exercise_1_3 : (0 = 1) → empty. Proof. intros contra. exfalso. discriminate contra. Qed. ...
The issue you are encountering arises from the way that `0` and `1` are represented in UniMath. In UniMath, numbers are usually represented by types that correspond to their definitions in type theory, and not as primitive data types as they are in other programming languages. In this case, you want to prove that the ...
[ { "from": "human", "value": "I am just practicing a bit with coq, doing some UniMath exercises and am trying to prove (0 = 1) -> empty. However, for some reason, I seem unable to reason based on 0 = 1:\nRequire Import UniMath.Foundations.PartD.\n\nTheorem exercise_1_3 : (0 = 1) → empty.\nProof.\n intros co...
Kunen's inconsistency theorem is an important theorem in set theory on upper bounds for large cardinals. It has long been thought to be able to be encoded on ZFC, but the full implementation has never appeared on Proof Assistant. Lean has enough power to prove it. Because Lean's ground model is $pCIC + Choice$, which ...
Kunen's inconsistency theorem states that there are no non-trivial elementary embeddings \( j: V \to V \) that can be constructed within certain set-theoretic contexts, specifically in ZFC. To explore whether this theorem can be proven in Metamath without axioms, we need to consider a few factors: 1. **Framework of Me...
[ { "from": "human", "value": "Kunen's inconsistency theorem is an important theorem in set theory on upper bounds for large cardinals.\nIt has long been thought to be able to be encoded on ZFC, but the full implementation has never appeared on Proof Assistant.\n\nLean has enough power to prove it. Because Le...
In Lean, when proving basic theorems, one runs into the following kind of thing: import tactic variables (P : Prop) example : P → P := begin intro p, exact p, end After the intro p, step, the tactic state is P : Prop p : P ⊢ P At this point, we need to use the exact tactic to close the goal. All exact seems to d...
The behavior you're observing in Lean, where you need to explicitly use the `exact` tactic to close a goal even when it matches one of the hypotheses, is indeed a design choice rooted in the foundational principles of type theory and proof verification. ### Reasons for Explicit Proofs 1. **Explicitness and Clarity**:...
[ { "from": "human", "value": "In Lean, when proving basic theorems, one runs into the following kind of thing:\nimport tactic\nvariables (P : Prop)\n\nexample : P → P :=\nbegin\n intro p,\n exact p,\nend\n\nAfter the intro p, step, the tactic state is\nP : Prop\np : P\n⊢ P\n\nAt this point, we need to use ...
Can any of you refer me to documented results of experiments on the performance of provers using de Bruijn indices to represent references to bound variables versus mentions of names or other simple alternatives? I am particularly interested in simple type theory and higher-order logic, but results with implementations...
The use of de Bruijn indices to represent references to bound variables is a well-explored topic in the field of formal logic and type theory, particularly in the context of proof assistants and theorem provers. While I cannot provide direct references, I can suggest some key areas and resources that could be useful fo...
[ { "from": "human", "value": "Can any of you refer me to documented results of experiments on the performance of provers using de Bruijn indices to represent references to bound variables versus mentions of names or other simple alternatives? I am particularly interested in simple type theory and higher-orde...
It seems to me that there are no real reasons to not like cumulativity (the example given here seems to not be too relevant, according to the comments), and yet most proof assistants (apart from Coq?) don't have cumulativity. Why is this so? This seems a very nice property mathematically, and is akin to how most people...
Cumulativity in type theory refers to the idea that if a type is in a universe, then that type can be considered to be in any larger universe. This property seems intuitively appealing and indeed aligns with how many people think about types and universes in mathematics. However, there are several reasons why cumulativ...
[ { "from": "human", "value": "It seems to me that there are no real reasons to not like cumulativity (the example given here seems to not be too relevant, according to the comments), and yet most proof assistants (apart from Coq?) don't have cumulativity. Why is this so? This seems a very nice property mathe...
Are there any proof assistants or theorem provers based on the method of analytic tableaux? A closed tableau makes the branching structure of a proof using case analysis very obvious. I like tableau calculi for proving stuff by hand; especially validating simple statements in nonclassical propositional or modal logics....
Yes, there are proof assistants and theorem provers that incorporate tableau methods, especially for handling various logics like propositional, first-order, and modal logics. Here are a few notable ones: 1. **TTableau**: This is a tableau-based theorem prover specifically designed for first-order logic. It allows for...
[ { "from": "human", "value": "Are there any proof assistants or theorem provers based on the method of analytic tableaux?\nA closed tableau makes the branching structure of a proof using case analysis very obvious.\nI like tableau calculi for proving stuff by hand; especially validating simple statements in ...
It is possible (with some cleverness) to prove false from type-in-type. For instance, Girard proved false in Martin Lof's original system (as described in the introduction of An Intuitionistic Theory of Types). This answer has a good account of the formal details. Most systems allow type-in-type, through a configured...
Yes, there are indeed examples in type theory and proof assistants where "proofs" of false statements can be constructed using type-in-type systems. The phenomenon arises primarily due to the expressiveness that type-in-type allows, particularly in the context of self-referential types or types that can contain themsel...
[ { "from": "human", "value": "It is possible (with some cleverness) to prove false from type-in-type. For instance, Girard proved false in Martin Lof's original system (as described in the introduction of An Intuitionistic Theory of Types). This answer has a good account of the formal details.\nMost system...
In the Lean mathlib, I see some places where a typeclass argument is included in a class definition, such as locally_finite_order. In other places, I see the "extends" keyword used, such as ring. What are the differences and tradeoffs between these two ways of doing things?
In Lean's mathlib, there are different ways to define type classes and express dependencies between them. The two methods you've mentioned—explicitly including type class arguments versus using the `extends` keyword—are two common approaches. Each has its own implications and trade-offs: ### 1. Explicitly Including Ty...
[ { "from": "human", "value": "In the Lean mathlib, I see some places where a typeclass argument is included in a class definition, such as locally_finite_order. In other places, I see the \"extends\" keyword used, such as ring. What are the differences and tradeoffs between these two ways of doing things?\n"...
Theorem search {P : nat -> Prop} (dec : forall n, {P n} + {~P n}) : ~~(exists n, P n) -> {n | P n}. Admitted. I don't think this is provable in Coq without additional axioms, and it is provable when assuming LEM : forall A : Prop, A \/ ~A. However, I don't think it proves LEM. What are the weakest axioms that prove ...
The theorem you are investigating is a form of the "existential witness" property, which is often linked to constructive logic and various forms of choice principles in the context of intuitionistic type theory. The statement can be interpreted as saying: if you can construct a decidable property \( P \) on the natura...
[ { "from": "human", "value": "Theorem search\n {P : nat -> Prop} (dec : forall n, {P n} + {~P n})\n: ~~(exists n, P n) -> {n | P n}.\nAdmitted.\n\nI don't think this is provable in Coq without additional axioms, and it is provable when assuming LEM : forall A : Prop, A \\/ ~A. However, I don't think it prov...
Let's say I have a simple structure structure foo : Type := (a : ℕ) (b : list (fin a)) when defining the field b I can reference a. If I try to define a function to construct new foo's like so def bar (p : foo) : foo := { a := p.a + 1, b := list (fin a) } where I tried to reference the a I constructed on the fi...
In Lean, when you're defining a new structure or instance, the fields of the structure you are working with are accessed through the structure itself (in your case, `p`). The error you are encountering is because you are trying to reference `a` directly without specifying the context. To use the `a` field from the str...
[ { "from": "human", "value": "Let's say I have a simple structure\nstructure foo : Type :=\n (a : ℕ)\n (b : list (fin a))\n\nwhen defining the field b I can reference a. If I try to define a function to construct new foo's like so\ndef bar (p : foo) : foo :=\n{ a := p.a + 1,\n b := list (fin a)\n}\n\nwher...
Coq’s built-in termination checker accepts some rather intricate recursion patterns with functional values in data types, as shown by this example Inductive Z_inf_branch_tree : Set := Z_inf_leaf : Z_inf_branch_tree | Z_inf_node : Z→(nat→Z_inf_branch_tree)→Z_inf_branch_tree. Fixpoint n_sum_all_values (n:nat)(t:Z_inf_...
The termination checker in Coq is a crucial component that ensures that recursive functions will not enter infinite loops. It achieves this through a combination of techniques that primarily focus on structural recursion and well-founded relations. While there might not be a singular, comprehensive document that expla...
[ { "from": "human", "value": "Coq’s built-in termination checker accepts some rather intricate recursion patterns with functional values in data types, as shown by this example\nInductive Z_inf_branch_tree : Set :=\n Z_inf_leaf : Z_inf_branch_tree\n| Z_inf_node : Z→(nat→Z_inf_branch_tree)→Z_inf_branch_tree....
In Coq, there are two restrictions on fixpoints to retain normalization: Recursive calls can only be done on structurally smaller arguments, enforced by a guard condition during type checking; and Reduction occurs only when applied to a constructor in the recursive argument position (also called guarded recursion, app...
The issues you raise about the Coq type theory relate to the broader properties of normalization and consistency within a system that supports recursion and fixpoints. 1. **Normalization and Guarded Recursion**: In Coq, the restriction that recursive calls must be made on structurally smaller arguments helps maintain ...
[ { "from": "human", "value": "In Coq, there are two restrictions on fixpoints to retain normalization:\n\nRecursive calls can only be done on structurally smaller arguments, enforced by a guard condition during type checking; and\nReduction occurs only when applied to a constructor in the recursive argument ...
I want to simplify the expression 0 * 1 * 1 * 1 * 0 using simp only [mul_zero, zero_mul]. I would like mul_zero to fire first, so that the entire expression is simplified to zero in only one step. If mul_zero fires first, I would expect the simplification process to take 4 steps, due to there being one step to eliminat...
In Lean, when you're using the `simp` tactic, it generally applies all available simplification rules without any specific prioritization. However, if you want to guide the simplification process, you can consider a couple of strategies. 1. **Using specific lemmas first:** You can explicitly invoke `simp` on a specifi...
[ { "from": "human", "value": "I want to simplify the expression 0 * 1 * 1 * 1 * 0 using simp only [mul_zero, zero_mul]. I would like mul_zero to fire first, so that the entire expression is simplified to zero in only one step. If mul_zero fires first, I would expect the simplification process to take 4 steps...
In the F* proof assistant, they use refinement types together with dependent types. Based on my impression of F*, it seems to me that refinement types are just predicates in dependent type theory that are like "something something of type boolean should equal to true". I think I'm probably (extremely) biased (and proba...
Your intuition about refinement types and dependent types having a relationship is spot on! Let's explore how they are related and where they might differ. ### Refinement Types Refinement types are a type system feature that allows you to add additional constraints (or predicates) to types. For example, instead of jus...
[ { "from": "human", "value": "In the F* proof assistant, they use refinement types together with dependent types. Based on my impression of F*, it seems to me that refinement types are just predicates in dependent type theory that are like \"something something of type boolean should equal to true\". I think...
Off and on I have heard of the jargon "commuting conversion" but I don't really know what it means. I've heard commuting conversions are problematic but I don't know why.
The term "commuting conversion" typically refers to a situation in the context of mathematical logic or model theory, where one tries to convert a certain type of structure or interpretation into another while maintaining some form of relationship, usually related to computability or definability. In a more informal s...
[ { "from": "human", "value": "Off and on I have heard of the jargon \"commuting conversion\" but I don't really know what it means.\nI've heard commuting conversions are problematic but I don't know why.\n" }, { "from": "gpt", "value": "The term \"commuting conversion\" typically refers to a situ...
I find my mathematics and programming background$^*$ do not endow me with much understanding of type theory as it pertains to proof assistants. To remedy this shortcoming I don't expect a Royal Road to understanding, and my strategy is mixed. I ordered Type Theory and Formal Proof -- An Introduction by Nederpelt and G...
Your mixed approach to learning type theory and its applications in proof assistants is sound, especially given your strong background in mathematics and programming. Here are some suggestions and resources that might help expedite your learning process: ### 1. Online Courses and Lectures - **Coursera / edX:** Look fo...
[ { "from": "human", "value": "I find my mathematics and programming background$^*$ do not endow me with much understanding of type theory as it pertains to proof assistants. To remedy this shortcoming I don't expect a Royal Road to understanding, and my strategy is mixed.\nI ordered Type Theory and Formal P...
Clarification of my terminologies: Cubical canonicity: a generalized version of canonicity that the "generated by introduction rules" property holds in, not just closed context, but also contexts with only intervals. Regularity: the fact that transport over a constant path reduces to the identity function. Some work ...
Your question touches on some nuanced aspects of cubical type theory, specifically regarding cubical canonicity and regularity in different contexts. Let's break it down. **Cubical Canonicity:** This property indicates that the introduction rules for types ensure that any term can be interpreted as being generated by ...
[ { "from": "human", "value": "Clarification of my terminologies:\n\nCubical canonicity: a generalized version of canonicity that the \"generated by introduction rules\" property holds in, not just closed context, but also contexts with only intervals.\nRegularity: the fact that transport over a constant path...
It seems that universe levels are just a type generated by a zero constant and a successor constructor (like in Agda), so why don't we adapt natural numbers as universe levels? In Lean, it is also similar: one can find the maximum of two levels, add a level variable with a constant (which is just a sugared version of a...
The idea of using natural numbers as universe levels is indeed a common approach in type theory and proof assistants like Agda and Lean, and this approach can have certain advantages in terms of simplicity and the structure it provides for managing types and their hierarchies. ### Advantages of Using Natural Numbers a...
[ { "from": "human", "value": "It seems that universe levels are just a type generated by a zero constant and a successor constructor (like in Agda), so why don't we adapt natural numbers as universe levels?\nIn Lean, it is also similar: one can find the maximum of two levels, add a level variable with a cons...
I followed Lean documentation to install Lean 4 on my Ubuntu Linux (20.04 LTS) using the elan option described there, and updated it to Lean4 m3 using: elan self update elan default leanprover/lean4:stable elan update I noticed that my Lean folder ~/.elan is now taking a lot of space (1.5G). Most space is taken by sub...
To manage your Lean installation with `elan`, you can indeed control which versions are installed and used, but the `elan` tool itself does not have a direct `remove` command to delete specific toolchains. However, you can achieve your goal by following these steps: ### 1. Set Your Default Toolchain If you want to ke...
[ { "from": "human", "value": "I followed Lean documentation to install Lean 4 on my Ubuntu Linux (20.04 LTS) using the elan option described there, and updated it to Lean4 m3 using:\nelan self update\nelan default leanprover/lean4:stable\nelan update\n\nI noticed that my Lean folder ~/.elan is now taking a l...
A game is a fun interactive tutorial/puzzle/challenge that provides the user with a DAG of definitions, theorem statements, examples, etc. and asks the user to prove all the theorems in this DAG. For instance, there is the natural numbers game in Lean. Games are fun because of high interactivity, quick feedback, low en...
Certainly! Here’s a compilation of interactive tutorials and games for various proof assistants. ### Lean - **Natural Numbers Game**: An interactive game that focuses on the basic properties and theorems of natural numbers, allowing users to explore and prove fundamental statements in a fun and engaging way. ### Coq ...
[ { "from": "human", "value": "A game is a fun interactive tutorial/puzzle/challenge that provides the user with a DAG of definitions, theorem statements, examples, etc. and asks the user to prove all the theorems in this DAG. For instance, there is the natural numbers game in Lean. Games are fun because of h...
I followed Lean documentation to install Lean 4 on my Ubuntu Linux (20.04 LTS) using the elan option described there, and updated it to Lean4 m3 using: elan self update elan default leanprover/lean4:stable elan update I noticed that my Lean folder ~/.elan is now taking a lot of space (1.5G). Most space is taken by sub...
To manage the installation and cleanup of Lean versions using `elan`, you can follow these steps: ### Limiting Installed Versions 1. **Set the Default Version**: You can specify which version you want `elan` to use as the default version by running: ```bash elan default leanprover/lean4:stable ``` This com...
[ { "from": "human", "value": "I followed Lean documentation to install Lean 4 on my Ubuntu Linux (20.04 LTS) using the elan option described there, and updated it to Lean4 m3 using:\nelan self update\nelan default leanprover/lean4:stable\nelan update\n\nI noticed that my Lean folder ~/.elan is now taking a l...
Background/Setting of Problem I am trying to encode first-order logic in Coq, and have defined a Term as: Definition name : Type := string. Inductive V := (* "V" for Variable *) | FVar : name -> V (* Free variables *) | BVar : nat -> V. (* de Bruijn indices for bounded variables *) Inductive Term : Type := ...
The problem you're encountering is indeed rooted in the structure of your proof and the way you are applying induction. The main issue is that you are trying to perform induction on the `args`, but this isn't working out as expected because `args` is a vector and not an inductively defined type that generates a new ind...
[ { "from": "human", "value": "Background/Setting of Problem\nI am trying to encode first-order logic in Coq, and have defined a Term as:\nDefinition name : Type := string.\n\nInductive V := (* \"V\" for Variable *)\n| FVar : name -> V (* Free variables *)\n| BVar : nat -> V. (* de Bruijn indices fo...
Andrea Vezzosi said Cubical Agda made cubical subtyping coercion-based (inS and outS) because it's a bad idea to introduce more subtyping relations which complicates the system. Also Agda did not have cumulative universes (it is added now). So does Agda support any subtyping relations? Without using rewriting and cumul...
As of my last knowledge update in October 2023, Agda does not inherently support subtyping in the same way that some other programming languages do, such as those with explicit subtyping mechanisms. Instead, Agda focuses on a dependently-typed approach, where types can depend on values, and the relationships between ty...
[ { "from": "human", "value": "Andrea Vezzosi said Cubical Agda made cubical subtyping coercion-based (inS and outS) because it's a bad idea to introduce more subtyping relations which complicates the system. Also Agda did not have cumulative universes (it is added now).\nSo does Agda support any subtyping re...
I am very surprised that Andrej Bauer claimed to have found a topos where reals are countable. He said it'll take a month to write down the proof, and I think that's very understandable. However, I'm very curious about the general idea behind that -- I have just learned some classical proofs that reals are uncountable,...
Andrej Bauer's claim about finding a topos in which the reals are countable points to an interesting area of research in the field of categorical logic and set theory. The concept relies on the fact that different logical systems can lead to different conclusions about the size of sets, including the real numbers. In ...
[ { "from": "human", "value": "I am very surprised that Andrej Bauer claimed to have found a topos where reals are countable. He said it'll take a month to write down the proof, and I think that's very understandable.\nHowever, I'm very curious about the general idea behind that -- I have just learned some cl...
I was looking at the MSC2020 database and I find it hard to identify a field suitable for works about proof assistants and formalised mathematics. 03B70 ("Logic in Computer Science") might be the closest one, but it does not look optimal to me. My questions are Do you think a better subject class exists? If we end up ...
The MSC (Mathematics Subject Classification) system is indeed quite comprehensive, but it can sometimes be challenging to find the perfect fit for specific interdisciplinary areas like proof assistants and formalized mathematics. Here are some thoughts on your questions: 1. **Alternative Subject Classes**: While 03B70...
[ { "from": "human", "value": "I was looking at the MSC2020 database and I find it hard to identify a field suitable for works about proof assistants and formalised mathematics. 03B70 (\"Logic in Computer Science\") might be the closest one, but it does not look optimal to me. My questions are\n\nDo you think...
The following snippet can't pass type checking. From mathcomp Require Import choice. Definition exfn (A:countType) := false. (* Fail *) Check exfn nat. Failed with message: The term "nat" has type "Set" while it is expected to have type "countType". How to instantiate A with nat properly?
In your snippet, the function `exfn` is defined to take an argument of type `countType`. The type `nat` belongs to the universe `Set`, while `countType` is a type class that ensures that the type has a countable structure (i.e., it can be enumerated). To properly instantiate `A` with `nat`, you need to use the `countT...
[ { "from": "human", "value": "The following snippet can't pass type checking.\nFrom mathcomp Require Import choice.\nDefinition exfn (A:countType) := false.\n(* Fail *) Check exfn nat.\n\nFailed with message: The term \"nat\" has type \"Set\" while it is expected to have type \"countType\".\nHow to instantia...
I recall many years ago seeing a very large and well-interlinked (by computer) list of verified results starting from base assumptions and leading to all sorts of things that naive me did not expect computers to be able to handle e.g. measure theory. I don't recall what software was used, and certainly don't see any so...
What you're recalling may be related to formal proofs and the development of mathematical theories using proof assistants or automated theorem provers. The software that allows for such interlinked verified results is often part of larger projects aimed at formalizing mathematics. Here are a few prominent systems and r...
[ { "from": "human", "value": "I recall many years ago seeing a very large and well-interlinked (by computer) list of verified results starting from base assumptions and leading to all sorts of things that naive me did not expect computers to be able to handle e.g. measure theory. I don't recall what software...
Kunen's inconsistency theorem is an important theorem in set theory on upper bounds for large cardinals. It has long been thought to be able to be encoded on ZFC, but the full implementation has never appeared on Proof Assistant. Lean has enough power to prove it. Because Lean's ground model is $pCIC + Choice$, which ...
Kunen's inconsistency theorem states that there is no non-trivial elementary embedding \( j: V \to V \) when \( V \) is the class of all sets, particularly in the context of large cardinals. To discuss proving Kunen's theorem in Metamath or any proof assistant, it's important to understand the implications and requirem...
[ { "from": "human", "value": "Kunen's inconsistency theorem is an important theorem in set theory on upper bounds for large cardinals.\nIt has long been thought to be able to be encoded on ZFC, but the full implementation has never appeared on Proof Assistant.\n\nLean has enough power to prove it. Because Le...