url
stringlengths 14
2.42k
| text
stringlengths 100
1.02M
| date
stringlengths 19
19
| metadata
stringlengths 1.06k
1.1k
|
|---|---|---|---|
https://leanprover.github.io/theorem_proving_in_lean4/print.html
|
# Theorem Proving in Lean 4
by Jeremy Avigad, Leonardo de Moura, Soonho Kong and Sebastian Ullrich, with contributions from the Lean Community
This version of the text assumes you’re using Lean 4. See the Setting Up Lean section of the Lean 4 Manual to install Lean. The first version of this book was written for Lean 2, and the Lean 3 version is available here.
# Introduction
## Computers and Theorem Proving
Formal verification involves the use of logical and computational methods to establish claims that are expressed in precise mathematical terms. These can include ordinary mathematical theorems, as well as claims that pieces of hardware or software, network protocols, and mechanical and hybrid systems meet their specifications. In practice, there is not a sharp distinction between verifying a piece of mathematics and verifying the correctness of a system: formal verification requires describing hardware and software systems in mathematical terms, at which point establishing claims as to their correctness becomes a form of theorem proving. Conversely, the proof of a mathematical theorem may require a lengthy computation, in which case verifying the truth of the theorem requires verifying that the computation does what it is supposed to do.
The gold standard for supporting a mathematical claim is to provide a proof, and twentieth-century developments in logic show most if not all conventional proof methods can be reduced to a small set of axioms and rules in any of a number of foundational systems. With this reduction, there are two ways that a computer can help establish a claim: it can help find a proof in the first place, and it can help verify that a purported proof is correct.
Automated theorem proving focuses on the "finding" aspect. Resolution theorem provers, tableau theorem provers, fast satisfiability solvers, and so on provide means of establishing the validity of formulas in propositional and first-order logic. Other systems provide search procedures and decision procedures for specific languages and domains, such as linear or nonlinear expressions over the integers or the real numbers. Architectures like SMT ("satisfiability modulo theories") combine domain-general search methods with domain-specific procedures. Computer algebra systems and specialized mathematical software packages provide means of carrying out mathematical computations, establishing mathematical bounds, or finding mathematical objects. A calculation can be viewed as a proof as well, and these systems, too, help establish mathematical claims.
Automated reasoning systems strive for power and efficiency, often at the expense of guaranteed soundness. Such systems can have bugs, and it can be difficult to ensure that the results they deliver are correct. In contrast, interactive theorem proving focuses on the "verification" aspect of theorem proving, requiring that every claim is supported by a proof in a suitable axiomatic foundation. This sets a very high standard: every rule of inference and every step of a calculation has to be justified by appealing to prior definitions and theorems, all the way down to basic axioms and rules. In fact, most such systems provide fully elaborated "proof objects" that can be communicated to other systems and checked independently. Constructing such proofs typically requires much more input and interaction from users, but it allows you to obtain deeper and more complex proofs.
The Lean Theorem Prover aims to bridge the gap between interactive and automated theorem proving, by situating automated tools and methods in a framework that supports user interaction and the construction of fully specified axiomatic proofs. The goal is to support both mathematical reasoning and reasoning about complex systems, and to verify claims in both domains.
Lean's underlying logic has a computational interpretation, and Lean can be viewed equally well as a programming language. More to the point, it can be viewed as a system for writing programs with a precise semantics, as well as reasoning about the functions that the programs compute. Lean also has mechanisms to serve as its own metaprogramming language, which means that you can implement automation and extend the functionality of Lean using Lean itself. These aspects of Lean are explored in a companion tutorial to this one, Programming in Lean 4, though computational aspects of the system will make an appearance here.
The Lean project was launched by Leonardo de Moura at Microsoft Research Redmond in 2013. It is an ongoing, long-term effort, and much of the potential for automation will be realized only gradually over time. Lean is released under the Apache 2.0 license, a permissive open source license that permits others to use and extend the code and mathematical libraries freely.
To install Lean in your computer consider using the Quickstart instructions. The Lean source code, and instructions for building Lean, are available at https://github.com/leanprover/lean4/.
This tutorial describes the current version of Lean, known as Lean 4.
This book is designed to teach you to develop and verify proofs in Lean. Much of the background information you will need in order to do this is not specific to Lean at all. To start with, you will learn the logical system that Lean is based on, a version of dependent type theory that is powerful enough to prove almost any conventional mathematical theorem, and expressive enough to do it in a natural way. More specifically, Lean is based on a version of a system known as the Calculus of Constructions with inductive types. Lean can not only define mathematical objects and express mathematical assertions in dependent type theory, but it also can be used as a language for writing proofs.
Because fully detailed axiomatic proofs are so complicated, the challenge of theorem proving is to have the computer fill in as many of the details as possible. You will learn various methods to support this in dependent type theory. For example, term rewriting, and Lean's automated methods for simplifying terms and expressions automatically. Similarly, methods of elaboration and type inference, which can be used to support flexible forms of algebraic reasoning.
Finally, you will learn about features that are specific to Lean, including the language you use to communicate with the system, and the mechanisms Lean offers for managing complex theories and data.
Throughout the text you will find examples of Lean code like the one below:
theorem and_commutative (p q : Prop) : p ∧ q → q ∧ p :=
fun hpq : p ∧ q =>
have hp : p := And.left hpq
have hq : q := And.right hpq
show q ∧ p from And.intro hq hp
If you are reading the book inside of VS Code, you will see a button that reads "try it!" Pressing the button copies the example to your editor with enough surrounding context to make the code compile correctly. You can type things into the editor and modify the examples, and Lean will check the results and provide feedback continuously as you type. We recommend running the examples and experimenting with the code on your own as you work through the chapters that follow. You can open this book on VS Code by using the command "Lean 4: Open Documentation View".
## Acknowledgments
This tutorial is an open access project maintained on Github. Many people have contributed to the effort, providing corrections, suggestions, examples, and text. We are grateful to Ulrik Buchholz, Kevin Buzzard, Mario Carneiro, Nathan Carter, Eduardo Cavazos, Amine Chaieb, Joe Corneli, William DeMeo, Marcus Klaas de Vries, Ben Dyer, Gabriel Ebner, Anthony Hart, Simon Hudon, Sean Leather, Assia Mahboubi, Gihan Marasingha, Patrick Massot, Christopher John Mazey, Sebastian Ullrich, Floris van Doorn, Daniel Velleman, Théo Zimmerman, Paul Chisholm, Chris Lovett, and Siddhartha Gadgil for their contributions. Please see lean prover and lean community for an up to date list of our amazing contributors.
# Dependent Type Theory
Dependent type theory is a powerful and expressive language, allowing you to express complex mathematical assertions, write complex hardware and software specifications, and reason about both of these in a natural and uniform way. Lean is based on a version of dependent type theory known as the Calculus of Constructions, with a countable hierarchy of non-cumulative universes and inductive types. By the end of this chapter, you will understand much of what this means.
## Simple Type Theory
"Type theory" gets its name from the fact that every expression has an associated type. For example, in a given context, x + 0 may denote a natural number and f may denote a function on the natural numbers. For those who like precise definitions, a Lean natural number is an arbitrary-precision unsigned integer.
Here are some examples of how you can declare objects in Lean and check their types.
/- Define some constants. -/
def m : Nat := 1 -- m is a natural number
def n : Nat := 0
def b1 : Bool := true -- b1 is a Boolean
def b2 : Bool := false
/- Check their types. -/
#check m -- output: Nat
#check n
#check n + 0 -- Nat
#check m * (n + 0) -- Nat
#check b1 -- Bool
#check b1 && b2 -- "&&" is the Boolean and
#check b1 || b2 -- Boolean or
#check true -- Boolean "true"
/- Evaluate -/
#eval 5 * 4 -- 20
#eval m + 2 -- 3
#eval b1 && b2 -- false
Any text between /- and -/ constitutes a comment block that is ignored by Lean. Similarly, two dashes -- indicate that the rest of the line contains a comment that is also ignored. Comment blocks can be nested, making it possible to "comment out" chunks of code, just as in many programming languages.
The def keyword declares new constant symbols into the working environment. In the example above, def m : Nat := 1 defines a new constant m of type Nat whose value is 1. The #check command asks Lean to report their types; in Lean, auxiliary commands that query the system for information typically begin with the hash (#) symbol. The #eval command asks Lean to evaluate the given expression. You should try declaring some constants and type checking some expressions on your own. Declaring new objects in this manner is a good way to experiment with the system.
What makes simple type theory powerful is that you can build new types out of others. For example, if a and b are types, a -> b denotes the type of functions from a to b, and a × b denotes the type of pairs consisting of an element of a paired with an element of b, also known as the Cartesian product. Note that × is a Unicode symbol. The judicious use of Unicode improves legibility, and all modern editors have great support for it. In the Lean standard library, you often see Greek letters to denote types, and the Unicode symbol → as a more compact version of ->.
#check Nat → Nat -- type the arrow as "\to" or "\r"
#check Nat -> Nat -- alternative ASCII notation
#check Nat × Nat -- type the product as "\times"
#check Prod Nat Nat -- alternative notation
#check Nat → Nat → Nat
#check Nat → (Nat → Nat) -- same type as above
#check Nat × Nat → Nat
#check (Nat → Nat) → Nat -- a "functional"
#check Nat.succ -- Nat → Nat
#check (0, 1) -- Nat × Nat
#check Nat.add -- Nat → Nat → Nat
#check Nat.succ 2 -- Nat
#check Nat.add 3 -- Nat → Nat
#check Nat.add 5 2 -- Nat
#check (5, 9).1 -- Nat
#check (5, 9).2 -- Nat
#eval Nat.succ 2 -- 3
#eval Nat.add 5 2 -- 7
#eval (5, 9).1 -- 5
#eval (5, 9).2 -- 9
Once again, you should try some examples on your own.
Let's take a look at some basic syntax. You can enter the unicode arrow → by typing \to or \r or \->. You can also use the ASCII alternative ->, so the expressions Nat -> Nat and Nat → Nat mean the same thing. Both expressions denote the type of functions that take a natural number as input and return a natural number as output. The unicode symbol × for the Cartesian product is entered as \times. You will generally use lower-case Greek letters like α, β, and γ to range over types. You can enter these particular ones with \a, \b, and \g.
There are a few more things to notice here. First, the application of a function f to a value x is denoted f x (e.g., Nat.succ 2). Second, when writing type expressions, arrows associate to the right; for example, the type of Nat.add is Nat → Nat → Nat which is equivalent to Nat → (Nat → Nat). Thus you can view Nat.add as a function that takes a natural number and returns another function that takes a natural number and returns a natural number. In type theory, this is generally more convenient than writing Nat.add as a function that takes a pair of natural numbers as input and returns a natural number as output. For example, it allows you to "partially apply" the function Nat.add. The example above shows that Nat.add 3 has type Nat → Nat, that is, Nat.add 3 returns a function that "waits" for a second argument, n, which is then equivalent to writing Nat.add 3 n.
You have seen that if you have m : Nat and n : Nat, then (m, n) denotes the ordered pair of m and n which is of type Nat × Nat. This gives you a way of creating pairs of natural numbers. Conversely, if you have p : Nat × Nat, then you can write p.1 : Nat and p.2 : Nat. This gives you a way of extracting its two components.
## Types as objects
One way in which Lean's dependent type theory extends simple type theory is that types themselves --- entities like Nat and Bool --- are first-class citizens, which is to say that they themselves are objects. For that to be the case, each of them also has to have a type.
#check Nat -- Type
#check Bool -- Type
#check Nat → Bool -- Type
#check Nat × Bool -- Type
#check Nat → Nat -- ...
#check Nat × Nat → Nat
#check Nat → Nat → Nat
#check Nat → (Nat → Nat)
#check Nat → Nat → Bool
#check (Nat → Nat) → Nat
You can see that each one of the expressions above is an object of type Type. You can also declare new constants for types:
def α : Type := Nat
def β : Type := Bool
def F : Type → Type := List
def G : Type → Type → Type := Prod
#check α -- Type
#check F α -- Type
#check F Nat -- Type
#check G α -- Type → Type
#check G α β -- Type
#check G α Nat -- Type
As the example above suggests, you have already seen an example of a function of type Type → Type → Type, namely, the Cartesian product Prod:
def α : Type := Nat
def β : Type := Bool
#check Prod α β -- Type
#check α × β -- Type
#check Prod Nat Nat -- Type
#check Nat × Nat -- Type
Here is another example: given any type α, the type List α denotes the type of lists of elements of type α.
def α : Type := Nat
#check List α -- Type
#check List Nat -- Type
Given that every expression in Lean has a type, it is natural to ask: what type does Type itself have?
#check Type -- Type 1
You have actually come up against one of the most subtle aspects of Lean's typing system. Lean's underlying foundation has an infinite hierarchy of types:
#check Type -- Type 1
#check Type 1 -- Type 2
#check Type 2 -- Type 3
#check Type 3 -- Type 4
#check Type 4 -- Type 5
Think of Type 0 as a universe of "small" or "ordinary" types. Type 1 is then a larger universe of types, which contains Type 0 as an element, and Type 2 is an even larger universe of types, which contains Type 1 as an element. The list is indefinite, so that there is a Type n for every natural number n. Type is an abbreviation for Type 0:
#check Type
#check Type 0
The following table may help concretize the relationships being discussed. Movement along the x-axis represents a change in the universe, while movement along the y-axis represents a change in what is sometimes referred to as "degree".
sortProp (Sort 0)Type (Sort 1)Type 1 (Sort 2)Type 2 (Sort 3)...
typeTrueBoolNat -> TypeType -> Type 1...
termtrivialtruefun n => Fin nfun (_ : Type) => Type...
Some operations, however, need to be polymorphic over type universes. For example, List α should make sense for any type α, no matter which type universe α lives in. This explains the type annotation of the function List:
#check List -- Type u_1 → Type u_1
Here u_1 is a variable ranging over type levels. The output of the #check command means that whenever α has type Type n, List α also has type Type n. The function Prod is similarly polymorphic:
#check Prod -- Type u_1 → Type u_2 → Type (max u_1 u_2)
To define polymorphic constants, Lean allows you to declare universe variables explicitly using the universe command:
universe u
def F (α : Type u) : Type u := Prod α α
#check F -- Type u → Type u
You can avoid the universe command by providing the universe parameters when defining F.
def F.{u} (α : Type u) : Type u := Prod α α
#check F -- Type u → Type u
## Function Abstraction and Evaluation
Lean provides a fun (or λ) keyword to create a function from an expression as follows:
#check fun (x : Nat) => x + 5 -- Nat → Nat
#check λ (x : Nat) => x + 5 -- λ and fun mean the same thing
#check fun x : Nat => x + 5 -- Nat inferred
#check λ x : Nat => x + 5 -- Nat inferred
You can evaluate a lambda function by passing the required parameters:
#eval (λ x : Nat => x + 5) 10 -- 15
Creating a function from another expression is a process known as lambda abstraction. Suppose you have the variable x : α and you can construct an expression t : β, then the expression fun (x : α) => t, or, equivalently, λ (x : α) => t, is an object of type α → β. Think of this as the function from α to β which maps any value x to the value t.
Here are some more examples
#check fun x : Nat => fun y : Bool => if not y then x + 1 else x + 2
#check fun (x : Nat) (y : Bool) => if not y then x + 1 else x + 2
#check fun x y => if not y then x + 1 else x + 2 -- Nat → Bool → Nat
Lean interprets the final three examples as the same expression; in the last expression, Lean infers the type of x and y from the expression if not y then x + 1 else x + 2.
Some mathematically common examples of operations of functions can be described in terms of lambda abstraction:
def f (n : Nat) : String := toString n
def g (s : String) : Bool := s.length > 0
#check fun x : Nat => x -- Nat → Nat
#check fun x : Nat => true -- Nat → Bool
#check fun x : Nat => g (f x) -- Nat → Bool
#check fun x => g (f x) -- Nat → Bool
Think about what these expressions mean. The expression fun x : Nat => x denotes the identity function on Nat, the expression fun x : Nat => true denotes the constant function that always returns true, and fun x : Nat => g (f x) denotes the composition of f and g. You can, in general, leave off the type annotation and let Lean infer it for you. So, for example, you can write fun x => g (f x) instead of fun x : Nat => g (f x).
You can pass functions as parameters and by giving them names f and g you can then use those functions in the implementation:
#check fun (g : String → Bool) (f : Nat → String) (x : Nat) => g (f x)
-- (String → Bool) → (Nat → String) → Nat → Bool
You can also pass types as parameters:
#check fun (α β γ : Type) (g : β → γ) (f : α → β) (x : α) => g (f x)
The last expression, for example, denotes the function that takes three types, α, β, and γ, and two functions, g : β → γ and f : α → β, and returns the composition of g and f. (Making sense of the type of this function requires an understanding of dependent products, which will be explained below.)
The general form of a lambda expression is fun x : α => t, where the variable x is a "bound variable": it is really a placeholder, whose "scope" does not extend beyond the expression t. For example, the variable b in the expression fun (b : β) (x : α) => b has nothing to do with the constant b declared earlier. In fact, the expression denotes the same function as fun (u : β) (z : α) => u.
Formally, expressions that are the same up to a renaming of bound variables are called alpha equivalent, and are considered "the same." Lean recognizes this equivalence.
Notice that applying a term t : α → β to a term s : α yields an expression t s : β. Returning to the previous example and renaming bound variables for clarity, notice the types of the following expressions:
#check (fun x : Nat => x) 1 -- Nat
#check (fun x : Nat => true) 1 -- Bool
def f (n : Nat) : String := toString n
def g (s : String) : Bool := s.length > 0
#check
(fun (α β γ : Type) (u : β → γ) (v : α → β) (x : α) => u (v x)) Nat String Bool g f 0
-- Bool
As expected, the expression (fun x : Nat => x) 1 has type Nat. In fact, more should be true: applying the expression (fun x : Nat => x) to 1 should "return" the value 1. And, indeed, it does:
#eval (fun x : Nat => x) 1 -- 1
#eval (fun x : Nat => true) 1 -- true
You will see later how these terms are evaluated. For now, notice that this is an important feature of dependent type theory: every term has a computational behavior, and supports a notion of normalization. In principle, two terms that reduce to the same value are called definitionally equal. They are considered "the same" by Lean's type checker, and Lean does its best to recognize and support these identifications.
Lean is a complete programming language. It has a compiler that generates a binary executable and an interactive interpreter. You can use the command #eval to execute expressions, and it is the preferred way of testing your functions.
## Definitions
Recall that the def keyword provides one important way of declaring new named objects.
def double (x : Nat) : Nat :=
x + x
This might look more familiar to you if you know how functions work in other programming languages. The name double is defined as a function that takes an input parameter x of type Nat, where the result of the call is x + x, so it is returning type Nat. You can then invoke this function using:
def double (x : Nat) : Nat :=
x + x
#eval double 3 -- 6
In this case you can think of def as a kind of named lambda. The following yields the same result:
def double : Nat → Nat :=
fun x => x + x
#eval double 3 -- 6
You can omit the type declarations when Lean has enough information to infer it. Type inference is an important part of Lean:
def double :=
fun (x : Nat) => x + x
The general form of a definition is def foo : α := bar where α is the type returned from the expression bar. Lean can usually infer the type α, but it is often a good idea to write it explicitly. This clarifies your intention, and Lean will flag an error if the right-hand side of the definition does not have a matching type.
The right hand side bar can be any expression, not just a lambda. So def can also be used to simply name a value like this:
def pi := 3.141592654
def can take multiple input parameters. Let's create one that adds two natural numbers:
def add (x y : Nat) :=
x + y
#eval add 3 2 -- 5
The parameter list can be separated like this:
def double (x : Nat) : Nat :=
x + x
def add (x : Nat) (y : Nat) :=
x + y
#eval add (double 3) (7 + 9) -- 22
Notice here we called the double function to create the first parameter to add.
You can use other more interesting expressions inside a def:
def greater (x y : Nat) :=
if x > y then x
else y
You can probably guess what this one will do.
You can also define a function that takes another function as input. The following calls a given function twice passing the output of the first invocation to the second:
def double (x : Nat) : Nat :=
x + x
def doTwice (f : Nat → Nat) (x : Nat) : Nat :=
f (f x)
#eval doTwice double 2 -- 8
Now to get a bit more abstract, you can also specify arguments that are like type parameters:
def compose (α β γ : Type) (g : β → γ) (f : α → β) (x : α) : γ :=
g (f x)
This means compose is a function that takes any two functions as input arguments, so long as those functions each take only one input. The type algebra β → γ and α → β means it is a requirement that the type of the output of the second function must match the type of the input to the first function - which makes sense, otherwise the two functions would not be composable.
compose also takes a 3rd argument of type α which it uses to invoke the second function (locally named f) and it passes the result of that function (which is type β) as input to the first function (locally named g). The first function returns a type γ so that is also the return type of the compose function.
compose is also very general in that it works over any type α β γ. This means compose can compose just about any 2 functions so long as they each take one parameter, and so long as the type of output of the second matches the input of the first. For example:
def compose (α β γ : Type) (g : β → γ) (f : α → β) (x : α) : γ :=
g (f x)
def double (x : Nat) : Nat :=
x + x
def square (x : Nat) : Nat :=
x * x
#eval compose Nat Nat Nat double square 3 -- 18
## Local Definitions
Lean also allows you to introduce "local" definitions using the let keyword. The expression let a := t1; t2 is definitionally equal to the result of replacing every occurrence of a in t2 by t1.
#check let y := 2 + 2; y * y -- Nat
#eval let y := 2 + 2; y * y -- 16
def twice_double (x : Nat) : Nat :=
let y := x + x; y * y
#eval twice_double 2 -- 16
Here, twice_double x is definitionally equal to the term (x + x) * (x + x).
You can combine multiple assignments by chaining let statements:
#check let y := 2 + 2; let z := y + y; z * z -- Nat
#eval let y := 2 + 2; let z := y + y; z * z -- 64
The ; can be omitted when a line break is used.
def t (x : Nat) : Nat :=
let y := x + x
y * y
Notice that the meaning of the expression let a := t1; t2 is very similar to the meaning of (fun a => t2) t1, but the two are not the same. In the first expression, you should think of every instance of a in t2 as a syntactic abbreviation for t1. In the second expression, a is a variable, and the expression fun a => t2 has to make sense independently of the value of a. The let construct is a stronger means of abbreviation, and there are expressions of the form let a := t1; t2 that cannot be expressed as (fun a => t2) t1. As an exercise, try to understand why the definition of foo below type checks, but the definition of bar does not.
def foo := let a := Nat; fun x : a => x + 2
/-
def bar := (fun a => fun x : a => x + 2) Nat
-/
# Variables and Sections
Consider the following three function definitions:
def compose (α β γ : Type) (g : β → γ) (f : α → β) (x : α) : γ :=
g (f x)
def doTwice (α : Type) (h : α → α) (x : α) : α :=
h (h x)
def doThrice (α : Type) (h : α → α) (x : α) : α :=
h (h (h x))
Lean provides you with the variable command to make such declarations look more compact:
variable (α β γ : Type)
def compose (g : β → γ) (f : α → β) (x : α) : γ :=
g (f x)
def doTwice (h : α → α) (x : α) : α :=
h (h x)
def doThrice (h : α → α) (x : α) : α :=
h (h (h x))
You can declare variables of any type, not just Type itself:
variable (α β γ : Type)
variable (g : β → γ) (f : α → β) (h : α → α)
variable (x : α)
def compose := g (f x)
def doTwice := h (h x)
def doThrice := h (h (h x))
#print compose
#print doTwice
#print doThrice
Printing them out shows that all three groups of definitions have exactly the same effect.
The variable command instructs Lean to insert the declared variables as bound variables in definitions that refer to them by name. Lean is smart enough to figure out which variables are used explicitly or implicitly in a definition. You can therefore proceed as though α, β, γ, g, f, h, and x are fixed objects when you write your definitions, and let Lean abstract the definitions for you automatically.
When declared in this way, a variable stays in scope until the end of the file you are working on. Sometimes, however, it is useful to limit the scope of a variable. For that purpose, Lean provides the notion of a section:
section useful
variable (α β γ : Type)
variable (g : β → γ) (f : α → β) (h : α → α)
variable (x : α)
def compose := g (f x)
def doTwice := h (h x)
def doThrice := h (h (h x))
end useful
When the section is closed, the variables go out of scope, and cannot be referenced any more.
You do not have to indent the lines within a section. Nor do you have to name a section, which is to say, you can use an anonymous section / end pair. If you do name a section, however, you have to close it using the same name. Sections can also be nested, which allows you to declare new variables incrementally.
# Namespaces
Lean provides you with the ability to group definitions into nested, hierarchical namespaces:
namespace Foo
def a : Nat := 5
def f (x : Nat) : Nat := x + 7
def fa : Nat := f a
def ffa : Nat := f (f a)
#check a
#check f
#check fa
#check ffa
#check Foo.fa
end Foo
-- #check a -- error
-- #check f -- error
#check Foo.a
#check Foo.f
#check Foo.fa
#check Foo.ffa
open Foo
#check a
#check f
#check fa
#check Foo.fa
When you declare that you are working in the namespace Foo, every identifier you declare has a full name with prefix "Foo.". Within the namespace, you can refer to identifiers by their shorter names, but once you end the namespace, you have to use the longer names. Unlike section, namespaces require a name. There is only one anonymous namespace at the root level.
The open command brings the shorter names into the current context. Often, when you import a module, you will want to open one or more of the namespaces it contains, to have access to the short identifiers. But sometimes you will want to leave this information protected by a fully qualified name, for example, when they conflict with identifiers in another namespace you want to use. Thus namespaces give you a way to manage names in your working environment.
For example, Lean groups definitions and theorems involving lists into a namespace List.
#check List.nil
#check List.cons
#check List.map
The command open List allows you to use the shorter names:
open List
#check nil
#check cons
#check map
Like sections, namespaces can be nested:
namespace Foo
def a : Nat := 5
def f (x : Nat) : Nat := x + 7
def fa : Nat := f a
namespace Bar
def ffa : Nat := f (f a)
#check fa
#check ffa
end Bar
#check fa
#check Bar.ffa
end Foo
#check Foo.fa
#check Foo.Bar.ffa
open Foo
#check fa
#check Bar.ffa
Namespaces that have been closed can later be reopened, even in another file:
namespace Foo
def a : Nat := 5
def f (x : Nat) : Nat := x + 7
def fa : Nat := f a
end Foo
#check Foo.a
#check Foo.f
namespace Foo
def ffa : Nat := f (f a)
end Foo
Like sections, nested namespaces have to be closed in the order they are opened. Namespaces and sections serve different purposes: namespaces organize data and sections declare variables for insertion in definitions. Sections are also useful for delimiting the scope of commands such as set_option and open.
In many respects, however, a namespace ... end block behaves the same as a section ... end block. In particular, if you use the variable command within a namespace, its scope is limited to the namespace. Similarly, if you use an open command within a namespace, its effects disappear when the namespace is closed.
## What makes dependent type theory dependent?
The short explanation is that types can depend on parameters. You have already seen a nice example of this: the type List α depends on the argument α, and this dependence is what distinguishes List Nat and List Bool. For another example, consider the type Vector α n, the type of vectors of elements of α of length n. This type depends on two parameters: the type of the elements in the vector (α : Type) and the length of the vector n : Nat.
Suppose you wish to write a function cons which inserts a new element at the head of a list. What type should cons have? Such a function is polymorphic: you expect the cons function for Nat, Bool, or an arbitrary type α to behave the same way. So it makes sense to take the type to be the first argument to cons, so that for any type, α, cons α is the insertion function for lists of type α. In other words, for every α, cons α is the function that takes an element a : α and a list as : List α, and returns a new list, so you have cons α a as : List α.
It is clear that cons α should have type α → List α → List α. But what type should cons have? A first guess might be Type → α → list α → list α, but, on reflection, this does not make sense: the α in this expression does not refer to anything, whereas it should refer to the argument of type Type. In other words, assuming α : Type is the first argument to the function, the type of the next two elements are α and List α. These types vary depending on the first argument, α.
def cons (α : Type) (a : α) (as : List α) : List α :=
List.cons a as
#check cons Nat -- Nat → List Nat → List Nat
#check cons Bool -- Bool → List Bool → List Bool
#check cons -- (α : Type) → α → List α → List α
This is an instance of a dependent function type, or dependent arrow type. Given α : Type and β : α → Type, think of β as a family of types over α, that is, a type β a for each a : α. In that case, the type (a : α) → β a denotes the type of functions f with the property that, for each a : α, f a is an element of β a. In other words, the type of the value returned by f depends on its input.
Notice that (a : α) → β makes sense for any expression β : Type. When the value of β depends on a (as does, for example, the expression β a in the previous paragraph), (a : α) → β denotes a dependent function type. When β doesn't depend on a, (a : α) → β is no different from the type α → β. Indeed, in dependent type theory (and in Lean), α → β is just notation for (a : α) → β when β does not depend on a.
Returning to the example of lists, you can use the command #check to inspect the type of the following List functions. The @ symbol and the difference between the round and curly braces will be explained momentarily.
#check @List.cons -- {α : Type u_1} → α → List α → List α
#check @List.nil -- {α : Type u_1} → List α
#check @List.length -- {α : Type u_1} → List α → Nat
#check @List.append -- {α : Type u_1} → List α → List α → List α
Just as dependent function types (a : α) → β a generalize the notion of a function type α → β by allowing β to depend on α, dependent Cartesian product types (a : α) × β a generalize the Cartesian product α × β in the same way. Dependent products are also called sigma types, and you can also write them as Σ a : α, β a. You can use ⟨a, b⟩ or Sigma.mk a b to create a dependent pair.
universe u v
def f (α : Type u) (β : α → Type v) (a : α) (b : β a) : (a : α) × β a :=
⟨a, b⟩
def g (α : Type u) (β : α → Type v) (a : α) (b : β a) : Σ a : α, β a :=
Sigma.mk a b
def h1 (x : Nat) : Nat :=
(f Type (fun α => α) Nat x).2
#eval h1 5 -- 5
def h2 (x : Nat) : Nat :=
(g Type (fun α => α) Nat x).2
#eval h2 5 -- 5
The functions f and g above denote the same function.
## Implicit Arguments
Suppose we have an implementation of lists as:
universe u
def Lst (α : Type u) : Type u := List α
def Lst.cons (α : Type u) (a : α) (as : Lst α) : Lst α := List.cons a as
def Lst.nil (α : Type u) : Lst α := List.nil
def Lst.append (α : Type u) (as bs : Lst α) : Lst α := List.append as bs
#check Lst -- Type u_1 → Type u_1
#check Lst.cons -- (α : Type u_1) → α → Lst α → Lst α
#check Lst.nil -- (α : Type u_1) → Lst α
#check Lst.append -- (α : Type u_1) → Lst α → Lst α → Lst α
Then, you can construct lists of Nat as follows.
universe u
def Lst (α : Type u) : Type u := List α
def Lst.cons (α : Type u) (a : α) (as : Lst α) : Lst α := List.cons a as
def Lst.nil (α : Type u) : Lst α := List.nil
def Lst.append (α : Type u) (as bs : Lst α) : Lst α := List.append as bs
#check Lst -- Type u_1 → Type u_1
#check Lst.cons -- (α : Type u_1) → α → Lst α → Lst α
#check Lst.nil -- (α : Type u_1) → Lst α
#check Lst.append -- (α : Type u_1) → Lst α → Lst α → Lst α
#check Lst.cons Nat 0 (Lst.nil Nat)
def as : Lst Nat := Lst.nil Nat
def bs : Lst Nat := Lst.cons Nat 5 (Lst.nil Nat)
#check Lst.append Nat as bs
Because the constructors are polymorphic over types, we have to insert the type Nat as an argument repeatedly. But this information is redundant: one can infer the argument α in Lst.cons Nat 5 (Lst.nil Nat) from the fact that the second argument, 5, has type Nat. One can similarly infer the argument in Lst.nil Nat, not from anything else in that expression, but from the fact that it is sent as an argument to the function Lst.cons, which expects an element of type Lst α in that position.
This is a central feature of dependent type theory: terms carry a lot of information, and often some of that information can be inferred from the context. In Lean, one uses an underscore, _, to specify that the system should fill in the information automatically. This is known as an "implicit argument."
universe u
def Lst (α : Type u) : Type u := List α
def Lst.cons (α : Type u) (a : α) (as : Lst α) : Lst α := List.cons a as
def Lst.nil (α : Type u) : Lst α := List.nil
def Lst.append (α : Type u) (as bs : Lst α) : Lst α := List.append as bs
#check Lst -- Type u_1 → Type u_1
#check Lst.cons -- (α : Type u_1) → α → Lst α → Lst α
#check Lst.nil -- (α : Type u_1) → Lst α
#check Lst.append -- (α : Type u_1) → Lst α → Lst α → Lst α
#check Lst.cons _ 0 (Lst.nil _)
def as : Lst Nat := Lst.nil _
def bs : Lst Nat := Lst.cons _ 5 (Lst.nil _)
#check Lst.append _ as bs
It is still tedious, however, to type all these underscores. When a function takes an argument that can generally be inferred from context, Lean allows you to specify that this argument should, by default, be left implicit. This is done by putting the arguments in curly braces, as follows:
universe u
def Lst (α : Type u) : Type u := List α
def Lst.cons {α : Type u} (a : α) (as : Lst α) : Lst α := List.cons a as
def Lst.nil {α : Type u} : Lst α := List.nil
def Lst.append {α : Type u} (as bs : Lst α) : Lst α := List.append as bs
#check Lst.cons 0 Lst.nil
def as : Lst Nat := Lst.nil
def bs : Lst Nat := Lst.cons 5 Lst.nil
#check Lst.append as bs
All that has changed are the braces around α : Type u in the declaration of the variables. We can also use this device in function definitions:
universe u
def ident {α : Type u} (x : α) := x
#check ident -- ?m → ?m
#check ident 1 -- Nat
#check ident "hello" -- String
#check @ident -- {α : Type u_1} → α → α
This makes the first argument to ident implicit. Notationally, this hides the specification of the type, making it look as though ident simply takes an argument of any type. In fact, the function id is defined in the standard library in exactly this way. We have chosen a nontraditional name here only to avoid a clash of names.
Variables can also be specified as implicit when they are declared with the variable command:
universe u
section
variable {α : Type u}
variable (x : α)
def ident := x
end
#check ident
#check ident 4
#check ident "hello"
This definition of ident here has the same effect as the one above.
Lean has very complex mechanisms for instantiating implicit arguments, and we will see that they can be used to infer function types, predicates, and even proofs. The process of instantiating these "holes," or "placeholders," in a term is often known as elaboration. The presence of implicit arguments means that at times there may be insufficient information to fix the meaning of an expression precisely. An expression like id or List.nil is said to be polymorphic, because it can take on different meanings in different contexts.
One can always specify the type T of an expression e by writing (e : T). This instructs Lean's elaborator to use the value T as the type of e when trying to resolve implicit arguments. In the second pair of examples below, this mechanism is used to specify the desired types of the expressions id and List.nil:
#check List.nil -- List ?m
#check id -- ?m → ?m
#check (List.nil : List Nat) -- List Nat
#check (id : Nat → Nat) -- Nat → Nat
Numerals are overloaded in Lean, but when the type of a numeral cannot be inferred, Lean assumes, by default, that it is a natural number. So the expressions in the first two #check commands below are elaborated in the same way, whereas the third #check command interprets 2 as an integer.
#check 2 -- Nat
#check (2 : Nat) -- Nat
#check (2 : Int) -- Int
Sometimes, however, we may find ourselves in a situation where we have declared an argument to a function to be implicit, but now want to provide the argument explicitly. If foo is such a function, the notation @foo denotes the same function with all the arguments made explicit.
#check @id -- {α : Type u_1} → α → α
#check @id Nat -- Nat → Nat
#check @id Bool -- Bool → Bool
#check @id Nat 1 -- Nat
#check @id Bool true -- Bool
Notice that now the first #check command gives the type of the identifier, id, without inserting any placeholders. Moreover, the output indicates that the first argument is implicit.
# Propositions and Proofs
By now, you have seen some ways of defining objects and functions in Lean. In this chapter, we will begin to explain how to write mathematical assertions and proofs in the language of dependent type theory as well.
## Propositions as Types
One strategy for proving assertions about objects defined in the language of dependent type theory is to layer an assertion language and a proof language on top of the definition language. But there is no reason to multiply languages in this way: dependent type theory is flexible and expressive, and there is no reason we cannot represent assertions and proofs in the same general framework.
For example, we could introduce a new type, Prop, to represent propositions, and introduce constructors to build new propositions from others.
def Implies (p q : Prop) : Prop := p → q
#check And -- Prop → Prop → Prop
#check Or -- Prop → Prop → Prop
#check Not -- Prop → Prop
#check Implies -- Prop → Prop → Prop
variable (p q r : Prop)
#check And p q -- Prop
#check Or (And p q) r -- Prop
#check Implies (And p q) (And q p) -- Prop
We could then introduce, for each element p : Prop, another type Proof p, for the type of proofs of p. An "axiom" would be a constant of such a type.
def Implies (p q : Prop) : Prop := p → q
structure Proof (p : Prop) : Type where
proof : p
#check Proof -- Proof : Prop → Type
axiom and_comm (p q : Prop) : Proof (Implies (And p q) (And q p))
variable (p q : Prop)
#check and_comm p q -- Proof (Implies (And p q) (And q p))
In addition to axioms, however, we would also need rules to build new proofs from old ones. For example, in many proof systems for propositional logic, we have the rule of modus ponens:
From a proof of Implies p q and a proof of p, we obtain a proof of q.
We could represent this as follows:
def Implies (p q : Prop) : Prop := p → q
structure Proof (p : Prop) : Type where
proof : p
axiom modus_ponens : (p q : Prop) → Proof (Implies p q) → Proof p → Proof q
Systems of natural deduction for propositional logic also typically rely on the following rule:
Suppose that, assuming p as a hypothesis, we have a proof of q. Then we can "cancel" the hypothesis and obtain a proof of Implies p q.
We could render this as follows:
def Implies (p q : Prop) : Prop := p → q
structure Proof (p : Prop) : Type where
proof : p
axiom implies_intro : (p q : Prop) → (Proof p → Proof q) → Proof (Implies p q)
This approach would provide us with a reasonable way of building assertions and proofs. Determining that an expression t is a correct proof of assertion p would then simply be a matter of checking that t has type Proof p.
Some simplifications are possible, however. To start with, we can avoid writing the term Proof repeatedly by conflating Proof p with p itself. In other words, whenever we have p : Prop, we can interpret p as a type, namely, the type of its proofs. We can then read t : p as the assertion that t is a proof of p.
Moreover, once we make this identification, the rules for implication show that we can pass back and forth between Implies p q and p → q. In other words, implication between propositions p and q corresponds to having a function that takes any element of p to an element of q. As a result, the introduction of the connective Implies is entirely redundant: we can use the usual function space constructor p → q from dependent type theory as our notion of implication.
This is the approach followed in the Calculus of Constructions, and hence in Lean as well. The fact that the rules for implication in a proof system for natural deduction correspond exactly to the rules governing abstraction and application for functions is an instance of the Curry-Howard isomorphism, sometimes known as the propositions-as-types paradigm. In fact, the type Prop is syntactic sugar for Sort 0, the very bottom of the type hierarchy described in the last chapter. Moreover, Type u is also just syntactic sugar for Sort (u+1). Prop has some special features, but like the other type universes, it is closed under the arrow constructor: if we have p q : Prop, then p → q : Prop.
There are at least two ways of thinking about propositions as types. To some who take a constructive view of logic and mathematics, this is a faithful rendering of what it means to be a proposition: a proposition p represents a sort of data type, namely, a specification of the type of data that constitutes a proof. A proof of p is then simply an object t : p of the right type.
Those not inclined to this ideology can view it, rather, as a simple coding trick. To each proposition p we associate a type that is empty if p is false and has a single element, say *, if p is true. In the latter case, let us say that (the type associated with) p is inhabited. It just so happens that the rules for function application and abstraction can conveniently help us keep track of which elements of Prop are inhabited. So constructing an element t : p tells us that p is indeed true. You can think of the inhabitant of p as being the "fact that p is true." A proof of p → q uses "the fact that p is true" to obtain "the fact that q is true."
Indeed, if p : Prop is any proposition, Lean's kernel treats any two elements t1 t2 : p as being definitionally equal, much the same way as it treats (fun x => t) s and t[s/x] as definitionally equal. This is known as proof irrelevance, and is consistent with the interpretation in the last paragraph. It means that even though we can treat proofs t : p as ordinary objects in the language of dependent type theory, they carry no information beyond the fact that p is true.
The two ways we have suggested thinking about the propositions-as-types paradigm differ in a fundamental way. From the constructive point of view, proofs are abstract mathematical objects that are denoted by suitable expressions in dependent type theory. In contrast, if we think in terms of the coding trick described above, then the expressions themselves do not denote anything interesting. Rather, it is the fact that we can write them down and check that they are well-typed that ensures that the proposition in question is true. In other words, the expressions themselves are the proofs.
In the exposition below, we will slip back and forth between these two ways of talking, at times saying that an expression "constructs" or "produces" or "returns" a proof of a proposition, and at other times simply saying that it "is" such a proof. This is similar to the way that computer scientists occasionally blur the distinction between syntax and semantics by saying, at times, that a program "computes" a certain function, and at other times speaking as though the program "is" the function in question.
In any case, all that really matters is the bottom line. To formally express a mathematical assertion in the language of dependent type theory, we need to exhibit a term p : Prop. To prove that assertion, we need to exhibit a term t : p. Lean's task, as a proof assistant, is to help us to construct such a term, t, and to verify that it is well-formed and has the correct type.
## Working with Propositions as Types
In the propositions-as-types paradigm, theorems involving only → can be proved using lambda abstraction and application. In Lean, the theorem command introduces a new theorem:
variable {p : Prop}
variable {q : Prop}
theorem t1 : p → q → p := fun hp : p => fun hq : q => hp
Compare this proof to the expression fun x : α => fun y : β => x of type α → β → α, where α and β are data types. This describes the function that takes arguments x and y of type α and β, respectively, and returns x. The proof of t1 has the same form, the only difference being that p and q are elements of Prop rather than Type. Intuitively, our proof of p → q → p assumes p and q are true, and uses the first hypothesis (trivially) to establish that the conclusion, p, is true.
Note that the theorem command is really a version of the def command: under the propositions and types correspondence, proving the theorem p → q → p is really the same as defining an element of the associated type. To the kernel type checker, there is no difference between the two.
There are a few pragmatic differences between definitions and theorems, however. In normal circumstances, it is never necessary to unfold the "definition" of a theorem; by proof irrelevance, any two proofs of that theorem are definitionally equal. Once the proof of a theorem is complete, typically we only need to know that the proof exists; it doesn't matter what the proof is. In light of that fact, Lean tags proofs as irreducible, which serves as a hint to the parser (more precisely, the elaborator) that there is generally no need to unfold it when processing a file. In fact, Lean is generally able to process and check proofs in parallel, since assessing the correctness of one proof does not require knowing the details of another.
As with definitions, the #print command will show you the proof of a theorem.
variable {p : Prop}
variable {q : Prop}
theorem t1 : p → q → p := fun hp : p => fun hq : q => hp
#print t1
Notice that the lambda abstractions hp : p and hq : q can be viewed as temporary assumptions in the proof of t1. Lean also allows us to specify the type of the final term hp, explicitly, with a show statement.
variable {p : Prop}
variable {q : Prop}
theorem t1 : p → q → p :=
fun hp : p =>
fun hq : q =>
show p from hp
Adding such extra information can improve the clarity of a proof and help detect errors when writing a proof. The show command does nothing more than annotate the type, and, internally, all the presentations of t1 that we have seen produce the same term.
As with ordinary definitions, we can move the lambda-abstracted variables to the left of the colon:
variable {p : Prop}
variable {q : Prop}
theorem t1 (hp : p) (hq : q) : p := hp
#print t1 -- p → q → p
Now we can apply the theorem t1 just as a function application.
variable {p : Prop}
variable {q : Prop}
theorem t1 (hp : p) (hq : q) : p := hp
axiom hp : p
theorem t2 : q → p := t1 hp
Here, the axiom declaration postulates the existence of an element of the given type and may compromise logical consistency. For example, we can use it to postulate the empty type False has an element.
axiom unsound : False
-- Everything follows from false
theorem ex : 1 = 0 :=
False.elim unsound
Declaring an "axiom" hp : p is tantamount to declaring that p is true, as witnessed by hp. Applying the theorem t1 : p → q → p to the fact hp : p that p is true yields the theorem t1 hp : q → p.
Recall that we can also write theorem t1 as follows:
theorem t1 {p q : Prop} (hp : p) (hq : q) : p := hp
#print t1
The type of t1 is now ∀ {p q : Prop}, p → q → p. We can read this as the assertion "for every pair of propositions p q, we have p → q → p." For example, we can move all parameters to the right of the colon:
theorem t1 : ∀ {p q : Prop}, p → q → p :=
fun {p q : Prop} (hp : p) (hq : q) => hp
If p and q have been declared as variables, Lean will generalize them for us automatically:
variable {p q : Prop}
theorem t1 : p → q → p := fun (hp : p) (hq : q) => hp
In fact, by the propositions-as-types correspondence, we can declare the assumption hp that p holds, as another variable:
variable {p q : Prop}
variable (hp : p)
theorem t1 : q → p := fun (hq : q) => hp
Lean detects that the proof uses hp and automatically adds hp : p as a premise. In all cases, the command #print t1 still yields ∀ p q : Prop, p → q → p. Remember that this type can just as well be written ∀ (p q : Prop) (hp : p) (hq : q), p, since the arrow denotes nothing more than an arrow type in which the target does not depend on the bound variable.
When we generalize t1 in such a way, we can then apply it to different pairs of propositions, to obtain different instances of the general theorem.
theorem t1 (p q : Prop) (hp : p) (hq : q) : p := hp
variable (p q r s : Prop)
#check t1 p q -- p → q → p
#check t1 r s -- r → s → r
#check t1 (r → s) (s → r) -- (r → s) → (s → r) → r → s
variable (h : r → s)
#check t1 (r → s) (s → r) h -- (s → r) → r → s
Once again, using the propositions-as-types correspondence, the variable h of type r → s can be viewed as the hypothesis, or premise, that r → s holds.
As another example, let us consider the composition function discussed in the last chapter, now with propositions instead of types.
variable (p q r s : Prop)
theorem t2 (h₁ : q → r) (h₂ : p → q) : p → r :=
fun h₃ : p =>
show r from h₁ (h₂ h₃)
As a theorem of propositional logic, what does t2 say?
Note that it is often useful to use numeric unicode subscripts, entered as \0, \1, \2, ..., for hypotheses, as we did in this example.
## Propositional Logic
Lean defines all the standard logical connectives and notation. The propositional connectives come with the following notation:
AsciiUnicodeEditor shortcutDefinition
TrueTrue
FalseFalse
Not¬\not, \negNot
/\\andAnd
\/\orOr
->\to, \r, \imp
<->\iff, \lrIff
They all take values in Prop.
variable (p q : Prop)
#check p → q → p ∧ q
#check ¬p → p ↔ False
#check p ∨ q → q ∨ p
The order of operations is as follows: unary negation ¬ binds most strongly, then ∧, then ∨, then →, and finally ↔. For example, a ∧ b → c ∨ d ∧ e means (a ∧ b) → (c ∨ (d ∧ e)). Remember that → associates to the right (nothing changes now that the arguments are elements of Prop, instead of some other Type), as do the other binary connectives. So if we have p q r : Prop, the expression p → q → r reads "if p, then if q, then r." This is just the "curried" form of p ∧ q → r.
In the last chapter we observed that lambda abstraction can be viewed as an "introduction rule" for →. In the current setting, it shows how to "introduce" or establish an implication. Application can be viewed as an "elimination rule," showing how to "eliminate" or use an implication in a proof. The other propositional connectives are defined in Lean's library in the file Prelude.core (see importing files for more information on the library hierarchy), and each connective comes with its canonical introduction and elimination rules.
### Conjunction
The expression And.intro h1 h2 builds a proof of p ∧ q using proofs h1 : p and h2 : q. It is common to describe And.intro as the and-introduction rule. In the next example we use And.intro to create a proof of p → q → p ∧ q.
variable (p q : Prop)
example (hp : p) (hq : q) : p ∧ q := And.intro hp hq
#check fun (hp : p) (hq : q) => And.intro hp hq
The example command states a theorem without naming it or storing it in the permanent context. Essentially, it just checks that the given term has the indicated type. It is convenient for illustration, and we will use it often.
The expression And.left h creates a proof of p from a proof h : p ∧ q. Similarly, And.right h is a proof of q. They are commonly known as the left and right and-elimination rules.
variable (p q : Prop)
example (h : p ∧ q) : p := And.left h
example (h : p ∧ q) : q := And.right h
We can now prove p ∧ q → q ∧ p with the following proof term.
variable (p q : Prop)
example (h : p ∧ q) : q ∧ p :=
And.intro (And.right h) (And.left h)
Notice that and-introduction and and-elimination are similar to the pairing and projection operations for the Cartesian product. The difference is that given hp : p and hq : q, And.intro hp hq has type p ∧ q : Prop, while Prod hp hq has type p × q : Type. The similarity between ∧ and × is another instance of the Curry-Howard isomorphism, but in contrast to implication and the function space constructor, ∧ and × are treated separately in Lean. With the analogy, however, the proof we have just constructed is similar to a function that swaps the elements of a pair.
We will see in Chapter Structures and Records that certain types in Lean are structures, which is to say, the type is defined with a single canonical constructor which builds an element of the type from a sequence of suitable arguments. For every p q : Prop, p ∧ q is an example: the canonical way to construct an element is to apply And.intro to suitable arguments hp : p and hq : q. Lean allows us to use anonymous constructor notation ⟨arg1, arg2, ...⟩ in situations like these, when the relevant type is an inductive type and can be inferred from the context. In particular, we can often write ⟨hp, hq⟩ instead of And.intro hp hq:
variable (p q : Prop)
variable (hp : p) (hq : q)
#check (⟨hp, hq⟩ : p ∧ q)
These angle brackets are obtained by typing \< and \>, respectively.
Lean provides another useful syntactic gadget. Given an expression e of an inductive type Foo (possibly applied to some arguments), the notation e.bar is shorthand for Foo.bar e. This provides a convenient way of accessing functions without opening a namespace. For example, the following two expressions mean the same thing:
variable (xs : List Nat)
#check List.length xs
#check xs.length
As a result, given h : p ∧ q, we can write h.left for And.left h and h.right for And.right h. We can therefore rewrite the sample proof above conveniently as follows:
variable (p q : Prop)
example (h : p ∧ q) : q ∧ p :=
⟨h.right, h.left⟩
There is a fine line between brevity and obfuscation, and omitting information in this way can sometimes make a proof harder to read. But for straightforward constructions like the one above, when the type of h and the goal of the construction are salient, the notation is clean and effective.
It is common to iterate constructions like "And." Lean also allows you to flatten nested constructors that associate to the right, so that these two proofs are equivalent:
variable (p q : Prop)
example (h : p ∧ q) : q ∧ p ∧ q :=
⟨h.right, ⟨h.left, h.right⟩⟩
example (h : p ∧ q) : q ∧ p ∧ q :=
⟨h.right, h.left, h.right⟩
This is often useful as well.
### Disjunction
The expression Or.intro_left q hp creates a proof of p ∨ q from a proof hp : p. Similarly, Or.intro_right p hq creates a proof for p ∨ q using a proof hq : q. These are the left and right or-introduction rules.
variable (p q : Prop)
example (hp : p) : p ∨ q := Or.intro_left q hp
example (hq : q) : p ∨ q := Or.intro_right p hq
The or-elimination rule is slightly more complicated. The idea is that we can prove r from p ∨ q, by showing that r follows from p and that r follows from q. In other words, it is a proof by cases. In the expression Or.elim hpq hpr hqr, Or.elim takes three arguments, hpq : p ∨ q, hpr : p → r and hqr : q → r, and produces a proof of r. In the following example, we use Or.elim to prove p ∨ q → q ∨ p.
variable (p q r : Prop)
example (h : p ∨ q) : q ∨ p :=
Or.elim h
(fun hp : p =>
show q ∨ p from Or.intro_right q hp)
(fun hq : q =>
show q ∨ p from Or.intro_left p hq)
In most cases, the first argument of Or.intro_right and Or.intro_left can be inferred automatically by Lean. Lean therefore provides Or.inr and Or.inl which can be viewed as shorthand for Or.intro_right _ and Or.intro_left _. Thus the proof term above could be written more concisely:
variable (p q r : Prop)
example (h : p ∨ q) : q ∨ p :=
Or.elim h (fun hp => Or.inr hp) (fun hq => Or.inl hq)
Notice that there is enough information in the full expression for Lean to infer the types of hp and hq as well. But using the type annotations in the longer version makes the proof more readable, and can help catch and debug errors.
Because Or has two constructors, we cannot use anonymous constructor notation. But we can still write h.elim instead of Or.elim h:
variable (p q r : Prop)
example (h : p ∨ q) : q ∨ p :=
h.elim (fun hp => Or.inr hp) (fun hq => Or.inl hq)
Once again, you should exercise judgment as to whether such abbreviations enhance or diminish readability.
### Negation and Falsity
Negation, ¬p, is actually defined to be p → False, so we obtain ¬p by deriving a contradiction from p. Similarly, the expression hnp hp produces a proof of False from hp : p and hnp : ¬p. The next example uses both these rules to produce a proof of (p → q) → ¬q → ¬p. (The symbol ¬ is produced by typing \not or \neg.)
variable (p q : Prop)
example (hpq : p → q) (hnq : ¬q) : ¬p :=
fun hp : p =>
show False from hnq (hpq hp)
The connective False has a single elimination rule, False.elim, which expresses the fact that anything follows from a contradiction. This rule is sometimes called ex falso (short for ex falso sequitur quodlibet), or the principle of explosion.
variable (tp q : Prop)
example (hp : p) (hnp : ¬p) : q := False.elim (hnp hp)
The arbitrary fact, q, that follows from falsity is an implicit argument in False.elim and is inferred automatically. This pattern, deriving an arbitrary fact from contradictory hypotheses, is quite common, and is represented by absurd.
variable (p q : Prop)
example (hp : p) (hnp : ¬p) : q := absurd hp hnp
Here, for example, is a proof of ¬p → q → (q → p) → r:
variable (p q r : Prop)
example (hnp : ¬p) (hq : q) (hqp : q → p) : r :=
absurd (hqp hq) hnp
Incidentally, just as False has only an elimination rule, True has only an introduction rule, True.intro : true. In other words, True is simply true, and has a canonical proof, True.intro.
### Logical Equivalence
The expression Iff.intro h1 h2 produces a proof of p ↔ q from h1 : p → q and h2 : q → p. The expression Iff.mp h produces a proof of p → q from h : p ↔ q. Similarly, Iff.mpr h produces a proof of q → p from h : p ↔ q. Here is a proof of p ∧ q ↔ q ∧ p:
variable (p q : Prop)
theorem and_swap : p ∧ q ↔ q ∧ p :=
Iff.intro
(fun h : p ∧ q =>
show q ∧ p from And.intro (And.right h) (And.left h))
(fun h : q ∧ p =>
show p ∧ q from And.intro (And.right h) (And.left h))
#check and_swap p q -- p ∧ q ↔ q ∧ p
variable (h : p ∧ q)
example : q ∧ p := Iff.mp (and_swap p q) h
We can use the anonymous constructor notation to construct a proof of p ↔ q from proofs of the forward and backward directions, and we can also use . notation with mp and mpr. The previous examples can therefore be written concisely as follows:
variable (p q : Prop)
theorem and_swap : p ∧ q ↔ q ∧ p :=
⟨ fun h => ⟨h.right, h.left⟩, fun h => ⟨h.right, h.left⟩ ⟩
example (h : p ∧ q) : q ∧ p := (and_swap p q).mp h
## Introducing Auxiliary Subgoals
This is a good place to introduce another device Lean offers to help structure long proofs, namely, the have construct, which introduces an auxiliary subgoal in a proof. Here is a small example, adapted from the last section:
variable (p q : Prop)
example (h : p ∧ q) : q ∧ p :=
have hp : p := h.left
have hq : q := h.right
show q ∧ p from And.intro hq hp
Internally, the expression have h : p := s; t produces the term (fun (h : p) => t) s. In other words, s is a proof of p, t is a proof of the desired conclusion assuming h : p, and the two are combined by a lambda abstraction and application. This simple device is extremely useful when it comes to structuring long proofs, since we can use intermediate have's as stepping stones leading to the final goal.
Lean also supports a structured way of reasoning backwards from a goal, which models the "suffices to show" construction in ordinary mathematics. The next example simply permutes the last two lines in the previous proof.
variable (p q : Prop)
example (h : p ∧ q) : q ∧ p :=
have hp : p := h.left
suffices hq : q from And.intro hq hp
show q from And.right h
Writing suffices hq : q leaves us with two goals. First, we have to show that it indeed suffices to show q, by proving the original goal of q ∧ p with the additional hypothesis hq : q. Finally, we have to show q.
## Classical Logic
The introduction and elimination rules we have seen so far are all constructive, which is to say, they reflect a computational understanding of the logical connectives based on the propositions-as-types correspondence. Ordinary classical logic adds to this the law of the excluded middle, p ∨ ¬p. To use this principle, you have to open the classical namespace.
open Classical
variable (p : Prop)
#check em p
Intuitively, the constructive "Or" is very strong: asserting p ∨ q amounts to knowing which is the case. If RH represents the Riemann hypothesis, a classical mathematician is willing to assert RH ∨ ¬RH, even though we cannot yet assert either disjunct.
One consequence of the law of the excluded middle is the principle of double-negation elimination:
open Classical
theorem dne {p : Prop} (h : ¬¬p) : p :=
Or.elim (em p)
(fun hp : p => hp)
(fun hnp : ¬p => absurd hnp h)
Double-negation elimination allows one to prove any proposition, p, by assuming ¬p and deriving false, because that amounts to proving ¬¬p. In other words, double-negation elimination allows one to carry out a proof by contradiction, something which is not generally possible in constructive logic. As an exercise, you might try proving the converse, that is, showing that em can be proved from dne.
The classical axioms also give you access to additional patterns of proof that can be justified by appeal to em. For example, one can carry out a proof by cases:
open Classical
variable (p : Prop)
example (h : ¬¬p) : p :=
byCases
(fun h1 : p => h1)
(fun h1 : ¬p => absurd h1 h)
Or you can carry out a proof by contradiction:
open Classical
variable (p : Prop)
example (h : ¬¬p) : p :=
(fun h1 : ¬p =>
show False from h h1)
If you are not used to thinking constructively, it may take some time for you to get a sense of where classical reasoning is used. It is needed in the following example because, from a constructive standpoint, knowing that p and q are not both true does not necessarily tell you which one is false:
open Classical
variable (p q : Prop)
example (h : ¬(p ∧ q)) : ¬p ∨ ¬q :=
Or.elim (em p)
(fun hp : p =>
Or.inr
(show ¬q from
fun hq : q =>
h ⟨hp, hq⟩))
(fun hp : ¬p =>
Or.inl hp)
We will see later that there are situations in constructive logic where principles like excluded middle and double-negation elimination are permissible, and Lean supports the use of classical reasoning in such contexts without relying on excluded middle.
The full list of axioms that are used in Lean to support classical reasoning are discussed in Axioms and Computation.
## Examples of Propositional Validities
Lean's standard library contains proofs of many valid statements of propositional logic, all of which you are free to use in proofs of your own. The following list includes a number of common identities.
Commutativity:
1. p ∧ q ↔ q ∧ p
2. p ∨ q ↔ q ∨ p
Associativity:
1. (p ∧ q) ∧ r ↔ p ∧ (q ∧ r)
2. (p ∨ q) ∨ r ↔ p ∨ (q ∨ r)
Distributivity:
1. p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r)
2. p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
Other properties:
1. (p → (q → r)) ↔ (p ∧ q → r)
2. ((p ∨ q) → r) ↔ (p → r) ∧ (q → r)
3. ¬(p ∨ q) ↔ ¬p ∧ ¬q
4. ¬p ∨ ¬q → ¬(p ∧ q)
5. ¬(p ∧ ¬p)
6. p ∧ ¬q → ¬(p → q)
7. ¬p → (p → q)
8. (¬p ∨ q) → (p → q)
9. p ∨ False ↔ p
10. p ∧ False ↔ False
11. ¬(p ↔ ¬p)
12. (p → q) → (¬q → ¬p)
These require classical reasoning:
1. (p → r ∨ s) → ((p → r) ∨ (p → s))
2. ¬(p ∧ q) → ¬p ∨ ¬q
3. ¬(p → q) → p ∧ ¬q
4. (p → q) → (¬p ∨ q)
5. (¬q → ¬p) → (p → q)
6. p ∨ ¬p
7. (((p → q) → p) → p)
The sorry identifier magically produces a proof of anything, or provides an object of any data type at all. Of course, it is unsound as a proof method -- for example, you can use it to prove False -- and Lean produces severe warnings when files use or import theorems which depend on it. But it is very useful for building long proofs incrementally. Start writing the proof from the top down, using sorry to fill in subproofs. Make sure Lean accepts the term with all the sorry's; if not, there are errors that you need to correct. Then go back and replace each sorry with an actual proof, until no more remain.
Here is another useful trick. Instead of using sorry, you can use an underscore _ as a placeholder. Recall this tells Lean that the argument is implicit, and should be filled in automatically. If Lean tries to do so and fails, it returns with an error message "don't know how to synthesize placeholder," followed by the type of the term it is expecting, and all the objects and hypotheses available in the context. In other words, for each unresolved placeholder, Lean reports the subgoal that needs to be filled at that point. You can then construct a proof by incrementally filling in these placeholders.
For reference, here are two sample proofs of validities taken from the list above.
open Classical
-- distributivity
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) :=
Iff.intro
(fun h : p ∧ (q ∨ r) =>
have hp : p := h.left
Or.elim (h.right)
(fun hq : q =>
show (p ∧ q) ∨ (p ∧ r) from Or.inl ⟨hp, hq⟩)
(fun hr : r =>
show (p ∧ q) ∨ (p ∧ r) from Or.inr ⟨hp, hr⟩))
(fun h : (p ∧ q) ∨ (p ∧ r) =>
Or.elim h
(fun hpq : p ∧ q =>
have hp : p := hpq.left
have hq : q := hpq.right
show p ∧ (q ∨ r) from ⟨hp, Or.inl hq⟩)
(fun hpr : p ∧ r =>
have hp : p := hpr.left
have hr : r := hpr.right
show p ∧ (q ∨ r) from ⟨hp, Or.inr hr⟩))
-- an example that requires classical reasoning
example (p q : Prop) : ¬(p ∧ ¬q) → (p → q) :=
fun h : ¬(p ∧ ¬q) =>
fun hp : p =>
show q from
Or.elim (em q)
(fun hq : q => hq)
(fun hnq : ¬q => absurd (And.intro hp hnq) h)
## Exercises
Prove the following identities, replacing the "sorry" placeholders with actual proofs.
variable (p q r : Prop)
-- commutativity of ∧ and ∨
example : p ∧ q ↔ q ∧ p := sorry
example : p ∨ q ↔ q ∨ p := sorry
-- associativity of ∧ and ∨
example : (p ∧ q) ∧ r ↔ p ∧ (q ∧ r) := sorry
example : (p ∨ q) ∨ r ↔ p ∨ (q ∨ r) := sorry
-- distributivity
example : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := sorry
example : p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r) := sorry
-- other properties
example : (p → (q → r)) ↔ (p ∧ q → r) := sorry
example : ((p ∨ q) → r) ↔ (p → r) ∧ (q → r) := sorry
example : ¬(p ∨ q) ↔ ¬p ∧ ¬q := sorry
example : ¬p ∨ ¬q → ¬(p ∧ q) := sorry
example : ¬(p ∧ ¬p) := sorry
example : p ∧ ¬q → ¬(p → q) := sorry
example : ¬p → (p → q) := sorry
example : (¬p ∨ q) → (p → q) := sorry
example : p ∨ False ↔ p := sorry
example : p ∧ False ↔ False := sorry
example : (p → q) → (¬q → ¬p) := sorry
Prove the following identities, replacing the "sorry" placeholders with actual proofs. These require classical reasoning.
open Classical
variable (p q r : Prop)
example : (p → q ∨ r) → ((p → q) ∨ (p → r)) := sorry
example : ¬(p ∧ q) → ¬p ∨ ¬q := sorry
example : ¬(p → q) → p ∧ ¬q := sorry
example : (p → q) → (¬p ∨ q) := sorry
example : (¬q → ¬p) → (p → q) := sorry
example : p ∨ ¬p := sorry
example : (((p → q) → p) → p) := sorry
Prove ¬(p ↔ ¬p) without using classical logic.
# Quantifiers and Equality
The last chapter introduced you to methods that construct proofs of statements involving the propositional connectives. In this chapter, we extend the repertoire of logical constructions to include the universal and existential quantifiers, and the equality relation.
## The Universal Quantifier
Notice that if α is any type, we can represent a unary predicate p on α as an object of type α → Prop. In that case, given x : α, p x denotes the assertion that p holds of x. Similarly, an object r : α → α → Prop denotes a binary relation on α: given x y : α, r x y denotes the assertion that x is related to y.
The universal quantifier, ∀ x : α, p x is supposed to denote the assertion that "for every x : α, p x" holds. As with the propositional connectives, in systems of natural deduction, "forall" is governed by an introduction and elimination rule. Informally, the introduction rule states:
Given a proof of p x, in a context where x : α is arbitrary, we obtain a proof ∀ x : α, p x.
The elimination rule states:
Given a proof ∀ x : α, p x and any term t : α, we obtain a proof of p t.
As was the case for implication, the propositions-as-types interpretation now comes into play. Remember the introduction and elimination rules for dependent arrow types:
Given a term t of type β x, in a context where x : α is arbitrary, we have (fun x : α => t) : (x : α) → β x.
The elimination rule states:
Given a term s : (x : α) → β x and any term t : α, we have s t : β t.
In the case where p x has type Prop, if we replace (x : α) → β x with ∀ x : α, p x, we can read these as the correct rules for building proofs involving the universal quantifier.
The Calculus of Constructions therefore identifies dependent arrow types with forall-expressions in this way. If p is any expression, ∀ x : α, p is nothing more than alternative notation for (x : α) → p, with the idea that the former is more natural than the latter in cases where p is a proposition. Typically, the expression p will depend on x : α. Recall that, in the case of ordinary function spaces, we could interpret α → β as the special case of (x : α) → β in which β does not depend on x. Similarly, we can think of an implication p → q between propositions as the special case of ∀ x : p, q in which the expression q does not depend on x.
Here is an example of how the propositions-as-types correspondence gets put into practice.
example (α : Type) (p q : α → Prop) : (∀ x : α, p x ∧ q x) → ∀ y : α, p y :=
fun h : ∀ x : α, p x ∧ q x =>
fun y : α =>
show p y from (h y).left
As a notational convention, we give the universal quantifier the widest scope possible, so parentheses are needed to limit the quantifier over x to the hypothesis in the example above. The canonical way to prove ∀ y : α, p y is to take an arbitrary y, and prove p y. This is the introduction rule. Now, given that h has type ∀ x : α, p x ∧ q x, the expression h y has type p y ∧ q y. This is the elimination rule. Taking the left conjunct gives the desired conclusion, p y.
Remember that expressions which differ up to renaming of bound variables are considered to be equivalent. So, for example, we could have used the same variable, x, in both the hypothesis and conclusion, and instantiated it by a different variable, z, in the proof:
example (α : Type) (p q : α → Prop) : (∀ x : α, p x ∧ q x) → ∀ x : α, p x :=
fun h : ∀ x : α, p x ∧ q x =>
fun z : α =>
show p z from And.left (h z)
As another example, here is how we can express the fact that a relation, r, is transitive:
variable (α : Type) (r : α → α → Prop)
variable (trans_r : ∀ x y z, r x y → r y z → r x z)
variable (a b c : α)
variable (hab : r a b) (hbc : r b c)
#check trans_r -- ∀ (x y z : α), r x y → r y z → r x z
#check trans_r a b c
#check trans_r a b c hab
#check trans_r a b c hab hbc
Think about what is going on here. When we instantiate trans_r at the values a b c, we end up with a proof of r a b → r b c → r a c. Applying this to the "hypothesis" hab : r a b, we get a proof of the implication r b c → r a c. Finally, applying it to the hypothesis hbc yields a proof of the conclusion r a c.
In situations like this, it can be tedious to supply the arguments a b c, when they can be inferred from hab hbc. For that reason, it is common to make these arguments implicit:
variable (α : Type) (r : α → α → Prop)
variable (trans_r : ∀ {x y z}, r x y → r y z → r x z)
variable (a b c : α)
variable (hab : r a b) (hbc : r b c)
#check trans_r
#check trans_r hab
#check trans_r hab hbc
The advantage is that we can simply write trans_r hab hbc as a proof of r a c. A disadvantage is that Lean does not have enough information to infer the types of the arguments in the expressions trans_r and trans_r hab. The output of the first #check command is r ?m.1 ?m.2 → r ?m.2 ?m.3 → r ?m.1 ?m.3, indicating that the implicit arguments are unspecified in this case.
Here is an example of how we can carry out elementary reasoning with an equivalence relation:
variable (α : Type) (r : α → α → Prop)
variable (refl_r : ∀ x, r x x)
variable (symm_r : ∀ {x y}, r x y → r y x)
variable (trans_r : ∀ {x y z}, r x y → r y z → r x z)
example (a b c d : α) (hab : r a b) (hcb : r c b) (hcd : r c d) : r a d :=
trans_r (trans_r hab (symm_r hcb)) hcd
To get used to using universal quantifiers, you should try some of the exercises at the end of this section.
It is the typing rule for dependent arrow types, and the universal quantifier in particular, that distinguishes Prop from other types. Suppose we have α : Sort i and β : Sort j, where the expression β may depend on a variable x : α. Then (x : α) → β is an element of Sort (imax i j), where imax i j is the maximum of i and j if j is not 0, and 0 otherwise.
The idea is as follows. If j is not 0, then (x : α) → β is an element of Sort (max i j). In other words, the type of dependent functions from α to β "lives" in the universe whose index is the maximum of i and j. Suppose, however, that β is of Sort 0, that is, an element of Prop. In that case, (x : α) → β is an element of Sort 0 as well, no matter which type universe α lives in. In other words, if β is a proposition depending on α, then ∀ x : α, β is again a proposition. This reflects the interpretation of Prop as the type of propositions rather than data, and it is what makes Prop impredicative.
The term "predicative" stems from foundational developments around the turn of the twentieth century, when logicians such as Poincaré and Russell blamed set-theoretic paradoxes on the "vicious circles" that arise when we define a property by quantifying over a collection that includes the very property being defined. Notice that if α is any type, we can form the type α → Prop of all predicates on α (the "power type of α"). The impredicativity of Prop means that we can form propositions that quantify over α → Prop. In particular, we can define predicates on α by quantifying over all predicates on α, which is exactly the type of circularity that was once considered problematic.
## Equality
Let us now turn to one of the most fundamental relations defined in Lean's library, namely, the equality relation. In Chapter Inductive Types, we will explain how equality is defined from the primitives of Lean's logical framework. In the meanwhile, here we explain how to use it.
Of course, a fundamental property of equality is that it is an equivalence relation:
#check Eq.refl -- ∀ (a : ?m.1), a = a
#check Eq.symm -- ?m.2 = ?m.3 → ?m.3 = ?m.2
#check Eq.trans -- ?m.2 = ?m.3 → ?m.3 = ?m.4 → ?m.2 = ?m.4
We can make the output easier to read by telling Lean not to insert the implicit arguments (which are displayed here as metavariables).
universe u
#check @Eq.refl.{u} -- ∀ {α : Sort u} (a : α), a = a
#check @Eq.symm.{u} -- ∀ {α : Sort u} {a b : α}, a = b → b = a
#check @Eq.trans.{u} -- ∀ {α : Sort u} {a b c : α}, a = b → b = c → a = c
The inscription .{u} tells Lean to instantiate the constants at the universe u.
Thus, for example, we can specialize the example from the previous section to the equality relation:
variable (α : Type) (a b c d : α)
variable (hab : a = b) (hcb : c = b) (hcd : c = d)
example : a = d :=
Eq.trans (Eq.trans hab (Eq.symm hcb)) hcd
We can also use the projection notation:
variable (α : Type) (a b c d : α)
variable (hab : a = b) (hcb : c = b) (hcd : c = d)
example : a = d := (hab.trans hcb.symm).trans hcd
Reflexivity is more powerful than it looks. Recall that terms in the Calculus of Constructions have a computational interpretation, and that the logical framework treats terms with a common reduct as the same. As a result, some nontrivial identities can be proved by reflexivity:
variable (α β : Type)
example (f : α → β) (a : α) : (fun x => f x) a = f a := Eq.refl _
example (a : α) (b : β) : (a, b).1 = a := Eq.refl _
example : 2 + 3 = 5 := Eq.refl _
This feature of the framework is so important that the library defines a notation rfl for Eq.refl _:
variable (α β : Type)
example (f : α → β) (a : α) : (fun x => f x) a = f a := rfl
example (a : α) (b : β) : (a, b).1 = a := rfl
example : 2 + 3 = 5 := rfl
Equality is much more than an equivalence relation, however. It has the important property that every assertion respects the equivalence, in the sense that we can substitute equal expressions without changing the truth value. That is, given h1 : a = b and h2 : p a, we can construct a proof for p b using substitution: Eq.subst h1 h2.
example (α : Type) (a b : α) (p : α → Prop)
(h1 : a = b) (h2 : p a) : p b :=
Eq.subst h1 h2
example (α : Type) (a b : α) (p : α → Prop)
(h1 : a = b) (h2 : p a) : p b :=
h1 ▸ h2
The triangle in the second presentation is a macro built on top of Eq.subst and Eq.symm, and you can enter it by typing \t.
The rule Eq.subst is used to define the following auxiliary rules, which carry out more explicit substitutions. They are designed to deal with applicative terms, that is, terms of form s t. Specifically, congrArg can be used to replace the argument, congrFun can be used to replace the term that is being applied, and congr can be used to replace both at once.
variable (α : Type)
variable (a b : α)
variable (f g : α → Nat)
variable (h₁ : a = b)
variable (h₂ : f = g)
example : f a = f b := congrArg f h₁
example : f a = g a := congrFun h₂ a
example : f a = g b := congr h₂ h₁
Lean's library contains a large number of common identities, such as these:
variable (a b c : Nat)
example : a + 0 = a := Nat.add_zero a
example : 0 + a = a := Nat.zero_add a
example : a * 1 = a := Nat.mul_one a
example : 1 * a = a := Nat.one_mul a
example : a + b = b + a := Nat.add_comm a b
example : a + b + c = a + (b + c) := Nat.add_assoc a b c
example : a * b = b * a := Nat.mul_comm a b
example : a * b * c = a * (b * c) := Nat.mul_assoc a b c
example : a * (b + c) = a * b + a * c := Nat.mul_add a b c
example : a * (b + c) = a * b + a * c := Nat.left_distrib a b c
example : (a + b) * c = a * c + b * c := Nat.add_mul a b c
example : (a + b) * c = a * c + b * c := Nat.right_distrib a b c
Note that Nat.mul_add and Nat.add_mul are alternative names for Nat.left_distrib and Nat.right_distrib, respectively. The properties above are stated for the natural numbers (type Nat).
Here is an example of a calculation in the natural numbers that uses substitution combined with associativity and distributivity.
example (x y : Nat) : (x + y) * (x + y) = x * x + y * x + x * y + y * y :=
have h1 : (x + y) * (x + y) = (x + y) * x + (x + y) * y :=
Nat.mul_add (x + y) x y
have h2 : (x + y) * (x + y) = x * x + y * x + (x * y + y * y) :=
h2.trans (Nat.add_assoc (x * x + y * x) (x * y) (y * y)).symm
Notice that the second implicit parameter to Eq.subst, which provides the context in which the substitution is to occur, has type α → Prop. Inferring this predicate therefore requires an instance of higher-order unification. In full generality, the problem of determining whether a higher-order unifier exists is undecidable, and Lean can at best provide imperfect and approximate solutions to the problem. As a result, Eq.subst doesn't always do what you want it to. The macro h ▸ e uses more effective heuristics for computing this implicit parameter, and often succeeds in situations where applying Eq.subst fails.
Because equational reasoning is so common and important, Lean provides a number of mechanisms to carry it out more effectively. The next section offers syntax that allow you to write calculational proofs in a more natural and perspicuous way. But, more importantly, equational reasoning is supported by a term rewriter, a simplifier, and other kinds of automation. The term rewriter and simplifier are described briefly in the next section, and then in greater detail in the next chapter.
## Calculational Proofs
A calculational proof is just a chain of intermediate results that are meant to be composed by basic principles such as the transitivity of equality. In Lean, a calculational proof starts with the keyword calc, and has the following syntax:
calc
<expr>_0 'op_1' <expr>_1 ':=' <proof>_1
'_' 'op_2' <expr>_2 ':=' <proof>_2
...
'_' 'op_n' <expr>_n ':=' <proof>_n
Each <proof>_i is a proof for <expr>_{i-1} op_i <expr>_i.
Here is an example:
variable (a b c d e : Nat)
variable (h1 : a = b)
variable (h2 : b = c + 1)
variable (h3 : c = d)
variable (h4 : e = 1 + d)
theorem T : a = e :=
calc
a = b := h1
_ = c + 1 := h2
_ = d + 1 := congrArg Nat.succ h3
_ = 1 + d := Nat.add_comm d 1
_ = e := Eq.symm h4
This style of writing proofs is most effective when it is used in conjunction with the simp and rewrite tactics, which are discussed in greater detail in the next chapter. For example, using the abbreviation rw for rewrite, the proof above could be written as follows:
variable (a b c d e : Nat)
variable (h1 : a = b)
variable (h2 : b = c + 1)
variable (h3 : c = d)
variable (h4 : e = 1 + d)
theorem T : a = e :=
calc
a = b := by rw [h1]
_ = c + 1 := by rw [h2]
_ = d + 1 := by rw [h3]
_ = 1 + d := by rw [Nat.add_comm]
_ = e := by rw [h4]
Essentially, the rw tactic uses a given equality (which can be a hypothesis, a theorem name, or a complex term) to "rewrite" the goal. If doing so reduces the goal to an identity t = t, the tactic applies reflexivity to prove it.
Rewrites can be applied sequentially, so that the proof above can be shortened to this:
variable (a b c d e : Nat)
variable (h1 : a = b)
variable (h2 : b = c + 1)
variable (h3 : c = d)
variable (h4 : e = 1 + d)
theorem T : a = e :=
calc
a = d + 1 := by rw [h1, h2, h3]
_ = 1 + d := by rw [Nat.add_comm]
_ = e := by rw [h4]
Or even this:
variable (a b c d e : Nat)
variable (h1 : a = b)
variable (h2 : b = c + 1)
variable (h3 : c = d)
variable (h4 : e = 1 + d)
theorem T : a = e :=
by rw [h1, h2, h3, Nat.add_comm, h4]
The simp tactic, instead, rewrites the goal by applying the given identities repeatedly, in any order, anywhere they are applicable in a term. It also uses other rules that have been previously declared to the system, and applies commutativity wisely to avoid looping. As a result, we can also prove the theorem as follows:
variable (a b c d e : Nat)
variable (h1 : a = b)
variable (h2 : b = c + 1)
variable (h3 : c = d)
variable (h4 : e = 1 + d)
theorem T : a = e :=
by simp [h1, h2, h3, Nat.add_comm, h4]
We will discuss variations of rw and simp in the next chapter.
The calc command can be configured for any relation that supports some form of transitivity. It can even combine different relations.
example (a b c d : Nat) (h1 : a = b) (h2 : b ≤ c) (h3 : c + 1 < d) : a < d :=
calc
a = b := h1
_ < b + 1 := Nat.lt_succ_self b
_ ≤ c + 1 := Nat.succ_le_succ h2
_ < d := h3
You can "teach" calc new transitivity theorems by adding new instances of the Trans type class. Type classes are introduced later, but the following small example demonstrates how to extend the calc notation using new Trans instances.
def divides (x y : Nat) : Prop :=
∃ k, k*x = y
def divides_trans (h₁ : divides x y) (h₂ : divides y z) : divides x z :=
let ⟨k₁, d₁⟩ := h₁
let ⟨k₂, d₂⟩ := h₂
⟨k₁ * k₂, by rw [Nat.mul_comm k₁ k₂, Nat.mul_assoc, d₁, d₂]⟩
def divides_mul (x : Nat) (k : Nat) : divides x (k*x) :=
⟨k, rfl⟩
instance : Trans divides divides divides where
trans := divides_trans
example (h₁ : divides x y) (h₂ : y = z) : divides x (2*z) :=
calc
divides x y := h₁
_ = z := h₂
divides _ (2*z) := divides_mul ..
infix:50 " ∣ " => divides
example (h₁ : divides x y) (h₂ : y = z) : divides x (2*z) :=
calc
x ∣ y := h₁
_ = z := h₂
_ ∣ 2*z := divides_mul ..
The example above also makes it clear that you can use calc even if you do not have an infix notation for your relation. Finally we remark that the vertical bar ∣ in the example above is the unicode one. We use unicode to make sure we do not overload the ASCII | used in the match .. with expression.
With calc, we can write the proof in the last section in a more natural and perspicuous way.
example (x y : Nat) : (x + y) * (x + y) = x * x + y * x + x * y + y * y :=
calc
(x + y) * (x + y) = (x + y) * x + (x + y) * y := by rw [Nat.mul_add]
_ = x * x + y * x + (x + y) * y := by rw [Nat.add_mul]
_ = x * x + y * x + (x * y + y * y) := by rw [Nat.add_mul]
_ = x * x + y * x + x * y + y * y := by rw [←Nat.add_assoc]
Here the left arrow before Nat.add_assoc tells rewrite to use the identity in the opposite direction. (You can enter it with \l or use the ascii equivalent, <-.) If brevity is what we are after, both rw and simp can do the job on their own:
example (x y : Nat) : (x + y) * (x + y) = x * x + y * x + x * y + y * y :=
example (x y : Nat) : (x + y) * (x + y) = x * x + y * x + x * y + y * y :=
## The Existential Quantifier
Finally, consider the existential quantifier, which can be written as either exists x : α, p x or ∃ x : α, p x. Both versions are actually notationally convenient abbreviations for a more long-winded expression, Exists (fun x : α => p x), defined in Lean's library.
As you should by now expect, the library includes both an introduction rule and an elimination rule. The introduction rule is straightforward: to prove ∃ x : α, p x, it suffices to provide a suitable term t and a proof of p t. Here are some examples:
example : ∃ x : Nat, x > 0 :=
have h : 1 > 0 := Nat.zero_lt_succ 0
Exists.intro 1 h
example (x : Nat) (h : x > 0) : ∃ y, y < x :=
Exists.intro 0 h
example (x y z : Nat) (hxy : x < y) (hyz : y < z) : ∃ w, x < w ∧ w < z :=
Exists.intro y (And.intro hxy hyz)
#check @Exists.intro
We can use the anonymous constructor notation ⟨t, h⟩ for Exists.intro t h, when the type is clear from the context.
example : ∃ x : Nat, x > 0 :=
have h : 1 > 0 := Nat.zero_lt_succ 0
⟨1, h⟩
example (x : Nat) (h : x > 0) : ∃ y, y < x :=
⟨0, h⟩
example (x y z : Nat) (hxy : x < y) (hyz : y < z) : ∃ w, x < w ∧ w < z :=
⟨y, hxy, hyz⟩
Note that Exists.intro has implicit arguments: Lean has to infer the predicate p : α → Prop in the conclusion ∃ x, p x. This is not a trivial affair. For example, if we have have hg : g 0 0 = 0 and write Exists.intro 0 hg, there are many possible values for the predicate p, corresponding to the theorems ∃ x, g x x = x, ∃ x, g x x = 0, ∃ x, g x 0 = x, etc. Lean uses the context to infer which one is appropriate. This is illustrated in the following example, in which we set the option pp.explicit to true to ask Lean's pretty-printer to show the implicit arguments.
variable (g : Nat → Nat → Nat)
variable (hg : g 0 0 = 0)
theorem gex1 : ∃ x, g x x = x := ⟨0, hg⟩
theorem gex2 : ∃ x, g x 0 = x := ⟨0, hg⟩
theorem gex3 : ∃ x, g 0 0 = x := ⟨0, hg⟩
theorem gex4 : ∃ x, g x x = 0 := ⟨0, hg⟩
set_option pp.explicit true -- display implicit arguments
#print gex1
#print gex2
#print gex3
#print gex4
We can view Exists.intro as an information-hiding operation, since it hides the witness to the body of the assertion. The existential elimination rule, Exists.elim, performs the opposite operation. It allows us to prove a proposition q from ∃ x : α, p x, by showing that q follows from p w for an arbitrary value w. Roughly speaking, since we know there is an x satisfying p x, we can give it a name, say, w. If q does not mention w, then showing that q follows from p w is tantamount to showing that q follows from the existence of any such x. Here is an example:
variable (α : Type) (p q : α → Prop)
example (h : ∃ x, p x ∧ q x) : ∃ x, q x ∧ p x :=
Exists.elim h
(fun w =>
fun hw : p w ∧ q w =>
show ∃ x, q x ∧ p x from ⟨w, hw.right, hw.left⟩)
It may be helpful to compare the exists-elimination rule to the or-elimination rule: the assertion ∃ x : α, p x can be thought of as a big disjunction of the propositions p a, as a ranges over all the elements of α. Note that the anonymous constructor notation ⟨w, hw.right, hw.left⟩ abbreviates a nested constructor application; we could equally well have written ⟨w, ⟨hw.right, hw.left⟩⟩.
Notice that an existential proposition is very similar to a sigma type, as described in dependent types section. The difference is that given a : α and h : p a, the term Exists.intro a h has type (∃ x : α, p x) : Prop and Sigma.mk a h has type (Σ x : α, p x) : Type. The similarity between ∃ and Σ is another instance of the Curry-Howard isomorphism.
Lean provides a more convenient way to eliminate from an existential quantifier with the match expression:
variable (α : Type) (p q : α → Prop)
example (h : ∃ x, p x ∧ q x) : ∃ x, q x ∧ p x :=
match h with
| ⟨w, hw⟩ => ⟨w, hw.right, hw.left⟩
The match expression is part of Lean's function definition system, which provides convenient and expressive ways of defining complex functions. Once again, it is the Curry-Howard isomorphism that allows us to co-opt this mechanism for writing proofs as well. The match statement "destructs" the existential assertion into the components w and hw, which can then be used in the body of the statement to prove the proposition. We can annotate the types used in the match for greater clarity:
variable (α : Type) (p q : α → Prop)
example (h : ∃ x, p x ∧ q x) : ∃ x, q x ∧ p x :=
match h with
| ⟨(w : α), (hw : p w ∧ q w)⟩ => ⟨w, hw.right, hw.left⟩
We can even use the match statement to decompose the conjunction at the same time:
variable (α : Type) (p q : α → Prop)
example (h : ∃ x, p x ∧ q x) : ∃ x, q x ∧ p x :=
match h with
| ⟨w, hpw, hqw⟩ => ⟨w, hqw, hpw⟩
Lean also provides a pattern-matching let expression:
variable (α : Type) (p q : α → Prop)
example (h : ∃ x, p x ∧ q x) : ∃ x, q x ∧ p x :=
let ⟨w, hpw, hqw⟩ := h
⟨w, hqw, hpw⟩
This is essentially just alternative notation for the match construct above. Lean will even allow us to use an implicit match in the fun expression:
variable (α : Type) (p q : α → Prop)
example : (∃ x, p x ∧ q x) → ∃ x, q x ∧ p x :=
fun ⟨w, hpw, hqw⟩ => ⟨w, hqw, hpw⟩
We will see in Chapter Induction and Recursion that all these variations are instances of a more general pattern-matching construct.
In the following example, we define is_even a as ∃ b, a = 2 * b, and then we show that the sum of two even numbers is an even number.
def is_even (a : Nat) := ∃ b, a = 2 * b
theorem even_plus_even (h1 : is_even a) (h2 : is_even b) : is_even (a + b) :=
Exists.elim h1 (fun w1 (hw1 : a = 2 * w1) =>
Exists.elim h2 (fun w2 (hw2 : b = 2 * w2) =>
Exists.intro (w1 + w2)
(calc
a + b = 2 * w1 + 2 * w2 := by rw [hw1, hw2]
_ = 2 * (w1 + w2) := by rw [Nat.mul_add])))
Using the various gadgets described in this chapter --- the match statement, anonymous constructors, and the rewrite tactic, we can write this proof concisely as follows:
def is_even (a : Nat) := ∃ b, a = 2 * b
theorem even_plus_even (h1 : is_even a) (h2 : is_even b) : is_even (a + b) :=
match h1, h2 with
| ⟨w1, hw1⟩, ⟨w2, hw2⟩ => ⟨w1 + w2, by rw [hw1, hw2, Nat.mul_add]⟩
Just as the constructive "or" is stronger than the classical "or," so, too, is the constructive "exists" stronger than the classical "exists". For example, the following implication requires classical reasoning because, from a constructive standpoint, knowing that it is not the case that every x satisfies ¬ p is not the same as having a particular x that satisfies p.
open Classical
variable (p : α → Prop)
example (h : ¬ ∀ x, ¬ p x) : ∃ x, p x :=
(fun h1 : ¬ ∃ x, p x =>
have h2 : ∀ x, ¬ p x :=
fun x =>
fun h3 : p x =>
have h4 : ∃ x, p x := ⟨x, h3⟩
show False from h1 h4
show False from h h2)
What follows are some common identities involving the existential quantifier. In the exercises below, we encourage you to prove as many as you can. We also leave it to you to determine which are nonconstructive, and hence require some form of classical reasoning.
open Classical
variable (α : Type) (p q : α → Prop)
variable (r : Prop)
example : (∃ x : α, r) → r := sorry
example (a : α) : r → (∃ x : α, r) := sorry
example : (∃ x, p x ∧ r) ↔ (∃ x, p x) ∧ r := sorry
example : (∃ x, p x ∨ q x) ↔ (∃ x, p x) ∨ (∃ x, q x) := sorry
example : (∀ x, p x) ↔ ¬ (∃ x, ¬ p x) := sorry
example : (∃ x, p x) ↔ ¬ (∀ x, ¬ p x) := sorry
example : (¬ ∃ x, p x) ↔ (∀ x, ¬ p x) := sorry
example : (¬ ∀ x, p x) ↔ (∃ x, ¬ p x) := sorry
example : (∀ x, p x → r) ↔ (∃ x, p x) → r := sorry
example (a : α) : (∃ x, p x → r) ↔ (∀ x, p x) → r := sorry
example (a : α) : (∃ x, r → p x) ↔ (r → ∃ x, p x) := sorry
Notice that the second example and the last two examples require the assumption that there is at least one element a of type α.
Here are solutions to two of the more difficult ones:
open Classical
variable (α : Type) (p q : α → Prop)
variable (a : α)
variable (r : Prop)
example : (∃ x, p x ∨ q x) ↔ (∃ x, p x) ∨ (∃ x, q x) :=
Iff.intro
(fun ⟨a, (h1 : p a ∨ q a)⟩ =>
Or.elim h1
(fun hpa : p a => Or.inl ⟨a, hpa⟩)
(fun hqa : q a => Or.inr ⟨a, hqa⟩))
(fun h : (∃ x, p x) ∨ (∃ x, q x) =>
Or.elim h
(fun ⟨a, hpa⟩ => ⟨a, (Or.inl hpa)⟩)
(fun ⟨a, hqa⟩ => ⟨a, (Or.inr hqa)⟩))
example : (∃ x, p x → r) ↔ (∀ x, p x) → r :=
Iff.intro
(fun ⟨b, (hb : p b → r)⟩ =>
fun h2 : ∀ x, p x =>
show r from hb (h2 b))
(fun h1 : (∀ x, p x) → r =>
show ∃ x, p x → r from
byCases
(fun hap : ∀ x, p x => ⟨a, λ h' => h1 hap⟩)
(fun hnap : ¬ ∀ x, p x =>
(fun hnex : ¬ ∃ x, p x → r =>
have hap : ∀ x, p x :=
fun x =>
(fun hnp : ¬ p x =>
have hex : ∃ x, p x → r := ⟨x, (fun hp => absurd hp hnp)⟩
show False from hnex hex)
show False from hnap hap)))
## More on the Proof Language
We have seen that keywords like fun, have, and show make it possible to write formal proof terms that mirror the structure of informal mathematical proofs. In this section, we discuss some additional features of the proof language that are often convenient.
To start with, we can use anonymous "have" expressions to introduce an auxiliary goal without having to label it. We can refer to the last expression introduced in this way using the keyword this:
variable (f : Nat → Nat)
variable (h : ∀ x : Nat, f x ≤ f (x + 1))
example : f 0 ≤ f 3 :=
have : f 0 ≤ f 1 := h 0
have : f 0 ≤ f 2 := Nat.le_trans this (h 1)
show f 0 ≤ f 3 from Nat.le_trans this (h 2)
Often proofs move from one fact to the next, so this can be effective in eliminating the clutter of lots of labels.
When the goal can be inferred, we can also ask Lean instead to fill in the proof by writing by assumption:
variable (f : Nat → Nat)
variable (h : ∀ x : Nat, f x ≤ f (x + 1))
example : f 0 ≤ f 3 :=
have : f 0 ≤ f 1 := h 0
have : f 0 ≤ f 2 := Nat.le_trans (by assumption) (h 1)
show f 0 ≤ f 3 from Nat.le_trans (by assumption) (h 2)
This tells Lean to use the assumption tactic, which, in turn, proves the goal by finding a suitable hypothesis in the local context. We will learn more about the assumption tactic in the next chapter.
We can also ask Lean to fill in the proof by writing ‹p›, where p is the proposition whose proof we want Lean to find in the context. You can type these corner quotes using \f< and \f>, respectively. The letter "f" is for "French," since the unicode symbols can also be used as French quotation marks. In fact, the notation is defined in Lean as follows:
notation "‹" p "›" => show p by assumption
This approach is more robust than using by assumption, because the type of the assumption that needs to be inferred is given explicitly. It also makes proofs more readable. Here is a more elaborate example:
variable (f : Nat → Nat)
variable (h : ∀ x : Nat, f x ≤ f (x + 1))
example : f 0 ≥ f 1 → f 1 ≥ f 2 → f 0 = f 2 :=
fun _ : f 0 ≥ f 1 =>
fun _ : f 1 ≥ f 2 =>
have : f 0 ≥ f 2 := Nat.le_trans ‹f 1 ≥ f 2› ‹f 0 ≥ f 1›
have : f 0 ≤ f 2 := Nat.le_trans (h 0) (h 1)
show f 0 = f 2 from Nat.le_antisymm this ‹f 0 ≥ f 2›
Keep in mind that you can use the French quotation marks in this way to refer to anything in the context, not just things that were introduced anonymously. Its use is also not limited to propositions, though using it for data is somewhat odd:
example (n : Nat) : Nat := ‹Nat›
Later, we show how you can extend the proof language using the Lean macro system.
## Exercises
1. Prove these equivalences:
variable (α : Type) (p q : α → Prop)
example : (∀ x, p x ∧ q x) ↔ (∀ x, p x) ∧ (∀ x, q x) := sorry
example : (∀ x, p x → q x) → (∀ x, p x) → (∀ x, q x) := sorry
example : (∀ x, p x) ∨ (∀ x, q x) → ∀ x, p x ∨ q x := sorry
You should also try to understand why the reverse implication is not derivable in the last example.
1. It is often possible to bring a component of a formula outside a universal quantifier, when it does not depend on the quantified variable. Try proving these (one direction of the second of these requires classical logic):
variable (α : Type) (p q : α → Prop)
variable (r : Prop)
example : α → ((∀ x : α, r) ↔ r) := sorry
example : (∀ x, p x ∨ r) ↔ (∀ x, p x) ∨ r := sorry
example : (∀ x, r → p x) ↔ (r → ∀ x, p x) := sorry
1. Consider the "barber paradox," that is, the claim that in a certain town there is a (male) barber that shaves all and only the men who do not shave themselves. Prove that this is a contradiction:
variable (men : Type) (barber : men)
variable (shaves : men → men → Prop)
example (h : ∀ x : men, shaves barber x ↔ ¬ shaves x x) : False := sorry
1. Remember that, without any parameters, an expression of type Prop is just an assertion. Fill in the definitions of prime and Fermat_prime below, and construct each of the given assertions. For example, you can say that there are infinitely many primes by asserting that for every natural number n, there is a prime number greater than n. Goldbach's weak conjecture states that every odd number greater than 5 is the sum of three primes. Look up the definition of a Fermat prime or any of the other statements, if necessary.
def even (n : Nat) : Prop := sorry
def prime (n : Nat) : Prop := sorry
def infinitely_many_primes : Prop := sorry
def Fermat_prime (n : Nat) : Prop := sorry
def infinitely_many_Fermat_primes : Prop := sorry
def goldbach_conjecture : Prop := sorry
def Goldbach's_weak_conjecture : Prop := sorry
def Fermat's_last_theorem : Prop := sorry
1. Prove as many of the identities listed in the Existential Quantifier section as you can.
# Tactics
In this chapter, we describe an alternative approach to constructing proofs, using tactics. A proof term is a representation of a mathematical proof; tactics are commands, or instructions, that describe how to build such a proof. Informally, you might begin a mathematical proof by saying "to prove the forward direction, unfold the definition, apply the previous lemma, and simplify." Just as these are instructions that tell the reader how to find the relevant proof, tactics are instructions that tell Lean how to construct a proof term. They naturally support an incremental style of writing proofs, in which you decompose a proof and work on goals one step at a time.
We will describe proofs that consist of sequences of tactics as "tactic-style" proofs, to contrast with the ways of writing proof terms we have seen so far, which we will call "term-style" proofs. Each style has its own advantages and disadvantages. For example, tactic-style proofs can be harder to read, because they require the reader to predict or guess the results of each instruction. But they can also be shorter and easier to write. Moreover, tactics offer a gateway to using Lean's automation, since automated procedures are themselves tactics.
## Entering Tactic Mode
Conceptually, stating a theorem or introducing a have statement creates a goal, namely, the goal of constructing a term with the expected type. For example, the following creates the goal of constructing a term of type p ∧ q ∧ p, in a context with constants p q : Prop, hp : p and hq : q:
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p :=
sorry
You can write this goal as follows:
p : Prop, q : Prop, hp : p, hq : q ⊢ p ∧ q ∧ p
Indeed, if you replace the "sorry" by an underscore in the example above, Lean will report that it is exactly this goal that has been left unsolved.
Ordinarily, you meet such a goal by writing an explicit term. But wherever a term is expected, Lean allows us to insert instead a by <tactics> block, where <tactics> is a sequence of commands, separated by semicolons or line breaks. You can prove the theorem above in that way:
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p :=
by apply And.intro
exact hp
apply And.intro
exact hq
exact hp
We often put the by keyword on the preceding line, and write the example above as:
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro
exact hp
apply And.intro
exact hq
exact hp
The apply tactic applies an expression, viewed as denoting a function with zero or more arguments. It unifies the conclusion with the expression in the current goal, and creates new goals for the remaining arguments, provided that no later arguments depend on them. In the example above, the command apply And.intro yields two subgoals:
case left
p q : Prop
hp : p
hq : q
⊢ p
case right
p q : Prop
hp : p
hq : q
⊢ q ∧ p
The first goal is met with the command exact hp. The exact command is just a variant of apply which signals that the expression given should fill the goal exactly. It is good form to use it in a tactic proof, since its failure signals that something has gone wrong. It is also more robust than apply, since the elaborator takes the expected type, given by the target of the goal, into account when processing the expression that is being applied. In this case, however, apply would work just as well.
You can see the resulting proof term with the #print command:
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro
exact hp
apply And.intro
exact hq
exact hp
#print test
You can write a tactic script incrementally. In VS Code, you can open a window to display messages by pressing Ctrl-Shift-Enter, and that window will then show you the current goal whenever the cursor is in a tactic block. In Emacs, you can see the goal at the end of any line by pressing C-c C-g, or see the remaining goal in an incomplete proof by putting the cursor after the first character of the last tactic. If the proof is incomplete, the token by is decorated with a red squiggly line, and the error message contains the remaining goals.
Tactic commands can take compound expressions, not just single identifiers. The following is a shorter version of the preceding proof:
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro hp
exact And.intro hq hp
Unsurprisingly, it produces exactly the same proof term.
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro hp
exact And.intro hq hp
#print test
Multiple tactic applications can be written in a single line by concatenating with a semicolon.
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro hp; exact And.intro hq hp
Tactics that may produce multiple subgoals often tag them. For example, the tactic apply And.intro tagged the first subgoal as left, and the second as right. In the case of the apply tactic, the tags are inferred from the parameters' names used in the And.intro declaration. You can structure your tactics using the notation case <tag> => <tactics>. The following is a structured version of our first tactic proof in this chapter.
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro
case left => exact hp
case right =>
apply And.intro
case left => exact hq
case right => exact hp
You can solve the subgoal right before left using the case notation:
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro
case right =>
apply And.intro
case left => exact hq
case right => exact hp
case left => exact hp
Note that Lean hides the other goals inside the case block. We say it is "focusing" on the selected goal. Moreover, Lean flags an error if the selected goal is not fully solved at the end of the case block.
For simple subgoals, it may not be worth selecting a subgoal using its tag, but you may still want to structure the proof. Lean also provides the "bullet" notation . <tactics> (or · <tactics>) for structuring proof.
theorem test (p q : Prop) (hp : p) (hq : q) : p ∧ q ∧ p := by
apply And.intro
. exact hp
. apply And.intro
. exact hq
. exact hp
## Basic Tactics
In addition to apply and exact, another useful tactic is intro, which introduces a hypothesis. What follows is an example of an identity from propositional logic that we proved in a previous chapter, now proved using tactics.
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := by
apply Iff.intro
. intro h
apply Or.elim (And.right h)
. intro hq
apply Or.inl
apply And.intro
. exact And.left h
. exact hq
. intro hr
apply Or.inr
apply And.intro
. exact And.left h
. exact hr
. intro h
apply Or.elim h
. intro hpq
apply And.intro
. exact And.left hpq
. apply Or.inl
exact And.right hpq
. intro hpr
apply And.intro
. exact And.left hpr
. apply Or.inr
exact And.right hpr
The intro command can more generally be used to introduce a variable of any type:
example (α : Type) : α → α := by
intro a
exact a
example (α : Type) : ∀ x : α, x = x := by
intro x
exact Eq.refl x
You can use it to introduce several variables:
example : ∀ a b c : Nat, a = b → a = c → c = b := by
intro a b c h₁ h₂
exact Eq.trans (Eq.symm h₂) h₁
As the apply tactic is a command for constructing function applications interactively, the intro tactic is a command for constructing function abstractions interactively (i.e., terms of the form fun x => e). As with lambda abstraction notation, the intro tactic allows us to use an implicit match.
example (α : Type) (p q : α → Prop) : (∃ x, p x ∧ q x) → ∃ x, q x ∧ p x := by
intro ⟨w, hpw, hqw⟩
exact ⟨w, hqw, hpw⟩
You can also provide multiple alternatives like in the match expression.
example (α : Type) (p q : α → Prop) : (∃ x, p x ∨ q x) → ∃ x, q x ∨ p x := by
intro
| ⟨w, Or.inl h⟩ => exact ⟨w, Or.inr h⟩
| ⟨w, Or.inr h⟩ => exact ⟨w, Or.inl h⟩
The intros tactic can be used without any arguments, in which case, it chooses names and introduces as many variables as it can. You will see an example of this in a moment.
The assumption tactic looks through the assumptions in context of the current goal, and if there is one matching the conclusion, it applies it.
example (x y z w : Nat) (h₁ : x = y) (h₂ : y = z) (h₃ : z = w) : x = w := by
apply Eq.trans h₁
apply Eq.trans h₂
assumption -- applied h₃
It will unify metavariables in the conclusion if necessary:
example (x y z w : Nat) (h₁ : x = y) (h₂ : y = z) (h₃ : z = w) : x = w := by
apply Eq.trans
assumption -- solves x = ?b with h₁
apply Eq.trans
assumption -- solves y = ?h₂.b with h₂
assumption -- solves z = w with h₃
The following example uses the intros command to introduce the three variables and two hypotheses automatically:
example : ∀ a b c : Nat, a = b → a = c → c = b := by
intros
apply Eq.trans
apply Eq.symm
assumption
assumption
Note that names automatically generated by Lean are inaccessible by default. The motivation is to ensure your tactic proofs do not rely on automatically generated names, and are consequently more robust. However, you can use the combinator unhygienic to disable this restriction.
example : ∀ a b c : Nat, a = b → a = c → c = b := by unhygienic
intros
apply Eq.trans
apply Eq.symm
exact a_2
exact a_1
You can also use the rename_i tactic to rename the most recent inaccessible names in your context. In the following example, the tactic rename_i h1 _ h2 renames two of the last three hypotheses in your context.
example : ∀ a b c d : Nat, a = b → a = d → a = c → c = b := by
intros
rename_i h1 _ h2
apply Eq.trans
apply Eq.symm
exact h2
exact h1
The rfl tactic is syntactic sugar for exact rfl.
example (y : Nat) : (fun x : Nat => 0) y = 0 :=
by rfl
The repeat combinator can be used to apply a tactic several times.
example : ∀ a b c : Nat, a = b → a = c → c = b := by
intros
apply Eq.trans
apply Eq.symm
repeat assumption
Another tactic that is sometimes useful is the revert tactic, which is, in a sense, an inverse to intro.
example (x : Nat) : x = x := by
revert x
-- goal is ⊢ ∀ (x : Nat), x = x
intro y
-- goal is y : Nat ⊢ y = y
rfl
Moving a hypothesis into the goal yields an implication:
example (x y : Nat) (h : x = y) : y = x := by
revert h
-- goal is x y : Nat ⊢ x = y → y = x
intro h₁
-- goal is x y : Nat, h₁ : x = y ⊢ y = x
apply Eq.symm
assumption
But revert is even more clever, in that it will revert not only an element of the context but also all the subsequent elements of the context that depend on it. For example, reverting x in the example above brings h along with it:
example (x y : Nat) (h : x = y) : y = x := by
revert x
-- goal is y : Nat ⊢ ∀ (x : Nat), x = y → y = x
intros
apply Eq.symm
assumption
You can also revert multiple elements of the context at once:
example (x y : Nat) (h : x = y) : y = x := by
revert x y
-- goal is ⊢ ∀ (x y : Nat), x = y → y = x
intros
apply Eq.symm
assumption
You can only revert an element of the local context, that is, a local variable or hypothesis. But you can replace an arbitrary expression in the goal by a fresh variable using the generalize tactic.
example : 3 = 3 := by
generalize 3 = x
-- goal is x : Nat ⊢ x = x
revert x
-- goal is ⊢ ∀ (x : Nat), x = x
intro y
-- goal is y : Nat ⊢ y = y
rfl
The mnemonic in the notation above is that you are generalizing the goal by setting 3 to an arbitrary variable x. Be careful: not every generalization preserves the validity of the goal. Here, generalize replaces a goal that could be proved using rfl with one that is not provable:
example : 2 + 3 = 5 := by
generalize 3 = x
-- goal is x : Nat ⊢ 2 + x = 5
In this example, the admit tactic is the analogue of the sorry proof term. It closes the current goal, producing the usual warning that sorry has been used. To preserve the validity of the previous goal, the generalize tactic allows us to record the fact that 3 has been replaced by x. All you need to do is to provide a label, and generalize uses it to store the assignment in the local context:
example : 2 + 3 = 5 := by
generalize h : 3 = x
-- goal is x : Nat, h : 3 = x ⊢ 2 + x = 5
rw [← h]
Here the rewrite tactic, abbreviated rw, uses h to replace x by 3 again. The rewrite tactic will be discussed below.
## More Tactics
Some additional tactics are useful for constructing and destructing propositions and data. For example, when applied to a goal of the form p ∨ q, you use tactics such as apply Or.inl and apply Or.inr. Conversely, the cases tactic can be used to decompose a disjunction.
example (p q : Prop) : p ∨ q → q ∨ p := by
intro h
cases h with
| inl hp => apply Or.inr; exact hp
| inr hq => apply Or.inl; exact hq
Note that the syntax is similar to the one used in match expressions. The new subgoals can be solved in any order.
example (p q : Prop) : p ∨ q → q ∨ p := by
intro h
cases h with
| inr hq => apply Or.inl; exact hq
| inl hp => apply Or.inr; exact hp
You can also use a (unstructured) cases without the with and a tactic for each alternative.
example (p q : Prop) : p ∨ q → q ∨ p := by
intro h
cases h
apply Or.inr
assumption
apply Or.inl
assumption
The (unstructured) cases is particularly useful when you can close several subgoals using the same tactic.
example (p : Prop) : p ∨ p → p := by
intro h
cases h
repeat assumption
You can also use the combinator tac1 <;> tac2 to apply tac2 to each subgoal produced by tactic tac1.
example (p : Prop) : p ∨ p → p := by
intro h
cases h <;> assumption
You can combine the unstructured cases tactic with the case and . notation.
example (p q : Prop) : p ∨ q → q ∨ p := by
intro h
cases h
. apply Or.inr
assumption
. apply Or.inl
assumption
example (p q : Prop) : p ∨ q → q ∨ p := by
intro h
cases h
case inr h =>
apply Or.inl
assumption
case inl h =>
apply Or.inr
assumption
example (p q : Prop) : p ∨ q → q ∨ p := by
intro h
cases h
case inr h =>
apply Or.inl
assumption
. apply Or.inr
assumption
The cases tactic can also be used to decompose a conjunction.
example (p q : Prop) : p ∧ q → q ∧ p := by
intro h
cases h with
| intro hp hq => constructor; exact hq; exact hp
In this example, there is only one goal after the cases tactic is applied, with h : p ∧ q replaced by a pair of assumptions, hp : p and hq : q. The constructor tactic applies the unique constructor for conjunction, And.intro. With these tactics, an example from the previous section can be rewritten as follows:
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := by
apply Iff.intro
. intro h
cases h with
| intro hp hqr =>
cases hqr
. apply Or.inl; constructor <;> assumption
. apply Or.inr; constructor <;> assumption
. intro h
cases h with
| inl hpq =>
cases hpq with
| intro hp hq => constructor; exact hp; apply Or.inl; exact hq
| inr hpr =>
cases hpr with
| intro hp hr => constructor; exact hp; apply Or.inr; exact hr
You will see in Chapter Inductive Types that these tactics are quite general. The cases tactic can be used to decompose any element of an inductively defined type; constructor always applies the first applicable constructor of an inductively defined type. For example, you can use cases and constructor with an existential quantifier:
example (p q : Nat → Prop) : (∃ x, p x) → ∃ x, p x ∨ q x := by
intro h
cases h with
| intro x px => constructor; apply Or.inl; exact px
Here, the constructor tactic leaves the first component of the existential assertion, the value of x, implicit. It is represented by a metavariable, which should be instantiated later on. In the previous example, the proper value of the metavariable is determined by the tactic exact px, since px has type p x. If you want to specify a witness to the existential quantifier explicitly, you can use the exists tactic instead:
example (p q : Nat → Prop) : (∃ x, p x) → ∃ x, p x ∨ q x := by
intro h
cases h with
| intro x px => exists x; apply Or.inl; exact px
Here is another example:
example (p q : Nat → Prop) : (∃ x, p x ∧ q x) → ∃ x, q x ∧ p x := by
intro h
cases h with
| intro x hpq =>
cases hpq with
| intro hp hq =>
exists x
These tactics can be used on data just as well as propositions. In the next example, they are used to define functions which swap the components of the product and sum types:
def swap_pair : α × β → β × α := by
intro p
cases p
constructor <;> assumption
def swap_sum : Sum α β → Sum β α := by
intro p
cases p
. apply Sum.inr; assumption
. apply Sum.inl; assumption
Note that up to the names we have chosen for the variables, the definitions are identical to the proofs of the analogous propositions for conjunction and disjunction. The cases tactic will also do a case distinction on a natural number:
open Nat
example (P : Nat → Prop) (h₀ : P 0) (h₁ : ∀ n, P (succ n)) (m : Nat) : P m := by
cases m with
| zero => exact h₀
| succ m' => exact h₁ m'
The cases tactic, and its companion, the induction tactic, are discussed in greater detail in the Tactics for Inductive Types section.
The contradiction tactic searches for a contradiction among the hypotheses of the current goal:
example (p q : Prop) : p ∧ ¬ p → q := by
intro h
cases h
You can also use match in tactic blocks.
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := by
apply Iff.intro
. intro h
match h with
| ⟨_, Or.inl _⟩ => apply Or.inl; constructor <;> assumption
| ⟨_, Or.inr _⟩ => apply Or.inr; constructor <;> assumption
. intro h
match h with
| Or.inl ⟨hp, hq⟩ => constructor; exact hp; apply Or.inl; exact hq
| Or.inr ⟨hp, hr⟩ => constructor; exact hp; apply Or.inr; exact hr
You can "combine" intro h with match h ... and write the previous examples as follows
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := by
apply Iff.intro
. intro
| ⟨hp, Or.inl hq⟩ => apply Or.inl; constructor <;> assumption
| ⟨hp, Or.inr hr⟩ => apply Or.inr; constructor <;> assumption
. intro
| Or.inl ⟨hp, hq⟩ => constructor; assumption; apply Or.inl; assumption
| Or.inr ⟨hp, hr⟩ => constructor; assumption; apply Or.inr; assumption
## Structuring Tactic Proofs
Tactics often provide an efficient way of building a proof, but long sequences of instructions can obscure the structure of the argument. In this section, we describe some means that help provide structure to a tactic-style proof, making such proofs more readable and robust.
One thing that is nice about Lean's proof-writing syntax is that it is possible to mix term-style and tactic-style proofs, and pass between the two freely. For example, the tactics apply and exact expect arbitrary terms, which you can write using have, show, and so on. Conversely, when writing an arbitrary Lean term, you can always invoke the tactic mode by inserting a by block. The following is a somewhat toy example:
example (p q r : Prop) : p ∧ (q ∨ r) → (p ∧ q) ∨ (p ∧ r) := by
intro h
exact
have hp : p := h.left
have hqr : q ∨ r := h.right
show (p ∧ q) ∨ (p ∧ r) by
cases hqr with
| inl hq => exact Or.inl ⟨hp, hq⟩
| inr hr => exact Or.inr ⟨hp, hr⟩
The following is a more natural example:
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := by
apply Iff.intro
. intro h
cases h.right with
| inl hq => exact Or.inl ⟨h.left, hq⟩
| inr hr => exact Or.inr ⟨h.left, hr⟩
. intro h
cases h with
| inl hpq => exact ⟨hpq.left, Or.inl hpq.right⟩
| inr hpr => exact ⟨hpr.left, Or.inr hpr.right⟩
In fact, there is a show tactic, which is similar to the show expression in a proof term. It simply declares the type of the goal that is about to be solved, while remaining in tactic mode.
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := by
apply Iff.intro
. intro h
cases h.right with
| inl hq =>
show (p ∧ q) ∨ (p ∧ r)
exact Or.inl ⟨h.left, hq⟩
| inr hr =>
show (p ∧ q) ∨ (p ∧ r)
exact Or.inr ⟨h.left, hr⟩
. intro h
cases h with
| inl hpq =>
show p ∧ (q ∨ r)
exact ⟨hpq.left, Or.inl hpq.right⟩
| inr hpr =>
show p ∧ (q ∨ r)
exact ⟨hpr.left, Or.inr hpr.right⟩
The show tactic can actually be used to rewrite a goal to something definitionally equivalent:
example (n : Nat) : n + 1 = Nat.succ n := by
show Nat.succ n = Nat.succ n
rfl
There is also a have tactic, which introduces a new subgoal, just as when writing proof terms:
example (p q r : Prop) : p ∧ (q ∨ r) → (p ∧ q) ∨ (p ∧ r) := by
intro ⟨hp, hqr⟩
show (p ∧ q) ∨ (p ∧ r)
cases hqr with
| inl hq =>
have hpq : p ∧ q := And.intro hp hq
apply Or.inl
exact hpq
| inr hr =>
have hpr : p ∧ r := And.intro hp hr
apply Or.inr
exact hpr
As with proof terms, you can omit the label in the have tactic, in which case, the default label this is used:
example (p q r : Prop) : p ∧ (q ∨ r) → (p ∧ q) ∨ (p ∧ r) := by
intro ⟨hp, hqr⟩
show (p ∧ q) ∨ (p ∧ r)
cases hqr with
| inl hq =>
have : p ∧ q := And.intro hp hq
apply Or.inl
exact this
| inr hr =>
have : p ∧ r := And.intro hp hr
apply Or.inr
exact this
The types in a have tactic can be omitted, so you can write have hp := h.left and have hqr := h.right. In fact, with this notation, you can even omit both the type and the label, in which case the new fact is introduced with the label this.
example (p q r : Prop) : p ∧ (q ∨ r) → (p ∧ q) ∨ (p ∧ r) := by
intro ⟨hp, hqr⟩
cases hqr with
| inl hq =>
have := And.intro hp hq
apply Or.inl; exact this
| inr hr =>
have := And.intro hp hr
apply Or.inr; exact this
Lean also has a let tactic, which is similar to the have tactic, but is used to introduce local definitions instead of auxiliary facts. It is the tactic analogue of a let in a proof term.
example : ∃ x, x + 2 = 8 := by
let a : Nat := 3 * 2
exists a
As with have, you can leave the type implicit by writing let a := 3 * 2. The difference between let and have is that let introduces a local definition in the context, so that the definition of the local declaration can be unfolded in the proof.
We have used . to create nested tactic blocks. In a nested block, Lean focuses on the first goal, and generates an error if it has not been fully solved at the end of the block. This can be helpful in indicating the separate proofs of multiple subgoals introduced by a tactic. The notation . is whitespace sensitive and relies on the indentation to detect whether the tactic block ends. Alternatively, you can define tactic blocks using curly braces and semicolons.
example (p q r : Prop) : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) := by
apply Iff.intro
{ intro h;
cases h.right;
{ show (p ∧ q) ∨ (p ∧ r);
exact Or.inl ⟨h.left, ‹q›⟩ }
{ show (p ∧ q) ∨ (p ∧ r);
exact Or.inr ⟨h.left, ‹r›⟩ } }
{ intro h;
cases h;
{ show p ∧ (q ∨ r);
rename_i hpq;
exact ⟨hpq.left, Or.inl hpq.right⟩ }
{ show p ∧ (q ∨ r);
rename_i hpr;
exact ⟨hpr.left, Or.inr hpr.right⟩ } }
It is useful to use indentation to structure proof: every time a tactic leaves more than one subgoal, we separate the remaining subgoals by enclosing them in blocks and indenting. Thus if the application of theorem foo to a single goal produces four subgoals, one would expect the proof to look like this:
apply foo
. <proof of first goal>
. <proof of second goal>
. <proof of third goal>
. <proof of final goal>
or
apply foo
case <tag of first goal> => <proof of first goal>
case <tag of second goal> => <proof of second goal>
case <tag of third goal> => <proof of third goal>
case <tag of final goal> => <proof of final goal>
or
apply foo
{ <proof of first goal> }
{ <proof of second goal> }
{ <proof of third goal> }
{ <proof of final goal> }
## Tactic Combinators
Tactic combinators are operations that form new tactics from old ones. A sequencing combinator is already implicit in the by block:
example (p q : Prop) (hp : p) : p ∨ q :=
by apply Or.inl; assumption
Here, apply Or.inl; assumption is functionally equivalent to a single tactic which first applies apply Or.inl and then applies assumption.
In t₁ <;> t₂, the <;> operator provides a parallel version of the sequencing operation: t₁ is applied to the current goal, and then t₂ is applied to all the resulting subgoals:
example (p q : Prop) (hp : p) (hq : q) : p ∧ q :=
by constructor <;> assumption
This is especially useful when the resulting goals can be finished off in a uniform way, or, at least, when it is possible to make progress on all of them uniformly.
The first | t₁ | t₂ | ... | tₙ applies each tᵢ until one succeeds, or else fails:
example (p q : Prop) (hp : p) : p ∨ q := by
first | apply Or.inl; assumption | apply Or.inr; assumption
example (p q : Prop) (hq : q) : p ∨ q := by
first | apply Or.inl; assumption | apply Or.inr; assumption
In the first example, the left branch succeeds, whereas in the second one, it is the right one that succeeds. In the next three examples, the same compound tactic succeeds in each case.
example (p q r : Prop) (hp : p) : p ∨ q ∨ r :=
by repeat (first | apply Or.inl; assumption | apply Or.inr | assumption)
example (p q r : Prop) (hq : q) : p ∨ q ∨ r :=
by repeat (first | apply Or.inl; assumption | apply Or.inr | assumption)
example (p q r : Prop) (hr : r) : p ∨ q ∨ r :=
by repeat (first | apply Or.inl; assumption | apply Or.inr | assumption)
The tactic tries to solve the left disjunct immediately by assumption; if that fails, it tries to focus on the right disjunct; and if that doesn't work, it invokes the assumption tactic.
You will have no doubt noticed by now that tactics can fail. Indeed, it is the "failure" state that causes the first combinator to backtrack and try the next tactic. The try combinator builds a tactic that always succeeds, though possibly in a trivial way: try t executes t and reports success, even if t fails. It is equivalent to first | t | skip, where skip is a tactic that does nothing (and succeeds in doing so). In the next example, the second constructor succeeds on the right conjunct q ∧ r (remember that disjunction and conjunction associate to the right) but fails on the first. The try tactic ensures that the sequential composition succeeds.
example (p q r : Prop) (hp : p) (hq : q) (hr : r) : p ∧ q ∧ r := by
constructor <;> (try constructor) <;> assumption
Be careful: repeat (try t) will loop forever, because the inner tactic never fails.
In a proof, there are often multiple goals outstanding. Parallel sequencing is one way to arrange it so that a single tactic is applied to multiple goals, but there are other ways to do this. For example, all_goals t applies t to all open goals:
example (p q r : Prop) (hp : p) (hq : q) (hr : r) : p ∧ q ∧ r := by
constructor
all_goals (try constructor)
all_goals assumption
In this case, the any_goals tactic provides a more robust solution. It is similar to all_goals, except it succeeds if its argument succeeds on at least one goal.
example (p q r : Prop) (hp : p) (hq : q) (hr : r) : p ∧ q ∧ r := by
constructor
any_goals constructor
any_goals assumption
The first tactic in the by block below repeatedly splits conjunctions:
example (p q r : Prop) (hp : p) (hq : q) (hr : r) :
p ∧ ((p ∧ q) ∧ r) ∧ (q ∧ r ∧ p) := by
repeat (any_goals constructor)
all_goals assumption
In fact, we can compress the full tactic down to one line:
example (p q r : Prop) (hp : p) (hq : q) (hr : r) :
p ∧ ((p ∧ q) ∧ r) ∧ (q ∧ r ∧ p) := by
repeat (any_goals (first | constructor | assumption))
The combinator focus t ensures that t only effects the current goal, temporarily hiding the others from the scope. So, if t ordinarily only effects the current goal, focus (all_goals t) has the same effect as t.
## Rewriting
The rewrite tactic (abbreviated rw) and the simp tactic were introduced briefly in Calculational Proofs. In this section and the next, we discuss them in greater detail.
The rewrite tactic provides a basic mechanism for applying substitutions to goals and hypotheses, providing a convenient and efficient way of working with equality. The most basic form of the tactic is rewrite [t], where t is a term whose type asserts an equality. For example, t can be a hypothesis h : x = y in the context; it can be a general lemma, like add_comm : ∀ x y, x + y = y + x, in which the rewrite tactic tries to find suitable instantiations of x and y; or it can be any compound term asserting a concrete or general equation. In the following example, we use this basic form to rewrite the goal using a hypothesis.
example (f : Nat → Nat) (k : Nat) (h₁ : f 0 = 0) (h₂ : k = 0) : f k = 0 := by
rw [h₂] -- replace k with 0
rw [h₁] -- replace f 0 with 0
In the example above, the first use of rw replaces k with 0 in the goal f k = 0. Then, the second one replaces f 0 with 0. The tactic automatically closes any goal of the form t = t. Here is an example of rewriting using a compound expression:
example (x y : Nat) (p : Nat → Prop) (q : Prop) (h : q → x = y)
(h' : p y) (hq : q) : p x := by
rw [h hq]; assumption
Here, h hq establishes the equation x = y.
Multiple rewrites can be combined using the notation rw [t_1, ..., t_n], which is just shorthand for rw [t_1]; ...; rw [t_n]. The previous example can be written as follows:
example (f : Nat → Nat) (k : Nat) (h₁ : f 0 = 0) (h₂ : k = 0) : f k = 0 := by
rw [h₂, h₁]
By default, rw uses an equation in the forward direction, matching the left-hand side with an expression, and replacing it with the right-hand side. The notation ←t can be used to instruct the tactic to use the equality t in the reverse direction.
example (f : Nat → Nat) (a b : Nat) (h₁ : a = b) (h₂ : f a = 0) : f b = 0 := by
rw [←h₁, h₂]
In this example, the term ←h₁ instructs the rewriter to replace b with a. In the editors, you can type the backwards arrow as \l. You can also use the ascii equivalent, <-.
Sometimes the left-hand side of an identity can match more than one subterm in the pattern, in which case the rw tactic chooses the first match it finds when traversing the term. If that is not the one you want, you can use additional arguments to specify the appropriate subterm.
example (a b c : Nat) : a + b + c = a + c + b := by
example (a b c : Nat) : a + b + c = a + c + b := by
example (a b c : Nat) : a + b + c = a + c + b := by
In the first example above, the first step rewrites a + b + c to a + (b + c). The next step applies commutativity to the term b + c; without specifying the argument, the tactic would instead rewrite a + (b + c) to (b + c) + a. Finally, the last step applies associativity in the reverse direction, rewriting a + (c + b) to a + c + b. The next two examples instead apply associativity to move the parenthesis to the right on both sides, and then switch b and c. Notice that the last example specifies that the rewrite should take place on the right-hand side by specifying the second argument to Nat.add_comm.
By default, the rewrite tactic affects only the goal. The notation rw [t] at h applies the rewrite t at hypothesis h.
example (f : Nat → Nat) (a : Nat) (h : a + 0 = 0) : f a = f 0 := by
rw [h]
The first step, rw [Nat.add_zero] at h, rewrites the hypothesis a + 0 = 0 to a = 0. Then the new hypothesis a = 0 is used to rewrite the goal to f 0 = f 0.
The rewrite tactic is not restricted to propositions. In the following example, we use rw [h] at t to rewrite the hypothesis t : Tuple α n to t : Tuple α 0.
def Tuple (α : Type) (n : Nat) :=
{ as : List α // as.length = n }
example (n : Nat) (h : n = 0) (t : Tuple α n) : Tuple α 0 := by
rw [h] at t
exact t
## Using the Simplifier
Whereas rewrite is designed as a surgical tool for manipulating a goal, the simplifier offers a more powerful form of automation. A number of identities in Lean's library have been tagged with the [simp] attribute, and the simp tactic uses them to iteratively rewrite subterms in an expression.
example (x y z : Nat) (p : Nat → Prop) (h : p (x * y))
: (x + 0) * (0 + y * 1 + z * 0) = x * y := by
simp
example (x y z : Nat) (p : Nat → Prop) (h : p (x * y))
: p ((x + 0) * (0 + y * 1 + z * 0)) := by
simp; assumption
In the first example, the left-hand side of the equality in the goal is simplified using the usual identities involving 0 and 1, reducing the goal to x * y = x * y. At that point, simp applies reflexivity to finish it off. In the second example, simp reduces the goal to p (x * y), at which point the assumption h finishes it off. Here are some more examples with lists:
open List
example (xs : List Nat)
: reverse (xs ++ [1, 2, 3]) = [3, 2, 1] ++ reverse xs := by
simp
example (xs ys : List α)
: length (reverse (xs ++ ys)) = length xs + length ys := by
As with rw, you can use the keyword at to simplify a hypothesis:
example (x y z : Nat) (p : Nat → Prop)
(h : p ((x + 0) * (0 + y * 1 + z * 0))) : p (x * y) := by
simp at h; assumption
Moreover, you can use a "wildcard" asterisk to simplify all the hypotheses and the goal:
attribute [local simp] Nat.mul_comm Nat.mul_assoc Nat.mul_left_comm
example (w x y z : Nat) (p : Nat → Prop)
(h : p (x * y + z * w * x)) : p (x * w * z + y * x) := by
simp at *; assumption
example (x y z : Nat) (p : Nat → Prop)
(h₁ : p (1 * x + y)) (h₂ : p (x * z * 1))
: p (y + 0 + x) ∧ p (z * x) := by
simp at * <;> constructor <;> assumption
For operations that are commutative and associative, like multiplication on the natural numbers, the simplifier uses these two facts to rewrite an expression, as well as left commutativity. In the case of multiplication the latter is expressed as follows: x * (y * z) = y * (x * z). The local modifier tells the simplifier to use these rules in the current file (or section or namespace, as the case may be). It may seem that commutativity and left-commutativity are problematic, in that repeated application of either causes looping. But the simplifier detects identities that permute their arguments, and uses a technique known as ordered rewriting. This means that the system maintains an internal ordering of terms, and only applies the identity if doing so decreases the order. With the three identities mentioned above, this has the effect that all the parentheses in an expression are associated to the right, and the expressions are ordered in a canonical (though somewhat arbitrary) way. Two expressions that are equivalent up to associativity and commutativity are then rewritten to the same canonical form.
attribute [local simp] Nat.mul_comm Nat.mul_assoc Nat.mul_left_comm
example (w x y z : Nat) (p : Nat → Prop)
: x * y + z * w * x = x * w * z + y * x := by
simp
example (w x y z : Nat) (p : Nat → Prop)
(h : p (x * y + z * w * x)) : p (x * w * z + y * x) := by
simp; simp at h; assumption
As with rewrite, you can send simp a list of facts to use, including general lemmas, local hypotheses, definitions to unfold, and compound expressions. The simp tactic also recognizes the ←t syntax that rewrite does. In any case, the additional rules are added to the collection of identities that are used to simplify a term.
def f (m n : Nat) : Nat :=
m + n + m
example {m n : Nat} (h : n = 1) (h' : 0 = m) : (f m n) = n := by
simp [h, ←h', f]
A common idiom is to simplify a goal using local hypotheses:
example (f : Nat → Nat) (k : Nat) (h₁ : f 0 = 0) (h₂ : k = 0) : f k = 0 := by
simp [h₁, h₂]
To use all the hypotheses present in the local context when simplifying, we can use the wildcard symbol, *:
example (f : Nat → Nat) (k : Nat) (h₁ : f 0 = 0) (h₂ : k = 0) : f k = 0 := by
simp [*]
Here is another example:
example (u w x y z : Nat) (h₁ : x = y + z) (h₂ : w = u + x)
: w = z + y + u := by
The simplifier will also do propositional rewriting. For example, using the hypothesis p, it rewrites p ∧ q to q and p ∨ q to true, which it then proves trivially. Iterating such rewrites produces nontrivial propositional reasoning.
example (p q : Prop) (hp : p) : p ∧ q ↔ q := by
simp [*]
example (p q : Prop) (hp : p) : p ∨ q := by
simp [*]
example (p q r : Prop) (hp : p) (hq : q) : p ∧ (q ∨ r) := by
simp [*]
The next example simplifies all the hypotheses, and then uses them to prove the goal.
example (u w x x' y y' z : Nat) (p : Nat → Prop)
(h₁ : x + 0 = x') (h₂ : y + 0 = y')
: x + y + 0 = x' + y' := by
simp at *
simp [*]
One thing that makes the simplifier especially useful is that its capabilities can grow as a library develops. For example, suppose we define a list operation that symmetrizes its input by appending its reversal:
def mk_symm (xs : List α) :=
xs ++ xs.reverse
Then for any list xs, reverse (mk_symm xs) is equal to mk_symm xs, which can easily be proved by unfolding the definition:
def mk_symm (xs : List α) :=
xs ++ xs.reverse
theorem reverse_mk_symm (xs : List α)
: (mk_symm xs).reverse = mk_symm xs := by
simp [mk_symm]
We can now use this theorem to prove new results:
def mk_symm (xs : List α) :=
xs ++ xs.reverse
theorem reverse_mk_symm (xs : List α)
: (mk_symm xs).reverse = mk_symm xs := by
simp [mk_symm]
example (xs ys : List Nat)
: (xs ++ mk_symm ys).reverse = mk_symm ys ++ xs.reverse := by
simp [reverse_mk_symm]
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p (mk_symm ys ++ xs.reverse) := by
simp [reverse_mk_symm] at h; assumption
But using reverse_mk_symm is generally the right thing to do, and it would be nice if users did not have to invoke it explicitly. You can achieve that by marking it as a simplification rule when the theorem is defined:
def mk_symm (xs : List α) :=
xs ++ xs.reverse
@[simp] theorem reverse_mk_symm (xs : List α)
: (mk_symm xs).reverse = mk_symm xs := by
simp [mk_symm]
example (xs ys : List Nat)
: (xs ++ mk_symm ys).reverse = mk_symm ys ++ xs.reverse := by
simp
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p (mk_symm ys ++ xs.reverse) := by
simp at h; assumption
The notation @[simp] declares reverse_mk_symm to have the [simp] attribute, and can be spelled out more explicitly:
def mk_symm (xs : List α) :=
xs ++ xs.reverse
theorem reverse_mk_symm (xs : List α)
: (mk_symm xs).reverse = mk_symm xs := by
simp [mk_symm]
attribute [simp] reverse_mk_symm
example (xs ys : List Nat)
: (xs ++ mk_symm ys).reverse = mk_symm ys ++ xs.reverse := by
simp
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p (mk_symm ys ++ xs.reverse) := by
simp at h; assumption
The attribute can also be applied any time after the theorem is declared:
def mk_symm (xs : List α) :=
xs ++ xs.reverse
theorem reverse_mk_symm (xs : List α)
: (mk_symm xs).reverse = mk_symm xs := by
simp [mk_symm]
example (xs ys : List Nat)
: (xs ++ mk_symm ys).reverse = mk_symm ys ++ xs.reverse := by
simp [reverse_mk_symm]
attribute [simp] reverse_mk_symm
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p (mk_symm ys ++ xs.reverse) := by
simp at h; assumption
Once the attribute is applied, however, there is no way to permanently remove it; it persists in any file that imports the one where the attribute is assigned. As we will discuss further in Attributes, one can limit the scope of an attribute to the current file or section using the local modifier:
def mk_symm (xs : List α) :=
xs ++ xs.reverse
theorem reverse_mk_symm (xs : List α)
: (mk_symm xs).reverse = mk_symm xs := by
simp [mk_symm]
section
attribute [local simp] reverse_mk_symm
example (xs ys : List Nat)
: (xs ++ mk_symm ys).reverse = mk_symm ys ++ xs.reverse := by
simp
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p (mk_symm ys ++ xs.reverse) := by
simp at h; assumption
end
Outside the section, the simplifier will no longer use reverse_mk_symm by default.
Note that the various simp options we have discussed --- giving an explicit list of rules, and using at to specify the location --- can be combined, but the order they are listed is rigid. You can see the correct order in an editor by placing the cursor on the simp identifier to see the documentation string that is associated with it.
There are two additional modifiers that are useful. By default, simp includes all theorems that have been marked with the attribute [simp]. Writing simp only excludes these defaults, allowing you to use a more explicitly crafted list of rules. In the examples below, the minus sign and only are used to block the application of reverse_mk_symm.
def mk_symm (xs : List α) :=
xs ++ xs.reverse
@[simp] theorem reverse_mk_symm (xs : List α)
: (mk_symm xs).reverse = mk_symm xs := by
simp [mk_symm]
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p (mk_symm ys ++ xs.reverse) := by
simp at h; assumption
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p ((mk_symm ys).reverse ++ xs.reverse) := by
simp [-reverse_mk_symm] at h; assumption
example (xs ys : List Nat) (p : List Nat → Prop)
(h : p (xs ++ mk_symm ys).reverse)
: p ((mk_symm ys).reverse ++ xs.reverse) := by
simp only [List.reverse_append] at h; assumption
The simp tactic has many configuration options. For example, we can enable contextual simplifications as follows.
example : if x = 0 then y + x = y else x ≠ 0 := by
simp (config := { contextual := true })
when contextual := true, simp uses the fact that x = 0 when simplifying y + x = y, and x ≠ 0 when simplifying the other branch. Here is another example.
example : ∀ (x : Nat) (h : x = 0), y + x = y := by
simp (config := { contextual := true })
Another useful configuration option is arith := true which enables arithmetical simplifications. It is so useful that simp_arith is a shorthand for simp (config := { arith := true }).
example : 0 < 1 + x ∧ x + y + 2 ≥ y + 1 := by
simp_arith
## Split Tactic
The split tactic is useful for breaking nested if-then-else and match expressions in cases. For a match expression with n cases, the split tactic generates at most n subgoals. Here is an example.
def f (x y z : Nat) : Nat :=
match x, y, z with
| 5, _, _ => y
| _, 5, _ => y
| _, _, 5 => y
| _, _, _ => 1
example (x y z : Nat) : x ≠ 5 → y ≠ 5 → z ≠ 5 → z = w → f x y w = 1 := by
intros
simp [f]
split
. rfl
We can compress the tactic proof above as follows.
def f (x y z : Nat) : Nat :=
match x, y, z with
| 5, _, _ => y
| _, 5, _ => y
| _, _, 5 => y
| _, _, _ => 1
example (x y z : Nat) : x ≠ 5 → y ≠ 5 → z ≠ 5 → z = w → f x y w = 1 := by
intros; simp [f]; split <;> first | contradiction | rfl
The tactic split <;> first | contradiction | rfl first applies the split tactic, and then for each generated goal it tries contradiction, and then rfl if contradiction fails. Like simp, we can apply split to a particular hypothesis.
def g (xs ys : List Nat) : Nat :=
match xs, ys with
| [a, b], _ => a+b+1
| _, [b, c] => b+1
| _, _ => 1
example (xs ys : List Nat) (h : g xs ys = 0) : False := by
simp [g] at h; split at h <;> simp_arith at h
## Extensible Tactics
In the following example, we define the notation triv using the command syntax. Then, we use the command macro_rules to specify what should be done when triv is used. You can provide different expansions, and the tactic interpreter will try all of them until one succeeds.
-- Define a new tactic notation
syntax "triv" : tactic
macro_rules
| (tactic| triv) => (tactic| assumption)
example (h : p) : p := by
triv
-- You cannot prove the following theorem using triv
-- example (x : α) : x = x := by
-- triv
-- Let's extend triv. The tactic interpreter
-- tries all possible macro extensions for triv until one succeeds
macro_rules
| (tactic| triv) => (tactic| rfl)
example (x : α) : x = x := by
triv
example (x : α) (h : p) : x = x ∧ p := by
apply And.intro <;> triv
-- We now add a (recursive) extension
macro_rules | (tactic| triv) => (tactic| apply And.intro <;> triv)
example (x : α) (h : p) : x = x ∧ p := by
triv
## Exercises
1. Go back to the exercises in Chapter Propositions and Proofs and Chapter Quantifiers and Equality and redo as many as you can now with tactic proofs, using also rw and simp as appropriate.
2. Use tactic combinators to obtain a one line proof of the following:
example (p q r : Prop) (hp : p)
: (p ∨ q ∨ r) ∧ (q ∨ p ∨ r) ∧ (q ∨ r ∨ p) := by
# Interacting with Lean
You are now familiar with the fundamentals of dependent type theory, both as a language for defining mathematical objects and a language for constructing proofs. The one thing you are missing is a mechanism for defining new data types. We will fill this gap in the next chapter, which introduces the notion of an inductive data type. But first, in this chapter, we take a break from the mechanics of type theory to explore some pragmatic aspects of interacting with Lean.
Not all of the information found here will be useful to you right away. We recommend skimming this section to get a sense of Lean's features, and then returning to it as necessary.
## Importing Files
The goal of Lean's front end is to interpret user input, construct formal expressions, and check that they are well formed and type correct. Lean also supports the use of various editors, which provide continuous checking and feedback. More information can be found on the Lean documentation pages.
The definitions and theorems in Lean's standard library are spread across multiple files. Users may also wish to make use of additional libraries, or develop their own projects across multiple files. When Lean starts, it automatically imports the contents of the library Init folder, which includes a number of fundamental definitions and constructions. As a result, most of the examples we present here work "out of the box."
If you want to use additional files, however, they need to be imported manually, via an import statement at the beginning of a file. The command
import Bar.Baz.Blah
imports the file Bar/Baz/Blah.olean, where the descriptions are interpreted relative to the Lean search path. Information as to how the search path is determined can be found on the documentation pages. By default, it includes the standard library directory, and (in some contexts) the root of the user's local project. One can also specify imports relative to the current directory; for example, Importing is transitive. In other words, if you import Foo and Foo imports Bar, then you also have access to the contents of Bar, and do not need to import it explicitly.
## More on Sections
Lean provides various sectioning mechanisms to help structure a theory. You saw in Variables and Sections that the section command makes it possible not only to group together elements of a theory that go together, but also to declare variables that are inserted as arguments to theorems and definitions, as necessary. Remember that the point of the variable command is to declare variables for use in theorems, as in the following example:
section
variable (x y : Nat)
def double := x + x
#check double y
#check double (2 * x)
theorem t1 : double (x + y) = double x + double y := by
simp [double]
#check t1 y
#check t1 (2 * x)
theorem t2 : double (x * y) = double x * y := by
end
The definition of double does not have to declare x as an argument; Lean detects the dependence and inserts it automatically. Similarly, Lean detects the occurrence of x in t1 and t2, and inserts it automatically there, too. Note that double does not have y as argument. Variables are only included in declarations where they are actually used.
## More on Namespaces
In Lean, identifiers are given by hierarchical names like Foo.Bar.baz. We saw in Namespaces that Lean provides mechanisms for working with hierarchical names. The command namespace foo causes foo to be prepended to the name of each definition and theorem until end foo is encountered. The command open foo then creates temporary aliases to definitions and theorems that begin with prefix foo.
namespace Foo
def bar : Nat := 1
end Foo
open Foo
#check bar
#check Foo.bar
The following definition
def Foo.bar : Nat := 1
is treated as a macro, and expands to
namespace Foo
def bar : Nat := 1
end Foo
Although the names of theorems and definitions have to be unique, the aliases that identify them do not. When we open a namespace, an identifier may be ambiguous. Lean tries to use type information to disambiguate the meaning in context, but you can always disambiguate by giving the full name. To that end, the string _root_ is an explicit description of the empty prefix.
def String.add (a b : String) : String :=
a ++ b
def Bool.add (a b : Bool) : Bool :=
a != b
def add (α β : Type) : Type := Sum α β
open Bool
open String
#check String.add -- String → String → String
#check Bool.add -- Bool → Bool → Bool
#check _root_.add -- Type → Type → Type
#check add "hello" "world" -- String
#check add true false -- Bool
#check add Nat Nat -- Type
We can prevent the shorter alias from being created by using the protected keyword:
protected def Foo.bar : Nat := 1
open Foo
-- #check bar -- error
#check Foo.bar
This is often used for names like Nat.rec and Nat.recOn, to prevent overloading of common names.
The open command admits variations. The command
open Nat (succ zero gcd)
#check zero -- Nat
#eval gcd 15 6 -- 3
creates aliases for only the identifiers listed. The command
open Nat hiding succ gcd
#check zero -- Nat
-- #eval gcd 15 6 -- error
#eval Nat.gcd 15 6 -- 3
creates aliases for everything in the Nat namespace except the identifiers listed.
open Nat renaming mul → times, add → plus
#eval plus (times 2 2) 3 -- 7
creates aliases renaming Nat.mul to times and Nat.add to plus.
It is sometimes useful to export aliases from one namespace to another, or to the top level. The command
export Nat (succ add sub)
creates aliases for succ, add, and sub in the current namespace, so that whenever the namespace is open, these aliases are available. If this command is used outside a namespace, the aliases are exported to the top level.
## Attributes
The main function of Lean is to translate user input to formal expressions that are checked by the kernel for correctness and then stored in the environment for later use. But some commands have other effects on the environment, either assigning attributes to objects in the environment, defining notation, or declaring instances of type classes, as described in Chapter Type Classes. Most of these commands have global effects, which is to say, that they remain in effect not only in the current file, but also in any file that imports it. However, such commands often support the local modifier, which indicates that they only have effect until the current section or namespace is closed, or until the end of the current file.
In Section Using the Simplifier, we saw that theorems can be annotated with the [simp] attribute, which makes them available for use by the simplifier. The following example defines the prefix relation on lists, proves that this relation is reflexive, and assigns the [simp] attribute to that theorem.
def isPrefix (l₁ : List α) (l₂ : List α) : Prop :=
∃ t, l₁ ++ t = l₂
@[simp] theorem List.isPrefix_self (as : List α) : isPrefix as as :=
⟨[], by simp⟩
example : isPrefix [1, 2, 3] [1, 2, 3] := by
simp
The simplifier then proves isPrefix [1, 2, 3] [1, 2, 3] by rewriting it to True.
One can also assign the attribute any time after the definition takes place:
def isPrefix (l₁ : List α) (l₂ : List α) : Prop :=
∃ t, l₁ ++ t = l₂
theorem List.isPrefix_self (as : List α) : isPrefix as as :=
⟨[], by simp⟩
attribute [simp] List.isPrefix_self
In all these cases, the attribute remains in effect in any file that imports the one in which the declaration occurs. Adding the local modifier restricts the scope:
def isPrefix (l₁ : List α) (l₂ : List α) : Prop :=
∃ t, l₁ ++ t = l₂
section
theorem List.isPrefix_self (as : List α) : isPrefix as as :=
⟨[], by simp⟩
attribute [local simp] List.isPrefix_self
example : isPrefix [1, 2, 3] [1, 2, 3] := by
simp
end
-- Error:
-- example : isPrefix [1, 2, 3] [1, 2, 3] := by
-- simp
For another example, we can use the instance command to assign the notation ≤ to the isPrefix relation. That command, which will be explained in Chapter Type Classes, works by assigning an [instance] attribute to the associated definition.
def isPrefix (l₁ : List α) (l₂ : List α) : Prop :=
∃ t, l₁ ++ t = l₂
instance : LE (List α) where
le := isPrefix
theorem List.isPrefix_self (as : List α) : as ≤ as :=
⟨[], by simp⟩
That assignment can also be made local:
def isPrefix (l₁ : List α) (l₂ : List α) : Prop :=
∃ t, l₁ ++ t = l₂
def instLe : LE (List α) :=
{ le := isPrefix }
section
attribute [local instance] instLe
example (as : List α) : as ≤ as :=
⟨[], by simp⟩
end
-- Error:
-- example (as : List α) : as ≤ as :=
-- ⟨[], by simp⟩
In Section Notation below, we will discuss Lean's mechanisms for defining notation, and see that they also support the local modifier. However, in Section Setting Options, we will discuss Lean's mechanisms for setting options, which does not follow this pattern: options can only be set locally, which is to say, their scope is always restricted to the current section or current file.
## More on Implicit Arguments
In Section Implicit Arguments, we saw that if Lean displays the type of a term t as {x : α} → β x, then the curly brackets indicate that x has been marked as an implicit argument to t. This means that whenever you write t, a placeholder, or "hole," is inserted, so that t is replaced by @t _. If you don't want that to happen, you have to write @t instead.
Notice that implicit arguments are inserted eagerly. Suppose we define a function f (x : Nat) {y : Nat} (z : Nat) with the arguments shown. Then, when we write the expression f 7 without further arguments, it is parsed as f 7 _. Lean offers a weaker annotation, {{y : ℕ}}, which specifies that a placeholder should only be added before a subsequent explicit argument. This annotation can also be written using as ⦃y : Nat⦄, where the unicode brackets are entered as \{{ and \}}, respectively. With this annotation, the expression f 7 would be parsed as is, whereas f 7 3 would be parsed as f 7 _ 3, just as it would be with the strong annotation.
To illustrate the difference, consider the following example, which shows that a reflexive euclidean relation is both symmetric and transitive.
def reflexive {α : Type u} (r : α → α → Prop) : Prop :=
∀ (a : α), r a a
def symmetric {α : Type u} (r : α → α → Prop) : Prop :=
∀ {a b : α}, r a b → r b a
def transitive {α : Type u} (r : α → α → Prop) : Prop :=
∀ {a b c : α}, r a b → r b c → r a c
def euclidean {α : Type u} (r : α → α → Prop) : Prop :=
∀ {a b c : α}, r a b → r a c → r b c
theorem th1 {α : Type u} {r : α → α → Prop}
(reflr : reflexive r) (euclr : euclidean r)
: symmetric r :=
fun {a b : α} =>
fun (h : r a b) =>
show r b a from euclr h (reflr _)
theorem th2 {α : Type u} {r : α → α → Prop}
(symmr : symmetric r) (euclr : euclidean r)
: transitive r :=
fun {a b c : α} =>
fun (rab : r a b) (rbc : r b c) =>
euclr (symmr rab) rbc
theorem th3 {α : Type u} {r : α → α → Prop}
(reflr : reflexive r) (euclr : euclidean r)
: transitive r :=
@th2 _ _ (@th1 _ _ reflr @euclr) @euclr
variable (r : α → α → Prop)
variable (euclr : euclidean r)
#check euclr -- r ?m1 ?m2 → r ?m1 ?m3 → r ?m2 ?m3
The results are broken down into small steps: th1 shows that a relation that is reflexive and euclidean is symmetric, and th2 shows that a relation that is symmetric and euclidean is transitive. Then th3 combines the two results. But notice that we have to manually disable the implicit arguments in th1, th2, and euclr, because otherwise too many implicit arguments are inserted. The problem goes away if we use weak implicit arguments:
def reflexive {α : Type u} (r : α → α → Prop) : Prop :=
∀ (a : α), r a a
def symmetric {α : Type u} (r : α → α → Prop) : Prop :=
∀ {{a b : α}}, r a b → r b a
def transitive {α : Type u} (r : α → α → Prop) : Prop :=
∀ {{a b c : α}}, r a b → r b c → r a c
def euclidean {α : Type u} (r : α → α → Prop) : Prop :=
∀ {{a b c : α}}, r a b → r a c → r b c
theorem th1 {α : Type u} {r : α → α → Prop}
(reflr : reflexive r) (euclr : euclidean r)
: symmetric r :=
fun {a b : α} =>
fun (h : r a b) =>
show r b a from euclr h (reflr _)
theorem th2 {α : Type u} {r : α → α → Prop}
(symmr : symmetric r) (euclr : euclidean r)
: transitive r :=
fun {a b c : α} =>
fun (rab : r a b) (rbc : r b c) =>
euclr (symmr rab) rbc
theorem th3 {α : Type u} {r : α → α → Prop}
(reflr : reflexive r) (euclr : euclidean r)
: transitive r :=
th2 (th1 reflr euclr) euclr
variable (r : α → α → Prop)
variable (euclr : euclidean r)
#check euclr -- euclidean r
There is a third kind of implicit argument that is denoted with square brackets, [ and ]. These are used for type classes, as explained in Chapter Type Classes.
## Notation
Identifiers in Lean can include any alphanumeric characters, including Greek characters (other than ∀ , Σ , and λ , which, as we have seen, have a special meaning in the dependent type theory). They can also include subscripts, which can be entered by typing \_ followed by the desired subscripted character.
Lean's parser is extensible, which is to say, we can define new notation.
Lean's syntax can be extended and customized by users at every level, ranging from basic "mixfix" notations to custom elaborators. In fact, all builtin syntax is parsed and processed using the same mechanisms and APIs open to users. In this section, we will describe and explain the various extension points.
While introducing new notations is a relatively rare feature in programming languages and sometimes even frowned upon because of its potential to obscure code, it is an invaluable tool in formalization for expressing established conventions and notations of the respective field succinctly in code. Going beyond basic notations, Lean's ability to factor out common boilerplate code into (well-behaved) macros and to embed entire custom domain specific languages (DSLs) to textually encode subproblems efficiently and readably can be of great benefit to both programmers and proof engineers alike.
### Notations and Precedence
The most basic syntax extension commands allow introducing new (or overloading existing) prefix, infix, and postfix operators.
infixl:65 " + " => HAdd.hAdd -- left-associative
infix:50 " = " => Eq -- non-associative
infixr:80 " ^ " => HPow.hPow -- right-associative
prefix:100 "-" => Neg.neg
set_option quotPrecheck false
postfix:max "⁻¹" => Inv.inv
After the initial command name describing the operator kind (its "fixity"), we give the parsing precedence of the operator preceded by a colon :, then a new or existing token surrounded by double quotes (the whitespace is used for pretty printing), then the function this operator should be translated to after the arrow =>.
The precedence is a natural number describing how "tightly" an operator binds to its arguments, encoding the order of operations. We can make this more precise by looking at the commands the above unfold to:
notation:65 lhs:65 " + " rhs:66 => HAdd.hAdd lhs rhs
notation:50 lhs:51 " = " rhs:51 => Eq lhs rhs
notation:80 lhs:81 " ^ " rhs:80 => HPow.hPow lhs rhs
notation:100 "-" arg:100 => Neg.neg arg
set_option quotPrecheck false
notation:1024 arg:1024 "⁻¹" => Inv.inv arg -- max is a shorthand for precedence 1024
It turns out that all commands from the first code block are in fact command macros translating to the more general notation command. We will learn about writing such macros below. Instead of a single token, the notation command accepts a mixed sequence of tokens and named term placeholders with precedences, which can be referenced on the right-hand side of => and will be replaced by the respective term parsed at that position. A placeholder with precedence p accepts only notations with precedence at least p in that place. Thus the string a + b + c cannot be parsed as the equivalent of a + (b + c) because the right-hand side operand of an infixl notation has precedence one greater than the notation itself. In contrast, infixr reuses the notation's precedence for the right-hand side operand, so a ^ b ^ c can be parsed as a ^ (b ^ c). Note that if we used notation directly to introduce an infix notation like
set_option quotPrecheck false
notation:65 lhs:65 " ~ " rhs:65 => wobble lhs rhs
where the precedences do not sufficiently determine associativity, Lean's parser will default to right associativity. More precisely, Lean's parser follows a local longest parse rule in the presence of ambiguous grammars: when parsing the right-hand side of a ~ in a ~ b ~ c, it will continue parsing as long as possible (as the current precedence allows), not stopping after b but parsing ~ c as well. Thus the term is equivalent to a ~ (b ~ c).
As mentioned above, the notation command allows us to define arbitrary mixfix syntax freely mixing tokens and placeholders.
set_option quotPrecheck false
notation:max "(" e ")" => e
notation:10 Γ " ⊢ " e " : " τ => Typing Γ e τ
Placeholders without precedence default to 0, i.e. they accept notations of any precedence in their place. If two notations overlap, we again apply the longest parse rule:
notation:65 a " + " b:66 " + " c:66 => a + b - c
#eval 1 + 2 + 3 -- 0
The new notation is preferred to the binary notation since the latter, before chaining, would stop parsing after 1 + 2. If there are multiple notations accepting the same longest parse, the choice will be delayed until elaboration, which will fail unless exactly one overload is type correct.
## Coercions
In Lean, the type of natural numbers, Nat, is different from the type of integers, Int. But there is a function Int.ofNat that embeds the natural numbers in the integers, meaning that we can view any natural number as an integer, when needed. Lean has mechanisms to detect and insert coercions of this sort.
variable (m n : Nat)
variable (i j : Int)
#check i + m -- i + Int.ofNat m : Int
#check i + m + j -- i + Int.ofNat m + j : Int
#check i + m + n -- i + Int.ofNat m + Int.ofNat n : Int
## Displaying Information
There are a number of ways in which you can query Lean for information about its current state and the objects and theorems that are available in the current context. You have already seen two of the most common ones, #check and #eval. Remember that #check is often used in conjunction with the @ operator, which makes all of the arguments to a theorem or definition explicit. In addition, you can use the #print command to get information about any identifier. If the identifier denotes a definition or theorem, Lean prints the type of the symbol, and its definition. If it is a constant or an axiom, Lean indicates that fact, and shows the type.
-- examples with equality
#check Eq
#check @Eq
#check Eq.symm
#check @Eq.symm
#print Eq.symm
-- examples with And
#check And
#check And.intro
#check @And.intro
-- a user-defined function
def foo {α : Type u} (x : α) : α := x
#check foo
#check @foo
#print foo
## Setting Options
Lean maintains a number of internal variables that can be set by users to control its behavior. The syntax for doing so is as follows:
set_option <name> <value>
One very useful family of options controls the way Lean's pretty- printer displays terms. The following options take an input of true or false:
pp.explicit : display implicit arguments
pp.universes : display hidden universe parameters
pp.notation : display output using defined notations
As an example, the following settings yield much longer output:
set_option pp.explicit true
set_option pp.universes true
set_option pp.notation false
#check 2 + 2 = 4
#reduce (fun x => x + 2) = (fun x => x + 3)
#check (fun x => x + 1) 1
The command set_option pp.all true carries out these settings all at once, whereas set_option pp.all false reverts to the previous values. Pretty printing additional information is often very useful when you are debugging a proof, or trying to understand a cryptic error message. Too much information can be overwhelming, though, and Lean's defaults are generally sufficient for ordinary interactions.
## Using the Library
To use Lean effectively you will inevitably need to make use of definitions and theorems in the library. Recall that the import command at the beginning of a file imports previously compiled results from other files, and that importing is transitive; if you import Foo and Foo imports Bar, then the definitions and theorems from Bar are available to you as well. But the act of opening a namespace, which provides shorter names, does not carry over. In each file, you need to open the namespaces you wish to use.
In general, it is important for you to be familiar with the library and its contents, so you know what theorems, definitions, notations, and resources are available to you. Below we will see that Lean's editor modes can also help you find things you need, but studying the contents of the library directly is often unavoidable. Lean's standard library can be found online, on GitHub:
You can see the contents of these directories and files using GitHub's browser interface. If you have installed Lean on your own computer, you can find the library in the lean folder, and explore it with your file manager. Comment headers at the top of each file provide additional information.
Lean's library developers follow general naming guidelines to make it easier to guess the name of a theorem you need, or to find it using tab completion in editors with a Lean mode that supports this, which is discussed in the next section. Identifiers are generally camelCase, and types are CamelCase. For theorem names, we rely on descriptive names where the different components are separated by _s. Often the name of theorem simply describes the conclusion:
#check Nat.succ_ne_zero
#check Nat.mul_one
#check Nat.le_of_succ_le_succ
Remember that identifiers in Lean can be organized into hierarchical namespaces. For example, the theorem named le_of_succ_le_succ in the namespace Nat has full name Nat.le_of_succ_le_succ, but the shorter name is made available by the command open Nat (for names not marked as protected). We will see in Chapter Inductive Types and Chapter Structures and Records that defining structures and inductive data types in Lean generates associated operations, and these are stored in a namespace with the same name as the type under definition. For example, the product type comes with the following operations:
#check @Prod.mk
#check @Prod.fst
#check @Prod.snd
#check @Prod.rec
The first is used to construct a pair, whereas the next two, Prod.fst and Prod.snd, project the two elements. The last, Prod.rec, provides another mechanism for defining functions on a product in terms of a function on the two components. Names like Prod.rec are protected, which means that one has to use the full name even when the Prod namespace is open.
With the propositions as types correspondence, logical connectives are also instances of inductive types, and so we tend to use dot notation for them as well:
#check @And.intro
#check @And.casesOn
#check @And.left
#check @And.right
#check @Or.inl
#check @Or.inr
#check @Or.elim
#check @Exists.intro
#check @Exists.elim
#check @Eq.refl
#check @Eq.subst
## Auto Bound Implicit Arguments
In the previous section, we have shown how implicit arguments make functions more convenient to use. However, functions such as compose are still quite verbose to define. Note that the universe polymorphic compose is even more verbose than the one previously defined.
universe u v w
def compose {α : Type u} {β : Type v} {γ : Type w}
(g : β → γ) (f : α → β) (x : α) : γ :=
g (f x)
You can avoid the universe command by providing the universe parameters when defining compose.
def compose.{u, v, w}
{α : Type u} {β : Type v} {γ : Type w}
(g : β → γ) (f : α → β) (x : α) : γ :=
g (f x)
Lean 4 supports a new feature called auto bound implicit arguments. It makes functions such as compose much more convenient to write. When Lean processes the header of a declaration, any unbound identifier is automatically added as an implicit argument if it is a single lower case or greek letter. With this feature we can write compose as
def compose (g : β → γ) (f : α → β) (x : α) : γ :=
g (f x)
#check @compose
-- {β : Sort u_1} → {γ : Sort u_2} → {α : Sort u_3} → (β → γ) → (α → β) → α → γ
Note that Lean inferred a more general type using Sort instead of Type.
Although we love this feature and use it extensively when implementing Lean, we realize some users may feel uncomfortable with it. Thus, you can disable it using the command set_option autoImplicit false.
set_option autoImplicit false
/- The following definition produces unknown identifier errors -/
-- def compose (g : β → γ) (f : α → β) (x : α) : γ :=
-- g (f x)
## Implicit Lambdas
In Lean 3 stdlib, we find many instances of the dreadful @+_ idiom. It is often used when we the expected type is a function type with implicit arguments, and we have a constant (reader_t.pure in the example) which also takes implicit arguments. In Lean 4, the elaborator automatically introduces lambdas for consuming implicit arguments. We are still exploring this feature and analyzing its impact, but the experience so far has been very positive. Here is the example from the link above using Lean 4 implicit lambdas.
variable (ρ : Type) (m : Type → Type) [Monad m]
Users can disable the implicit lambda feature by using @ or writing a lambda expression with {} or [] binder annotations. Here are few examples
namespace ex2
def id1 : {α : Type} → α → α :=
fun x => x
def listId : List ({α : Type} → α → α) :=
(fun x => x) :: []
-- In this example, implicit lambda introduction has been disabled because
-- we use @ before fun
def id2 : {α : Type} → α → α :=
@fun α (x : α) => id1 x
def id3 : {α : Type} → α → α :=
@fun α x => id1 x
def id4 : {α : Type} → α → α :=
fun x => id1 x
-- In this example, implicit lambda introduction has been disabled
-- because we used the binder annotation {...}
def id5 : {α : Type} → α → α :=
fun {α} x => id1 x
end ex2
## Sugar for Simple Functions
In Lean 3, we can create simple functions from infix operators by using parentheses. For example, (+1) is sugar for fun x, x + 1. In Lean 4, we generalize this notation using · As a placeholder. Here are a few examples:
namespace ex3
#check (· + 1)
-- fun a => a + 1
#check (2 - ·)
-- fun a => 2 - a
#eval [1, 2, 3, 4, 5].foldl (·*·) 1
-- 120
def f (x y z : Nat) :=
x + y + z
#check (f · 1 ·)
-- fun a b => f a 1 b
#eval [(1, 2), (3, 4), (5, 6)].map (·.1)
-- [1, 3, 5]
end ex3
As in Lean 3, the notation is activated using parentheses, and the lambda abstraction is created by collecting the nested ·s. The collection is interrupted by nested parentheses. In the following example, two different lambda expressions are created.
#check (Prod.mk · (· + 1))
-- fun a => (a, fun b => b + 1)
## Named Arguments
Named arguments enable you to specify an argument for a parameter by matching the argument with its name rather than with its position in the parameter list. If you don't remember the order of the parameters but know their names, you can send the arguments in any order. You may also provide the value for an implicit parameter when Lean failed to infer it. Named arguments also improve the readability of your code by identifying what each argument represents.
def sum (xs : List Nat) :=
xs.foldl (init := 0) (·+·)
#eval sum [1, 2, 3, 4]
-- 10
example {a b : Nat} {p : Nat → Nat → Nat → Prop} (h₁ : p a b b) (h₂ : b = a)
: p a a b :=
Eq.subst (motive := fun x => p a x b) h₂ h₁
In the following examples, we illustrate the interaction between named and default arguments.
def f (x : Nat) (y : Nat := 1) (w : Nat := 2) (z : Nat) :=
x + y + w - z
example (x z : Nat) : f (z := z) x = x + 1 + 2 - z := rfl
example (x z : Nat) : f x (z := z) = x + 1 + 2 - z := rfl
example (x y : Nat) : f x y = fun z => x + y + 2 - z := rfl
example : f = (fun x z => x + 1 + 2 - z) := rfl
example (x : Nat) : f x = fun z => x + 1 + 2 - z := rfl
example (y : Nat) : f (y := 5) = fun x z => x + 5 + 2 - z := rfl
def g {α} [Add α] (a : α) (b? : Option α := none) (c : α) : α :=
match b? with
| none => a + c
| some b => a + b + c
example : g = fun (a c : α) => a + c := rfl
example (x : α) : g (c := x) = fun (a : α) => a + x := rfl
example (x : α) : g (b? := some x) = fun (a c : α) => a + x + c := rfl
example (x : α) : g x = fun (c : α) => x + c := rfl
example (x y : α) : g x y = fun (c : α) => x + y + c := rfl
You can use .. to provide missing explicit arguments as _. This feature combined with named arguments is useful for writing patterns. Here is an example:
inductive Term where
| var (name : String)
| num (val : Nat)
| add (fn : Term) (arg : Term)
| lambda (name : String) (type : Term) (body : Term)
def getBinderName : Term → Option String
| Term.lambda (name := n) .. => some n
| _ => none
def getBinderType : Term → Option Term
| Term.lambda (type := t) .. => some t
| _ => none
Ellipses are also useful when explicit argument can be automatically inferred by Lean, and we want to avoid a sequence of _s.
example (f : Nat → Nat) (a b c : Nat) : f (a + b + c) = f (a + (b + c)) :=
# Inductive Types
We have seen that Lean's formal foundation includes basic types, Prop, Type 0, Type 1, Type 2, ..., and allows for the formation of dependent function types, (x : α) → β. In the examples, we have also made use of additional types like Bool, Nat, and Int, and type constructors, like List, and product, ×. In fact, in Lean's library, every concrete type other than the universes and every type constructor other than dependent arrows is an instance of a general family of type constructions known as inductive types. It is remarkable that it is possible to construct a substantial edifice of mathematics based on nothing more than the type universes, dependent arrow types, and inductive types; everything else follows from those.
Intuitively, an inductive type is built up from a specified list of constructors. In Lean, the syntax for specifying such a type is as follows:
inductive Foo where
| constructor₁ : ... → Foo
| constructor₂ : ... → Foo
...
| constructorₙ : ... → Foo
The intuition is that each constructor specifies a way of building new objects of Foo, possibly from previously constructed values. The type Foo consists of nothing more than the objects that are constructed in this way. The first character | in an inductive declaration is optional. We can also separate constructors using a comma instead of |.
We will see below that the arguments of the constructors can include objects of type Foo, subject to a certain "positivity" constraint, which guarantees that elements of Foo are built from the bottom up. Roughly speaking, each ... can be any arrow type constructed from Foo and previously defined types, in which Foo appears, if at all, only as the "target" of the dependent arrow type.
We will provide a number of examples of inductive types. We will also consider slight generalizations of the scheme above, to mutually defined inductive types, and so-called inductive families.
As with the logical connectives, every inductive type comes with introduction rules, which show how to construct an element of the type, and elimination rules, which show how to "use" an element of the type in another construction. The analogy to the logical connectives should not come as a surprise; as we will see below, they, too, are examples of inductive type constructions. You have already seen the introduction rules for an inductive type: they are just the constructors that are specified in the definition of the type. The elimination rules provide for a principle of recursion on the type, which includes, as a special case, a principle of induction as well.
In the next chapter, we will describe Lean's function definition package, which provides even more convenient ways to define functions on inductive types and carry out inductive proofs. But because the notion of an inductive type is so fundamental, we feel it is important to start with a low-level, hands-on understanding. We will start with some basic examples of inductive types, and work our way up to more elaborate and complex examples.
## Enumerated Types
The simplest kind of inductive type is a type with a finite, enumerated list of elements.
inductive Weekday where
| sunday : Weekday
| monday : Weekday
| tuesday : Weekday
| wednesday : Weekday
| thursday : Weekday
| friday : Weekday
| saturday : Weekday
The inductive command creates a new type, Weekday. The constructors all live in the Weekday namespace.
inductive Weekday where
| sunday : Weekday
| monday : Weekday
| tuesday : Weekday
| wednesday : Weekday
| thursday : Weekday
| friday : Weekday
| saturday : Weekday
#check Weekday.sunday
#check Weekday.monday
open Weekday
#check sunday
#check monday
You can omit : Weekday when declaring the Weekday inductive type.
inductive Weekday where
| sunday
| monday
| tuesday
| wednesday
| thursday
| friday
| saturday
Think of sunday, monday, ... , saturday as being distinct elements of Weekday, with no other distinguishing properties. The elimination principle, Weekday.rec, is defined along with the type Weekday and its constructors. It is also known as a recursor, and it is what makes the type "inductive": it allows us to define a function on Weekday by assigning values corresponding to each constructor. The intuition is that an inductive type is exhaustively generated by the constructors, and has no elements beyond those they construct.
We will use the match expression to define a function from Weekday to the natural numbers:
inductive Weekday where
| sunday : Weekday
| monday : Weekday
| tuesday : Weekday
| wednesday : Weekday
| thursday : Weekday
| friday : Weekday
| saturday : Weekday
open Weekday
def numberOfDay (d : Weekday) : Nat :=
match d with
| sunday => 1
| monday => 2
| tuesday => 3
| wednesday => 4
| thursday => 5
| friday => 6
| saturday => 7
#eval numberOfDay Weekday.sunday -- 1
#eval numberOfDay Weekday.monday -- 2
#eval numberOfDay Weekday.tuesday -- 3
Note that the match expression is compiled using the recursor Weekday.rec generated when you declare the inductive type.
inductive Weekday where
| sunday : Weekday
| monday : Weekday
| tuesday : Weekday
| wednesday : Weekday
| thursday : Weekday
| friday : Weekday
| saturday : Weekday
open Weekday
def numberOfDay (d : Weekday) : Nat :=
match d with
| sunday => 1
| monday => 2
| tuesday => 3
| wednesday => 4
| thursday => 5
| friday => 6
| saturday => 7
set_option pp.all true
#print numberOfDay
-- ... numberOfDay.match_1
#print numberOfDay.match_1
-- ... Weekday.casesOn ...
#print Weekday.casesOn
-- ... Weekday.rec ...
#check @Weekday.rec
/-
@Weekday.rec.{u}
: {motive : Weekday → Sort u} →
motive Weekday.sunday →
motive Weekday.monday →
motive Weekday.tuesday →
motive Weekday.wednesday →
motive Weekday.thursday →
motive Weekday.friday →
motive Weekday.saturday →
(t : Weekday) → motive t
-/
When declaring an inductive datatype, you can use deriving Repr to instruct Lean to generate a fuction that converts Weekday objects into text. This function is used by the #eval command to display Weekday objects.
inductive Weekday where
| sunday
| monday
| tuesday
| wednesday
| thursday
| friday
| saturday
deriving Repr
open Weekday
#eval tuesday -- Weekday.tuesday
It is often useful to group definitions and theorems related to a structure in a namespace with the same name. For example, we can put the numberOfDay function in the Weekday namespace. We are then allowed to use the shorter name when we open the namespace.
We can define functions from Weekday to Weekday:
inductive Weekday where
| sunday : Weekday
| monday : Weekday
| tuesday : Weekday
| wednesday : Weekday
| thursday : Weekday
| friday : Weekday
| saturday : Weekday
deriving Repr
namespace Weekday
def next (d : Weekday) : Weekday :=
match d with
| sunday => monday
| monday => tuesday
| tuesday => wednesday
| wednesday => thursday
| thursday => friday
| friday => saturday
| saturday => sunday
def previous (d : Weekday) : Weekday :=
match d with
| sunday => saturday
| monday => sunday
| tuesday => monday
| wednesday => tuesday
| thursday => wednesday
| friday => thursday
| saturday => friday
#eval next (next tuesday) -- Weekday.thursday
#eval next (previous tuesday) -- Weekday.tuesday
example : next (previous tuesday) = tuesday :=
rfl
end Weekday
How can we prove the general theorem that next (previous d) = d for any Weekday d? You can use match to provide a proof of the claim for each constructor:
inductive Weekday where
| sunday : Weekday
| monday : Weekday
| tuesday : Weekday
| wednesday : Weekday
| thursday : Weekday
| friday : Weekday
| saturday : Weekday
deriving Repr
namespace Weekday
def next (d : Weekday) : Weekday :=
match d with
| sunday => monday
| monday => tuesday
| tuesday => wednesday
| wednesday => thursday
| thursday => friday
| friday => saturday
| saturday => sunday
def previous (d : Weekday) : Weekday :=
match d with
| sunday => saturday
| monday => sunday
| tuesday => monday
| wednesday => tuesday
| thursday => wednesday
| friday => thursday
| saturday => friday
def next_previous (d : Weekday) : next (previous d) = d :=
match d with
| sunday => rfl
| monday => rfl
| tuesday => rfl
| wednesday => rfl
| thursday => rfl
| friday => rfl
| saturday => rfl
Using a tactic proof, we can be even more concise:
inductive Weekday where
| sunday : Weekday
| monday : Weekday
| tuesday : Weekday
| wednesday : Weekday
| thursday : Weekday
| friday : Weekday
| saturday : Weekday
deriving Repr
namespace Weekday
def next (d : Weekday) : Weekday :=
match d with
| sunday => monday
| monday => tuesday
| tuesday => wednesday
| wednesday => thursday
| thursday => friday
| friday => saturday
| saturday => sunday
def previous (d : Weekday) : Weekday :=
match d with
| sunday => saturday
| monday => sunday
| tuesday => monday
| wednesday => tuesday
| thursday => wednesday
| friday => thursday
| saturday => friday
def next_previous (d : Weekday) : next (previous d) = d := by
cases d <;> rfl
Tactics for Inductive Types below will introduce additional tactics that are specifically designed to make use of inductive types.
Notice that, under the propositions-as-types correspondence, we can use match to prove theorems as well as define functions. In other words, under the propositions-as-types correspondence, the proof by cases is a kind of definition by cases, where what is being "defined" is a proof instead of a piece of data.
The Bool type in the Lean library is an instance of enumerated type.
namespace Hidden
inductive Bool where
| false : Bool
| true : Bool
end Hidden
(To run these examples, we put them in a namespace called Hidden, so that a name like Bool does not conflict with the Bool in the standard library. This is necessary because these types are part of the Lean "prelude" that is automatically imported when the system is started.)
As an exercise, you should think about what the introduction and elimination rules for these types do. As a further exercise, we suggest defining boolean operations and, or, not on the Bool type, and verifying common identities. Note that you can define a binary operation like and using match:
namespace Hidden
def and (a b : Bool) : Bool :=
match a with
| true => b
| false => false
end Hidden
Similarly, most identities can be proved by introducing suitable match, and then using rfl.
## Constructors with Arguments
Enumerated types are a very special case of inductive types, in which the constructors take no arguments at all. In general, a "construction" can depend on data, which is then represented in the constructed argument. Consider the definitions of the product type and sum type in the library:
namespace Hidden
inductive Prod (α : Type u) (β : Type v)
| mk : α → β → Prod α β
inductive Sum (α : Type u) (β : Type v) where
| inl : α → Sum α β
| inr : β → Sum α β
end Hidden
Consider what is going on in these examples. The product type has one constructor, Prod.mk, which takes two arguments. To define a function on Prod α β, we can assume the input is of the form Prod.mk a b, and we have to specify the output, in terms of a and b. We can use this to define the two projections for Prod. Remember that the standard library defines notation α × β for Prod α β and (a, b) for Prod.mk a b.
namespace Hidden
inductive Prod (α : Type u) (β : Type v)
| mk : α → β → Prod α β
def fst {α : Type u} {β : Type v} (p : Prod α β) : α :=
match p with
| Prod.mk a b => a
def snd {α : Type u} {β : Type v} (p : Prod α β) : β :=
match p with
| Prod.mk a b => b
end Hidden
The function fst takes a pair, p. The match interprets p as a pair, Prod.mk a b. Recall also from Dependent Type Theory that to give these definitions the greatest generality possible, we allow the types α and β to belong to any universe.
Here is another example where we use the recursor Prod.casesOn instead of match.
def prod_example (p : Bool × Nat) : Nat :=
Prod.casesOn (motive := fun _ => Nat) p (fun b n => cond b (2 * n) (2 * n + 1))
#eval prod_example (true, 3)
#eval prod_example (false, 3)
The argument motive is used to specify the type of the object you want to construct, and it is a function because it may depend on the pair. The cond function is a boolean conditional: cond b t1 t2 returns t1 if b is true, and t2 otherwise. The function prod_example takes a pair consisting of a boolean, b, and a number, n, and returns either 2 * n or 2 * n + 1 according to whether b is true or false.
In contrast, the sum type has two constructors, inl and inr (for "insert left" and "insert right"), each of which takes one (explicit) argument. To define a function on Sum α β, we have to handle two cases: either the input is of the form inl a, in which case we have to specify an output value in terms of a, or the input is of the form inr b, in which case we have to specify an output value in terms of b.
def sum_example (s : Sum Nat Nat) : Nat :=
Sum.casesOn (motive := fun _ => Nat) s
(fun n => 2 * n)
(fun n => 2 * n + 1)
#eval sum_example (Sum.inl 3)
#eval sum_example (Sum.inr 3)
This example is similar to the previous one, but now an input to sum_example is implicitly either of the form inl n or inr n. In the first case, the function returns 2 * n, and the second case, it returns 2 * n + 1.
Notice that the product type depends on parameters α β : Type which are arguments to the constructors as well as Prod. Lean detects when these arguments can be inferred from later arguments to a constructor or the return type, and makes them implicit in that case.
In Section Defining the Natural Numbers we will see what happens when the constructor of an inductive type takes arguments from the inductive type itself. What characterizes the examples we consider in this section is that each constructor relies only on previously specified types.
Notice that a type with multiple constructors is disjunctive: an element of Sum α β is either of the form inl a or of the form inl b. A constructor with multiple arguments introduces conjunctive information: from an element Prod.mk a b of Prod α β we can extract a and b. An arbitrary inductive type can include both features, by having any number of constructors, each of which takes any number of arguments.
As with function definitions, Lean's inductive definition syntax will let you put named arguments to the constructors before the colon:
namespace Hidden
inductive Prod (α : Type u) (β : Type v) where
| mk (fst : α) (snd : β) : Prod α β
inductive Sum (α : Type u) (β : Type v) where
| inl (a : α) : Sum α β
| inr (b : β) : Sum α β
end Hidden
The results of these definitions are essentially the same as the ones given earlier in this section.
A type, like Prod, that has only one constructor is purely conjunctive: the constructor simply packs the list of arguments into a single piece of data, essentially a tuple where the type of subsequent arguments can depend on the type of the initial argument. We can also think of such a type as a "record" or a "structure". In Lean, the keyword structure can be used to define such an inductive type as well as its projections, at the same time.
namespace Hidden
structure Prod (α : Type u) (β : Type v) where
mk :: (fst : α) (snd : β)
end Hidden
This example simultaneously introduces the inductive type, Prod, its constructor, mk, the usual eliminators (rec and recOn), as well as the projections, fst and snd, as defined above.
If you do not name the constructor, Lean uses mk as a default. For example, the following defines a record to store a color as a triple of RGB values:
structure Color where
(red : Nat) (green : Nat) (blue : Nat)
deriving Repr
def yellow := Color.mk 255 255 0
#eval Color.red yellow
The definition of yellow forms the record with the three values shown, and the projection Color.red returns the red component.
You can avoid the parentheses if you add a line break between each field.
structure Color where
red : Nat
green : Nat
blue : Nat
deriving Repr
The structure command is especially useful for defining algebraic structures, and Lean provides substantial infrastructure to support working with them. Here, for example, is the definition of a semigroup:
structure Semigroup where
carrier : Type u
mul : carrier → carrier → carrier
mul_assoc : ∀ a b c, mul (mul a b) c = mul a (mul b c)
We will see more examples in Chapter Structures and Records.
We have already discussed the dependent product type Sigma:
namespace Hidden
inductive Sigma {α : Type u} (β : α → Type v) where
| mk : (a : α) → β a → Sigma β
end Hidden
Two more examples of inductive types in the library are the following:
namespace Hidden
inductive Option (α : Type u) where
| none : Option α
| some : α → Option α
inductive Inhabited (α : Type u) where
| mk : α → Inhabited α
end Hidden
In the semantics of dependent type theory, there is no built-in notion of a partial function. Every element of a function type α → β or a dependent function type (a : α) → β is assumed to have a value at every input. The Option type provides a way of representing partial functions. An element of Option β is either none or of the form some b, for some value b : β. Thus we can think of an element f of the type α → Option β as being a partial function from α to β: for every a : α, f a either returns none, indicating the f a is "undefined", or some b.
An element of Inhabited α is simply a witness to the fact that there is an element of α. Later, we will see that Inhabited is an example of a type class in Lean: Lean can be instructed that suitable base types are inhabited, and can automatically infer that other constructed types are inhabited on that basis.
As exercises, we encourage you to develop a notion of composition for partial functions from α to β and β to γ, and show that it behaves as expected. We also encourage you to show that Bool and Nat are inhabited, that the product of two inhabited types is inhabited, and that the type of functions to an inhabited type is inhabited.
## Inductively Defined Propositions
Inductively defined types can live in any type universe, including the bottom-most one, Prop. In fact, this is exactly how the logical connectives are defined.
namespace Hidden
inductive False : Prop
inductive True : Prop where
| intro : True
inductive And (a b : Prop) : Prop where
| intro : a → b → And a b
inductive Or (a b : Prop) : Prop where
| inl : a → Or a b
| inr : b → Or a b
end Hidden
You should think about how these give rise to the introduction and elimination rules that you have already seen. There are rules that govern what the eliminator of an inductive type can eliminate to, that is, what kinds of types can be the target of a recursor. Roughly speaking, what characterizes inductive types in Prop is that one can only eliminate to other types in Prop. This is consistent with the understanding that if p : Prop, an element hp : p carries no data. There is a small exception to this rule, however, which we will discuss below, in Section Inductive Families.
Even the existential quantifier is inductively defined:
namespace Hidden
inductive Exists {α : Sort u} (p : α → Prop) : Prop where
| intro (w : α) (h : p w) : Exists p
end Hidden
Keep in mind that the notation ∃ x : α, p is syntactic sugar for Exists (fun x : α => p).
The definitions of False, True, And, and Or are perfectly analogous to the definitions of Empty, Unit, Prod, and Sum. The difference is that the first group yields elements of Prop, and the second yields elements of Type u for some u. In a similar way, ∃ x : α, p is a Prop-valued variant of Σ x : α, p.
This is a good place to mention another inductive type, denoted {x : α // p}, which is sort of a hybrid between ∃ x : α, P and Σ x : α, P.
namespace Hidden
inductive Subtype {α : Type u} (p : α → Prop) where
| mk : (x : α) → p x → Subtype p
end Hidden
In fact, in Lean, Subtype is defined using the structure command:
namespace Hidden
structure Subtype {α : Sort u} (p : α → Prop) where
val : α
property : p val
end Hidden
The notation {x : α // p x} is syntactic sugar for Subtype (fun x : α => p x). It is modeled after subset notation in set theory: the idea is that {x : α // p x} denotes the collection of elements of α that have property p.
## Defining the Natural Numbers
The inductively defined types we have seen so far are "flat": constructors wrap data and insert it into a type, and the corresponding recursor unpacks the data and acts on it. Things get much more interesting when the constructors act on elements of the very type being defined. A canonical example is the type Nat of natural numbers:
namespace Hidden
inductive Nat where
| zero : Nat
| succ : Nat → Nat
end Hidden
There are two constructors. We start with zero : Nat; it takes no arguments, so we have it from the start. In contrast, the constructor succ can only be applied to a previously constructed Nat. Applying it to zero yields succ zero : Nat. Applying it again yields succ (succ zero) : Nat, and so on. Intuitively, Nat is the "smallest" type with these constructors, meaning that it is exhaustively (and freely) generated by starting with zero and applying succ repeatedly.
As before, the recursor for Nat is designed to define a dependent function f from Nat to any domain, that is, an element f of (n : nat) → motive n for some motive : Nat → Sort u. It has to handle two cases: the case where the input is zero, and the case where the input is of the form succ n for some n : Nat. In the first case, we simply specify a target value with the appropriate type, as before. In the second case, however, the recursor can assume that a value of f at n has already been computed. As a result, the next argument to the recursor specifies a value for f (succ n) in terms of n and f n. If we check the type of the recursor,
namespace Hidden
inductive Nat where
| zero : Nat
| succ : Nat → Nat
#check @Nat.rec
end Hidden
you find the following:
{motive : Nat → Sort u}
→ motive Nat.zero
→ ((n : Nat) → motive n → motive (Nat.succ n))
→ (t : Nat) → motive t
The implicit argument, motive, is the codomain of the function being defined. In type theory it is common to say motive is the motive for the elimination/recursion, since it describes the kind of object we wish to construct. The next two arguments specify how to compute the zero and successor cases, as described above. They are also known as the minor premises. Finally, the t : Nat, is the input to the function. It is also known as the major premise.
The Nat.recOn is similar to Nat.rec but the major premise occurs before the minor premises.
@Nat.recOn :
{motive : Nat → Sort u}
→ (t : Nat)
→ motive Nat.zero
→ ((n : Nat) → motive n → motive (Nat.succ n))
→ motive t
Consider, for example, the addition function add m n on the natural numbers. Fixing m, we can define addition by recursion on n. In the base case, we set add m zero to m. In the successor step, assuming the value add m n is already determined, we define add m (succ n) to be succ (add m n).
namespace Hidden
inductive Nat where
| zero : Nat
| succ : Nat → Nat
deriving Repr
def add (m n : Nat) : Nat :=
match n with
| Nat.zero => m
| Nat.succ n => Nat.succ (add m n)
open Nat
#eval add (succ (succ zero)) (succ zero)
end Hidden
It is useful to put such definitions into a namespace, Nat. We can then go on to define familiar notation in that namespace. The two defining equations for addition now hold definitionally:
namespace Hidden
inductive Nat where
| zero : Nat
| succ : Nat → Nat
deriving Repr
namespace Nat
def add (m n : Nat) : Nat :=
match n with
| Nat.zero => m
| Nat.succ n => Nat.succ (add m n)
theorem add_zero (m : Nat) : m + zero = m := rfl
theorem add_succ (m n : Nat) : m + succ n = succ (m + n) := rfl
end Nat
end Hidden
We will explain how the instance command works in Chapter Type Classes. In the examples below, we will use Lean's version of the natural numbers.
Proving a fact like zero + m = m, however, requires a proof by induction. As observed above, the induction principle is just a special case of the recursion principle, when the codomain motive n is an element of Prop. It represents the familiar pattern of an inductive proof: to prove ∀ n, motive n, first prove motive 0, and then, for arbitrary n, assume ih : motive n and prove motive (succ n).
namespace Hidden
open Nat
theorem zero_add (n : Nat) : 0 + n = n :=
Nat.recOn (motive := fun x => 0 + x = x)
n
(show 0 + 0 = 0 from rfl)
(fun (n : Nat) (ih : 0 + n = n) =>
show 0 + succ n = succ n from
calc
0 + succ n = succ (0 + n) := rfl
_ = succ n := by rw [ih])
end Hidden
Notice that, once again, when Nat.recOn is used in the context of a proof, it is really the induction principle in disguise. The rewrite and simp tactics tend to be very effective in proofs like these. In this case, each can be used to reduce the proof to:
namespace Hidden
open Nat
theorem zero_add (n : Nat) : 0 + n = n :=
Nat.recOn (motive := fun x => 0 + x = x) n
rfl
(fun n ih => by simp [add_succ, ih])
end Hidden
As another example, let us prove the associativity of addition, ∀ m n k, m + n + k = m + (n + k). (The notation +, as we have defined it, associates to the left, so m + n + k is really (m + n) + k.) The hardest part is figuring out which variable to do the induction on. Since addition is defined by recursion on the second argument, k is a good guess, and once we make that choice the proof almost writes itself:
namespace Hidden
open Nat
theorem add_assoc (m n k : Nat) : m + n + k = m + (n + k) :=
Nat.recOn (motive := fun k => m + n + k = m + (n + k)) k
(show m + n + 0 = m + (n + 0) from rfl)
(fun k (ih : m + n + k = m + (n + k)) =>
show m + n + succ k = m + (n + succ k) from
calc
m + n + succ k = succ (m + n + k) := rfl
_ = succ (m + (n + k)) := by rw [ih]
_ = m + succ (n + k) := rfl
_ = m + (n + succ k) := rfl)
end Hidden
One again, you can reduce the proof to:
open Nat
theorem add_assoc (m n k : Nat) : m + n + k = m + (n + k) :=
Nat.recOn (motive := fun k => m + n + k = m + (n + k)) k
rfl
(fun k ih => by simp [Nat.add_succ, ih])
Suppose we try to prove the commutativity of addition. Choosing induction on the second argument, we might begin as follows:
open Nat
theorem add_comm (m n : Nat) : m + n = n + m :=
Nat.recOn (motive := fun x => m + x = x + m) n
(show m + 0 = 0 + m by rw [Nat.zero_add, Nat.add_zero])
(fun (n : Nat) (ih : m + n = n + m) =>
show m + succ n = succ n + m from
calc m + succ n = succ (m + n) := rfl
_ = succ (n + m) := by rw [ih]
_ = succ n + m := sorry)
At this point, we see that we need another supporting fact, namely, that succ (n + m) = succ n + m. You can prove this by induction on m:
open Nat
theorem succ_add (n m : Nat) : succ n + m = succ (n + m) :=
Nat.recOn (motive := fun x => succ n + x = succ (n + x)) m
(show succ n + 0 = succ (n + 0) from rfl)
(fun (m : Nat) (ih : succ n + m = succ (n + m)) =>
show succ n + succ m = succ (n + succ m) from
calc succ n + succ m = succ (succ n + m) := rfl
_ = succ (succ (n + m)) := by rw [ih]
_ = succ (n + succ m) := rfl)
You can then replace the sorry in the previous proof with succ_add. Yet again, the proofs can be compressed:
namespace Hidden
open Nat
theorem succ_add (n m : Nat) : succ n + m = succ (n + m) :=
Nat.recOn (motive := fun x => succ n + x = succ (n + x)) m
rfl
(fun m ih => by simp only [add_succ, ih])
theorem add_comm (m n : Nat) : m + n = n + m :=
Nat.recOn (motive := fun x => m + x = x + m) n
(by simp)
end Hidden
## Other Recursive Data Types
Let us consider some more examples of inductively defined types. For any type, α, the type List α of lists of elements of α is defined in the library.
namespace Hidden
inductive List (α : Type u) where
| nil : List α
| cons : α → List α → List α
namespace List
def append (as bs : List α) : List α :=
match as with
| nil => bs
| cons a as => cons a (append as bs)
theorem nil_append (as : List α) : append nil as = as :=
rfl
theorem cons_append (a : α) (as bs : List α)
: append (cons a as) bs = cons a (append as bs) :=
rfl
end List
end Hidden
A list of elements of type α is either the empty list, nil, or an element h : α followed by a list t : List α. The first element, h, is commonly known as the "head" of the list, and the remainder, t, is known as the "tail."
As an exercise, prove the following:
namespace Hidden
inductive List (α : Type u) where
| nil : List α
| cons : α → List α → List α
namespace List
def append (as bs : List α) : List α :=
match as with
| nil => bs
| cons a as => cons a (append as bs)
theorem nil_append (as : List α) : append nil as = as :=
rfl
theorem cons_append (a : α) (as bs : List α)
: append (cons a as) bs = cons a (append as bs) :=
rfl
theorem append_nil (as : List α) : append as nil = as :=
sorry
theorem append_assoc (as bs cs : List α)
: append (append as bs) cs = append as (append bs cs) :=
sorry
end List
end Hidden
Try also defining the function length : {α : Type u} → List α → Nat that returns the length of a list, and prove that it behaves as expected (for example, length (append as bs) = length as + length bs).
For another example, we can define the type of binary trees:
inductive BinaryTree where
| leaf : BinaryTree
| node : BinaryTree → BinaryTree → BinaryTree
In fact, we can even define the type of countably branching trees:
inductive CBTree where
| leaf : CBTree
| sup : (Nat → CBTree) → CBTree
namespace CBTree
def succ (t : CBTree) : CBTree :=
sup (fun _ => t)
def toCBTree : Nat → CBTree
| 0 => leaf
| n+1 => succ (toCBTree n)
def omega : CBTree :=
sup toCBTree
end CBTree
## Tactics for Inductive Types
Given the fundamental importance of inductive types in Lean, it should not be surprising that there are a number of tactics designed to work with them effectively. We describe some of them here.
The cases tactic works on elements of an inductively defined type, and does what the name suggests: it decomposes the element according to each of the possible constructors. In its most basic form, it is applied to an element x in the local context. It then reduces the goal to cases in which x is replaced by each of the constructions.
example (p : Nat → Prop) (hz : p 0) (hs : ∀ n, p (Nat.succ n)) : ∀ n, p n := by
intro n
cases n
. exact hz -- goal is p 0
. apply hs -- goal is a : ℕ ⊢ p (succ a)
There are extra bells and whistles. For one thing, cases allows you to choose the names for each alternative using a with clause. In the next example, for example, we choose the name m for the argument to succ, so that the second case refers to succ m. More importantly, the cases tactic will detect any items in the local context that depend on the target variable. It reverts these elements, does the split, and reintroduces them. In the example below, notice that the hypothesis h : n ≠ 0 becomes h : 0 ≠ 0 in the first branch, and h : succ m ≠ 0 in the second.
open Nat
example (n : Nat) (h : n ≠ 0) : succ (pred n) = n := by
cases n with
| zero =>
-- goal: h : 0 ≠ 0 ⊢ succ (pred 0) = 0
apply absurd rfl h
| succ m =>
-- second goal: h : succ m ≠ 0 ⊢ succ (pred (succ m)) = succ m
rfl
Notice that cases can be used to produce data as well as prove propositions.
def f (n : Nat) : Nat := by
cases n; exact 3; exact 7
example : f 0 = 3 := rfl
example : f 5 = 7 := rfl
Once again, cases will revert, split, and then reintroduce depedencies in the context.
def Tuple (α : Type) (n : Nat) :=
{ as : List α // as.length = n }
def f {n : Nat} (t : Tuple α n) : Nat := by
cases n; exact 3; exact 7
def myTuple : Tuple Nat 3 :=
⟨[0, 1, 2], rfl⟩
example : f myTuple = 7 :=
rfl
Here is an example with multiple constructors with arguments.
inductive Foo where
| bar1 : Nat → Nat → Foo
| bar2 : Nat → Nat → Nat → Foo
def silly (x : Foo) : Nat := by
cases x with
| bar1 a b => exact b
| bar2 c d e => exact e
The alternatives for each constructor don't need to be solved in the order the constructors were declared.
inductive Foo where
| bar1 : Nat → Nat → Foo
| bar2 : Nat → Nat → Nat → Foo
def silly (x : Foo) : Nat := by
cases x with
| bar2 c d e => exact e
| bar1 a b => exact b
The syntax of the with is convenient for writing structured proofs. Lean also provides a complementary case tactic, which allows you to focus on goal assign variable names.
inductive Foo where
| bar1 : Nat → Nat → Foo
| bar2 : Nat → Nat → Nat → Foo
def silly (x : Foo) : Nat := by
cases x
case bar2 c d e => exact e
case bar1 a b => exact b
The case tactic is clever, in that it will match the constructor to the appropriate goal. For example, we can fill the goals above in the opposite order:
inductive Foo where
| bar1 : Nat → Nat → Foo
| bar2 : Nat → Nat → Nat → Foo
def silly (x : Foo) : Nat := by
cases x
case bar1 a b => exact b
case bar2 c d e => exact e
You can also use cases with an arbitrary expression. Assuming that expression occurs in the goal, the cases tactic will generalize over the expression, introduce the resulting universally quantified variable, and case on that.
open Nat
example (p : Nat → Prop) (hz : p 0) (hs : ∀ n, p (succ n)) (m k : Nat)
: p (m + 3 * k) := by
cases m + 3 * k
exact hz -- goal is p 0
apply hs -- goal is a : ℕ ⊢ p (succ a)
Think of this as saying "split on cases as to whether m + 3 * k is zero or the successor of some number." The result is functionally equivalent to the following:
open Nat
example (p : Nat → Prop) (hz : p 0) (hs : ∀ n, p (succ n)) (m k : Nat)
: p (m + 3 * k) := by
generalize m + 3 * k = n
cases n
exact hz -- goal is p 0
apply hs -- goal is a : ℕ ⊢ p (succ a)
Notice that the expression m + 3 * k is erased by generalize; all that matters is whether it is of the form 0 or succ a. This form of cases will not revert any hypotheses that also mention the expression in the equation (in this case, m + 3 * k). If such a term appears in a hypothesis and you want to generalize over that as well, you need to revert it explicitly.
If the expression you case on does not appear in the goal, the cases tactic uses have to put the type of the expression into the context. Here is an example:
example (p : Prop) (m n : Nat)
(h₁ : m < n → p) (h₂ : m ≥ n → p) : p := by
cases Nat.lt_or_ge m n
case inl hlt => exact h₁ hlt
case inr hge => exact h₂ hge
The theorem Nat.lt_or_ge m n says m < n ∨ m ≥ n, and it is natural to think of the proof above as splitting on these two cases. In the first branch, we have the hypothesis h₁ : m < n, and in the second we have the hypothesis h₂ : m ≥ n. The proof above is functionally equivalent to the following:
example (p : Prop) (m n : Nat)
(h₁ : m < n → p) (h₂ : m ≥ n → p) : p := by
have h : m < n ∨ m ≥ n := Nat.lt_or_ge m n
cases h
case inl hlt => exact h₁ hlt
case inr hge => exact h₂ hge
After the first two lines, we have h : m < n ∨ m ≥ n as a hypothesis, and we simply do cases on that.
Here is another example, where we use the decidability of equality on the natural numbers to split on the cases m = n and m ≠ n.
#check Nat.sub_self
example (m n : Nat) : m - n = 0 ∨ m ≠ n := by
cases Decidable.em (m = n) with
| inl heq => rw [heq]; apply Or.inl; exact Nat.sub_self n
| inr hne => apply Or.inr; exact hne
Remember that if you open Classical, you can use the law of the excluded middle for any proposition at all. But using type class inference (see Chapter Type Classes), Lean can actually find the relevant decision procedure, which means that you can use the case split in a computable function.
Just as the cases tactic can be used to carry out proof by cases, the induction tactic can be used to carry out proofs by induction. The syntax is similar to that of cases, except that the argument can only be a term in the local context. Here is an example:
namespace Hidden
theorem zero_add (n : Nat) : 0 + n = n := by
induction n with
| zero => rfl
| succ n ih => rw [Nat.add_succ, ih]
end Hidden
As with cases, we can use the case tactic instead of with.
namespace Hidden
theorem zero_add (n : Nat) : 0 + n = n := by
induction n
case zero => rfl
case succ n ih => rw [Nat.add_succ, ih]
end Hidden
namespace Hidden
open Nat
theorem zero_add (n : Nat) : 0 + n = n := by
theorem succ_add (m n : Nat) : succ m + n = succ (m + n) := by
theorem add_comm (m n : Nat) : m + n = n + m := by
theorem add_assoc (m n k : Nat) : m + n + k = m + (n + k) := by
end Hidden
The induction tactic also supports user-defined induction principles with multiple targets (aka major premises).
/-
theorem Nat.mod.inductionOn
{motive : Nat → Nat → Sort u}
(x y : Nat)
(ind : ∀ x y, 0 < y ∧ y ≤ x → motive (x - y) y → motive x y)
(base : ∀ x y, ¬(0 < y ∧ y ≤ x) → motive x y)
: motive x y :=
-/
example (x : Nat) {y : Nat} (h : y > 0) : x % y < y := by
induction x, y using Nat.mod.inductionOn with
| ind x y h₁ ih =>
rw [Nat.mod_eq_sub_mod h₁.2]
exact ih h
| base x y h₁ =>
have : ¬ 0 < y ∨ ¬ y ≤ x := Iff.mp (Decidable.not_and_iff_or_not ..) h₁
match this with
| Or.inl h₁ => exact absurd h h₁
| Or.inr h₁ =>
have hgt : y > x := Nat.gt_of_not_le h₁
rw [← Nat.mod_eq_of_lt hgt] at hgt
assumption
You can use the match notation in tactics too:
example : p ∨ q → q ∨ p := by
intro h
match h with
| Or.inl _ => apply Or.inr; assumption
| Or.inr h2 => apply Or.inl; exact h2
As a convenience, pattern-matching has been integrated into tactics such as intro and funext.
example : s ∧ q ∧ r → p ∧ r → q ∧ p := by
intro ⟨_, ⟨hq, _⟩⟩ ⟨hp, _⟩
exact ⟨hq, hp⟩
example :
(fun (x : Nat × Nat) (y : Nat × Nat) => x.1 + y.2)
=
(fun (x : Nat × Nat) (z : Nat × Nat) => z.2 + x.1) := by
funext (a, b) (c, d)
show a + d = d + a
We close this section with one last tactic that is designed to facilitate working with inductive types, namely, the injection tactic. By design, the elements of an inductive type are freely generated, which is to say, the constructors are injective and have disjoint ranges. The injection tactic is designed to make use of this fact:
open Nat
example (m n k : Nat) (h : succ (succ m) = succ (succ n))
: n + k = m + k := by
injection h with h'
injection h' with h''
rw [h'']
The first instance of the tactic adds h' : succ m = succ n to the context, and the second adds h'' : m = n.
The injection tactic also detects contradictions that arise when different constructors are set equal to one another, and uses them to close the goal.
open Nat
example (m n : Nat) (h : succ m = 0) : n = n + 7 := by
injection h
example (m n : Nat) (h : succ m = 0) : n = n + 7 := by
example (h : 7 = 4) : False := by
As the second example shows, the contradiction tactic also detects contradictions of this form.
## Inductive Families
We are almost done describing the full range of inductive definitions accepted by Lean. So far, you have seen that Lean allows you to introduce inductive types with any number of recursive constructors. In fact, a single inductive definition can introduce an indexed family of inductive types, in a manner we now describe.
An inductive family is an indexed family of types defined by a simultaneous induction of the following form:
inductive foo : ... → Sort u where
| constructor₁ : ... → foo ...
| constructor₂ : ... → foo ...
...
| constructorₙ : ... → foo ...
In contrast to an ordinary inductive definition, which constructs an element of some Sort u, the more general version constructs a function ... → Sort u, where "..." denotes a sequence of argument types, also known as indices. Each constructor then constructs an element of some member of the family. One example is the definition of Vector α n, the type of vectors of elements of α of length n:
namespace Hidden
inductive Vector (α : Type u) : Nat → Type u where
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
end Hidden
Notice that the cons constructor takes an element of Vector α n and returns an element of Vector α (n+1), thereby using an element of one member of the family to build an element of another.
A more exotic example is given by the definition of the equality type in Lean:
namespace Hidden
inductive Eq {α : Sort u} (a : α) : α → Prop where
| refl : Eq a a
end Hidden
For each fixed α : Sort u and a : α, this definition constructs a family of types Eq a x, indexed by x : α. Notably, however, there is only one constructor, refl, which is an element of Eq a a. Intuitively, the only way to construct a proof of Eq a x is to use reflexivity, in the case where x is a. Note that Eq a a is the only inhabited type in the family of types Eq a x. The elimination principle generated by Lean is as follows:
universe u v
#check (@Eq.rec : {α : Sort u} → {a : α} → {motive : (x : α) → a = x → Sort v}
→ motive a rfl → {b : α} → (h : a = b) → motive b h)
It is a remarkable fact that all the basic axioms for equality follow from the constructor, refl, and the eliminator, Eq.rec. The definition of equality is atypical, however; see the discussion in Section Axiomatic Details.
The recursor Eq.rec is also used to define substitution:
namespace Hidden
theorem subst {α : Type u} {a b : α} {p : α → Prop} (h₁ : Eq a b) (h₂ : p a) : p b :=
Eq.rec (motive := fun x _ => p x) h₂ h₁
end Hidden
You can also define subst using match.
namespace Hidden
theorem subst {α : Type u} {a b : α} {p : α → Prop} (h₁ : Eq a b) (h₂ : p a) : p b :=
match h₁ with
| rfl => h₂
end Hidden
Actually, Lean compiles the match expressions using a definition based on Eq.rec.
namespace Hidden
theorem subst {α : Type u} {a b : α} {p : α → Prop} (h₁ : Eq a b) (h₂ : p a) : p b :=
match h₁ with
| rfl => h₂
set_option pp.all true
#print subst
-- ... subst.match_1 ...
#print subst.match_1
-- ... Eq.casesOn ...
#print Eq.casesOn
-- ... Eq.rec ...
end Hidden
Using the recursor or match with h₁ : a = b, we may assume a and b are the same, in which case, p b and p a are the same.
It is not hard to prove that Eq is symmetric and transitive. In the following example, we prove symm and leave as exercises the theorems trans and congr (congruence).
namespace Hidden
theorem symm {α : Type u} {a b : α} (h : Eq a b) : Eq b a :=
match h with
| rfl => rfl
theorem trans {α : Type u} {a b c : α} (h₁ : Eq a b) (h₂ : Eq b c) : Eq a c :=
sorry
theorem congr {α β : Type u} {a b : α} (f : α → β) (h : Eq a b) : Eq (f a) (f b) :=
sorry
end Hidden
In the type theory literature, there are further generalizations of inductive definitions, for example, the principles of induction-recursion and induction-induction. These are not supported by Lean.
## Axiomatic Details
We have described inductive types and their syntax through examples. This section provides additional information for those interested in the axiomatic foundations.
We have seen that the constructor to an inductive type takes parameters --- intuitively, the arguments that remain fixed throughout the inductive construction --- and indices, the arguments parameterizing the family of types that is simultaneously under construction. Each constructor should have a type, where the argument types are built up from previously defined types, the parameter and index types, and the inductive family currently being defined. The requirement is that if the latter is present at all, it occurs only strictly positively. This means simply that any argument to the constructor in which it occurs is a dependent arrow type in which the inductive type under definition occurs only as the resulting type, where the indices are given in terms of constants and previous arguments.
Since an inductive type lives in Sort u for some u, it is reasonable to ask which universe levels u can be instantiated to. Each constructor c in the definition of a family C of inductive types is of the form
c : (a : α) → (b : β[a]) → C a p[a,b]
where a is a sequence of data type parameters, b is the sequence of arguments to the constructors, and p[a, b] are the indices, which determine which element of the inductive family the construction inhabits. (Note that this description is somewhat misleading, in that the arguments to the constructor can appear in any order as long as the dependencies make sense.) The constraints on the universe level of C fall into two cases, depending on whether or not the inductive type is specified to land in Prop (that is, Sort 0).
Let us first consider the case where the inductive type is not specified to land in Prop. Then the universe level u is constrained to satisfy the following:
For each constructor c as above, and each βk[a] in the sequence β[a], if βk[a] : Sort v, we have uv.
In other words, the universe level u is required to be at least as large as the universe level of each type that represents an argument to a constructor.
When the inductive type is specified to land in Prop, there are no constraints on the universe levels of the constructor arguments. But these universe levels do have a bearing on the elimination rule. Generally speaking, for an inductive type in Prop, the motive of the elimination rule is required to be in Prop.
There is an exception to this last rule: we are allowed to eliminate from an inductively defined Prop to an arbitrary Sort when there is only one constructor and each constructor argument is either in Prop or an index. The intuition is that in this case the elimination does not make use of any information that is not already given by the mere fact that the type of argument is inhabited. This special case is known as singleton elimination.
We have already seen singleton elimination at play in applications of Eq.rec, the eliminator for the inductively defined equality type. We can use an element h : Eq a b to cast an element t' : p a to p b even when p a and p b are arbitrary types, because the cast does not produce new data; it only reinterprets the data we already have. Singleton elimination is also used with heterogeneous equality and well-founded recursion, which will be discussed in a Chapter Induction and Recursion.
## Mutual and Nested Inductive Types
We now consider two generalizations of inductive types that are often useful, which Lean supports by "compiling" them down to the more primitive kinds of inductive types described above. In other words, Lean parses the more general definitions, defines auxiliary inductive types based on them, and then uses the auxiliary types to define the ones we really want. Lean's equation compiler, described in the next chapter, is needed to make use of these types effectively. Nonetheless, it makes sense to describe the declarations here, because they are straightforward variations on ordinary inductive definitions.
First, Lean supports mutually defined inductive types. The idea is that we can define two (or more) inductive types at the same time, where each one refers to the other(s).
mutual
inductive Even : Nat → Prop where
| even_zero : Even 0
| even_succ : (n : Nat) → Odd n → Even (n + 1)
inductive Odd : Nat → Prop where
| odd_succ : (n : Nat) → Even n → Odd (n + 1)
end
In this example, two types are defined simultaneously: a natural number n is Even if it is 0 or one more than an Odd number, and Odd if it is one more than an Even number. In the exercises below, you are asked to spell out the details.
A mutual inductive definition can also be used to define the notation of a finite tree with nodes labelled by elements of α:
mutual
inductive Tree (α : Type u) where
| node : α → TreeList α → Tree α
inductive TreeList (α : Type u) where
| nil : TreeList α
| cons : Tree α → TreeList α → TreeList α
end
With this definition, one can construct an element of Tree α by giving an element of α together with a list of subtrees, possibly empty. The list of subtrees is represented by the type TreeList α, which is defined to be either the empty list, nil, or the cons of a tree and an element of TreeList α.
This definition is inconvenient to work with, however. It would be much nicer if the list of subtrees were given by the type List (Tree α), especially since Lean's library contains a number of functions and theorems for working with lists. One can show that the type TreeList α is isomorphic to List (Tree α), but translating results back and forth along this isomorphism is tedious.
In fact, Lean allows us to define the inductive type we really want:
inductive Tree (α : Type u) where
| mk : α → List (Tree α) → Tree α
This is known as a nested inductive type. It falls outside the strict specification of an inductive type given in the last section because Tree does not occur strictly positively among the arguments to mk, but, rather, nested inside the List type constructor. Lean then automatically builds the isomorphism between TreeList α and List (Tree α) in its kernel, and defines the constructors for Tree in terms of the isomorphism.
## Exercises
1. Try defining other operations on the natural numbers, such as multiplication, the predecessor function (with pred 0 = 0), truncated subtraction (with n - m = 0 when m is greater than or equal to n), and exponentiation. Then try proving some of their basic properties, building on the theorems we have already proved.
Since many of these are already defined in Lean's core library, you should work within a namespace named Hidden, or something like that, in order to avoid name clashes.
2. Define some operations on lists, like a length function or the reverse function. Prove some properties, such as the following:
a. length (s ++ t) = length s + length t
b. length (reverse t) = length t
c. reverse (reverse t) = t
3. Define an inductive data type consisting of terms built up from the following constructors:
• const n, a constant denoting the natural number n
• var n, a variable, numbered n
• plus s t, denoting the sum of s and t
• times s t, denoting the product of s and t
Recursively define a function that evaluates any such term with respect to an assignment of values to the variables.
4. Similarly, define the type of propositional formulas, as well as functions on the type of such formulas: an evaluation function, functions that measure the complexity of a formula, and a function that substitutes another formula for a given variable.
# Induction and Recursion
In the previous chapter, we saw that inductive definitions provide a powerful means of introducing new types in Lean. Moreover, the constructors and the recursors provide the only means of defining functions on these types. By the propositions-as-types correspondence, this means that induction is the fundamental method of proof.
Lean provides natural ways of defining recursive functions, performing pattern matching, and writing inductive proofs. It allows you to define a function by specifying equations that it should satisfy, and it allows you to prove a theorem by specifying how to handle various cases that can arise. Behind the scenes, these descriptions are "compiled" down to primitive recursors, using a procedure that we refer to as the "equation compiler." The equation compiler is not part of the trusted code base; its output consists of terms that are checked independently by the kernel.
## Pattern Matching
The interpretation of schematic patterns is the first step of the compilation process. We have seen that the casesOn recursor can be used to define functions and prove theorems by cases, according to the constructors involved in an inductively defined type. But complicated definitions may use several nested casesOn applications, and may be hard to read and understand. Pattern matching provides an approach that is more convenient, and familiar to users of functional programming languages.
Consider the inductively defined type of natural numbers. Every natural number is either zero or succ x, and so you can define a function from the natural numbers to an arbitrary type by specifying a value in each of those cases:
open Nat
def sub1 : Nat → Nat
| zero => zero
| succ x => x
def isZero : Nat → Bool
| zero => true
| succ x => false
The equations used to define these functions hold definitionally:
open Nat
def sub1 : Nat → Nat
| zero => zero
| succ x => x
def isZero : Nat → Bool
| zero => true
| succ x => false
example : sub1 0 = 0 := rfl
example (x : Nat) : sub1 (succ x) = x := rfl
example : isZero 0 = true := rfl
example (x : Nat) : isZero (succ x) = false := rfl
example : sub1 7 = 6 := rfl
example (x : Nat) : isZero (x + 3) = false := rfl
Instead of zero and succ, we can use more familiar notation:
def sub1 : Nat → Nat
| 0 => 0
| x+1 => x
def isZero : Nat → Bool
| 0 => true
| x+1 => false
Because addition and the zero notation have been assigned the [matchPattern] attribute, they can be used in pattern matching. Lean simply normalizes these expressions until the constructors zero and succ are exposed.
Pattern matching works with any inductive type, such as products and option types:
def swap : α × β → β × α
| (a, b) => (b, a)
def foo : Nat × Nat → Nat
| (m, n) => m + n
def bar : Option Nat → Nat
| some n => n + 1
| none => 0
Here we use it not only to define a function, but also to carry out a proof by cases:
namespace Hidden
def not : Bool → Bool
| true => false
| false => true
theorem not_not : ∀ (b : Bool), not (not b) = b
| true => rfl -- proof that not (not true) = true
| false => rfl -- proof that not (not false) = false
end Hidden
Pattern matching can also be used to destruct inductively defined propositions:
example (p q : Prop) : p ∧ q → q ∧ p
| And.intro h₁ h₂ => And.intro h₂ h₁
example (p q : Prop) : p ∨ q → q ∨ p
| Or.inl hp => Or.inr hp
| Or.inr hq => Or.inl hq
This provides a compact way of unpacking hypotheses that make use of logical connectives.
In all these examples, pattern matching was used to carry out a single case distinction. More interestingly, patterns can involve nested constructors, as in the following examples.
def sub2 : Nat → Nat
| 0 => 0
| 1 => 0
| x+2 => x
The equation compiler first splits on cases as to whether the input is zero or of the form succ x. It then does a case split on whether x is of the form zero or succ x. It determines the necessary case splits from the patterns that are presented to it, and raises an error if the patterns fail to exhaust the cases. Once again, we can use arithmetic notation, as in the version below. In either case, the defining equations hold definitionally.
def sub2 : Nat → Nat
| 0 => 0
| 1 => 0
| x+2 => x
example : sub2 0 = 0 := rfl
example : sub2 1 = 0 := rfl
example : sub2 (x+2) = x := rfl
example : sub2 5 = 3 := rfl
You can write #print sub2 to see how the function was compiled to recursors. (Lean will tell you that sub2 has been defined in terms of an internal auxiliary function, sub2.match_1, but you can print that out too.) Lean uses these auxiliary functions to compile match expressions. Actually, the definition above is expanded to
def sub2 : Nat → Nat :=
fun x =>
match x with
| 0 => 0
| 1 => 0
| x+2 => x
Here are some more examples of nested pattern matching:
example (p q : α → Prop)
: (∃ x, p x ∨ q x) → (∃ x, p x) ∨ (∃ x, q x)
| Exists.intro x (Or.inl px) => Or.inl (Exists.intro x px)
| Exists.intro x (Or.inr qx) => Or.inr (Exists.intro x qx)
def foo : Nat × Nat → Nat
| (0, n) => 0
| (m+1, 0) => 1
| (m+1, n+1) => 2
The equation compiler can process multiple arguments sequentially. For example, it would be more natural to define the previous example as a function of two arguments:
def foo : Nat → Nat → Nat
| 0, n => 0
| m+1, 0 => 1
| m+1, n+1 => 2
Here is another example:
def bar : List Nat → List Nat → Nat
| [], [] => 0
| a :: as, [] => a
| [], b :: bs => b
| a :: as, b :: bs => a + b
Note that the patterns are separated by commas.
In each of the following examples, splitting occurs on only the first argument, even though the others are included among the list of patterns.
namespace Hidden
def and : Bool → Bool → Bool
| true, a => a
| false, _ => false
def or : Bool → Bool → Bool
| true, _ => true
| false, a => a
def cond : Bool → α → α → α
| true, x, y => x
| false, x, y => y
end Hidden
Notice also that, when the value of an argument is not needed in the definition, you can use an underscore instead. This underscore is known as a wildcard pattern, or an anonymous variable. In contrast to usage outside the equation compiler, here the underscore does not indicate an implicit argument. The use of underscores for wildcards is common in functional programming languages, and so Lean adopts that notation. Section Wildcards and Overlapping Patterns expands on the notion of a wildcard, and Section Inaccessible Patterns explains how you can use implicit arguments in patterns as well.
As described in Chapter Inductive Types, inductive data types can depend on parameters. The following example defines the tail function using pattern matching. The argument α : Type is a parameter and occurs before the colon to indicate it does not participate in the pattern matching. Lean also allows parameters to occur after :, but it cannot pattern match on them.
def tail1 {α : Type u} : List α → List α
| [] => []
| a :: as => as
def tail2 : {α : Type u} → List α → List α
| α, [] => []
| α, a :: as => as
Despite the different placement of the parameter α in these two examples, in both cases it is treated in the same way, in that it does not participate in a case split.
Lean can also handle more complex forms of pattern matching, in which arguments to dependent types pose additional constraints on the various cases. Such examples of dependent pattern matching are considered in the Section Dependent Pattern Matching.
## Wildcards and Overlapping Patterns
Consider one of the examples from the last section:
def foo : Nat → Nat → Nat
| 0, n => 0
| m+1, 0 => 1
| m+1, n+1 => 2
An alternative presentation is:
def foo : Nat → Nat → Nat
| 0, n => 0
| m, 0 => 1
| m, n => 2
In the second presentation, the patterns overlap; for example, the pair of arguments 0 0 matches all three cases. But Lean handles the ambiguity by using the first applicable equation, so in this example the net result is the same. In particular, the following equations hold definitionally:
def foo : Nat → Nat → Nat
| 0, n => 0
| m, 0 => 1
| m, n => 2
example : foo 0 0 = 0 := rfl
example : foo 0 (n+1) = 0 := rfl
example : foo (m+1) 0 = 1 := rfl
example : foo (m+1) (n+1) = 2 := rfl
Since the values of m and n are not needed, we can just as well use wildcard patterns instead.
def foo : Nat → Nat → Nat
| 0, _ => 0
| _, 0 => 1
| _, _ => 2
You can check that this definition of foo satisfies the same definitional identities as before.
Some functional programming languages support incomplete patterns. In these languages, the interpreter produces an exception or returns an arbitrary value for incomplete cases. We can simulate the arbitrary value approach using the Inhabited type class. Roughly, an element of Inhabited α is a witness to the fact that there is an element of α; in the Chapter Type Classes we will see that Lean can be instructed that suitable base types are inhabited, and can automatically infer that other constructed types are inhabited. On this basis, the standard library provides a default element, defaulty, of any inhabited type.
We can also use the type Option α to simulate incomplete patterns. The idea is to return some a for the provided patterns, and use none for the incomplete cases. The following example demonstrates both approaches.
def f1 : Nat → Nat → Nat
| 0, _ => 1
| _, 0 => 2
| _, _ => default -- the "incomplete" case
example : f1 0 0 = 1 := rfl
example : f1 0 (a+1) = 1 := rfl
example : f1 (a+1) 0 = 2 := rfl
example : f1 (a+1) (b+1) = default := rfl
def f2 : Nat → Nat → Option Nat
| 0, _ => some 1
| _, 0 => some 2
| _, _ => none -- the "incomplete" case
example : f2 0 0 = some 1 := rfl
example : f2 0 (a+1) = some 1 := rfl
example : f2 (a+1) 0 = some 2 := rfl
example : f2 (a+1) (b+1) = none := rfl
The equation compiler is clever. If you leave out any of the cases in the following definition, the error message will let you know what has not been covered.
def bar : Nat → List Nat → Bool → Nat
| 0, _, false => 0
| 0, b :: _, _ => b
| 0, [], true => 7
| a+1, [], false => a
| a+1, [], true => a + 1
| a+1, b :: _, _ => a + b
It will also use an "if ... then ... else" instead of a casesOn in appropriate situations.
def foo : Char → Nat
| 'A' => 1
| 'B' => 2
| _ => 3
#print foo.match_1
## Structural Recursion and Induction
What makes the equation compiler powerful is that it also supports recursive definitions. In the next three sections, we will describe, respectively:
• structurally recursive definitions
• well-founded recursive definitions
• mutually recursive definitions
Generally speaking, the equation compiler processes input of the following form:
def foo (a : α) : (b : β) → γ
| [patterns₁] => t₁
...
| [patternsₙ] => tₙ
Here (a : α) is a sequence of parameters, (b : β) is the sequence of arguments on which pattern matching takes place, and γ is any type, which can depend on a and b. Each line should contain the same number of patterns, one for each element of β. As we have seen, a pattern is either a variable, a constructor applied to other patterns, or an expression that normalizes to something of that form (where the non-constructors are marked with the [matchPattern] attribute). The appearances of constructors prompt case splits, with the arguments to the constructors represented by the given variables. In Section Dependent Pattern Matching, we will see that it is sometimes necessary to include explicit terms in patterns that are needed to make an expression type check, though they do not play a role in pattern matching. These are called "inaccessible patterns" for that reason. But we will not need to use such inaccessible patterns before Section Dependent Pattern Matching.
As we saw in the last section, the terms t₁, ..., tₙ can make use of any of the parameters a, as well as any of the variables that are introduced in the corresponding patterns. What makes recursion and induction possible is that they can also involve recursive calls to foo. In this section, we will deal with structural recursion, in which the arguments to foo occurring on the right-hand side of the := are subterms of the patterns on the left-hand side. The idea is that they are structurally smaller, and hence appear in the inductive type at an earlier stage. Here are some examples of structural recursion from the last chapter, now defined using the equation compiler:
open Nat
def add : Nat → Nat → Nat
| m, zero => m
| m, succ n => succ (add m n)
theorem add_zero (m : Nat) : add m zero = m := rfl
theorem add_succ (m n : Nat) : add m (succ n) = succ (add m n) := rfl
| zero => rfl
| succ n => congrArg succ (zero_add n)
def mul : Nat → Nat → Nat
| n, zero => zero
| n, succ m => add (mul n m) n
The proof of zero_add makes it clear that proof by induction is really a form of recursion in Lean.
The example above shows that the defining equations for add hold definitionally, and the same is true of mul. The equation compiler tries to ensure that this holds whenever possible, as is the case with straightforward structural induction. In other situations, however, reductions hold only propositionally, which is to say, they are equational theorems that must be applied explicitly. The equation compiler generates such theorems internally. They are not meant to be used directly by the user; rather, the simp tactic is configured to use them when necessary. Thus both of the following proofs of zero_add work:
open Nat
def add : Nat → Nat → Nat
| m, zero => m
| m, succ n => succ (add m n)
| zero => by simp [add]
As with definition by pattern matching, parameters to a structural recursion or induction may appear before the colon. Such parameters are simply added to the local context before the definition is processed. For example, the definition of addition may also be written as follows:
open Nat
def add (m : Nat) : Nat → Nat
| zero => m
| succ n => succ (add m n)
You can also write the example above using match.
open Nat
def add (m n : Nat) : Nat :=
match n with
| zero => m
| succ n => succ (add m n)
A more interesting example of structural recursion is given by the Fibonacci function fib.
def fib : Nat → Nat
| 0 => 1
| 1 => 1
| n+2 => fib (n+1) + fib n
example : fib 0 = 1 := rfl
example : fib 1 = 1 := rfl
example : fib (n + 2) = fib (n + 1) + fib n := rfl
example : fib 7 = 21 := rfl
Here, the value of the fib function at n + 2 (which is definitionally equal to succ (succ n)) is defined in terms of the values at n + 1 (which is definitionally equivalent to succ n) and the value at n. This is a notoriously inefficient way of computing the fibonacci function, however, with an execution time that is exponential in n. Here is a better way:
def fibFast (n : Nat) : Nat :=
(loop n).2
where
loop : Nat → Nat × Nat
| 0 => (0, 1)
| n+1 => let p := loop n; (p.2, p.1 + p.2)
#eval fibFast 100
Here is the same definition using a let rec instead of a where.
def fibFast (n : Nat) : Nat :=
let rec loop : Nat → Nat × Nat
| 0 => (0, 1)
| n+1 => let p := loop n; (p.2, p.1 + p.2)
(loop n).2
In both cases, Lean generates the auxiliary function fibFast.loop.
To handle structural recursion, the equation compiler uses course-of-values recursion, using constants below and brecOn that are automatically generated with each inductively defined type. You can get a sense of how it works by looking at the types of Nat.below and Nat.brecOn:
variable (C : Nat → Type u)
#check (@Nat.below C : Nat → Type u)
#reduce @Nat.below C (3 : Nat)
#check (@Nat.brecOn C : (n : Nat) → ((n : Nat) → @Nat.below C n → C n) → C n)
The type @Nat.below C (3 : nat) is a data structure that stores elements of C 0, C 1, and C 2. The course-of-values recursion is implemented by Nat.brecOn. It enables us to define the value of a dependent function of type (n : Nat) → C n at a particular input n in terms of all the previous values of the function, presented as an element of @Nat.below C n.
The use of course-of-values recursion is one of the techniques the equation compiler uses to justify to the Lean kernel that a function terminates. It does not affect the code generator which compiles recursive functions as other functional programming language compilers. Recall that #eval fib <n> is exponential on <n>. On the other hand, #reduce fib <n> is efficient because it uses the definition sent to the kernel that is based on the brecOn construction.
def fib : Nat → Nat
| 0 => 1
| 1 => 1
| n+2 => fib (n+1) + fib n
-- #eval fib 50 -- slow
#reduce fib 50 -- fast
#print fib
Another good example of a recursive definition is the list append function.
def append : List α → List α → List α
| [], bs => bs
| a::as, bs => a :: append as bs
example : append [1, 2, 3] [4, 5] = [1, 2, 3, 4, 5] := rfl
Here is another: it adds elements of the first list to elements of the second list, until one of the two lists runs out.
def listAdd [Add α] : List α → List α → List α
| [], _ => []
| _, [] => []
| a :: as, b :: bs => (a + b) :: listAdd as bs
#eval listAdd [1, 2, 3] [4, 5, 6, 6, 9, 10]
-- [5, 7, 9]
You are encouraged to experiment with similar examples in the exercises below.
## Local recursive declarations
You can define local recursive declarations using the let rec keyword.
def replicate (n : Nat) (a : α) : List α :=
let rec loop : Nat → List α → List α
| 0, as => as
| n+1, as => loop n (a::as)
loop n []
#check @replicate.loop
-- {α : Type} → α → Nat → List α → List α
Lean creates an auxiliary declaration for each let rec. In the example above, it created the declaration replicate.loop for the let rec loop occurring at replicate. Note that, Lean "closes" the declaration by adding any local variable occurring in the let rec declaration as additional parameters. For example, the local variable a occurs at let rec loop.
You can also use let rec in tactic mode and for creating proofs by induction.
def replicate (n : Nat) (a : α) : List α :=
let rec loop : Nat → List α → List α
| 0, as => as
| n+1, as => loop n (a::as)
loop n []
theorem length_replicate (n : Nat) (a : α) : (replicate n a).length = n := by
let rec aux (n : Nat) (as : List α)
: (replicate.loop a n as).length = n + as.length := by
match n with
| 0 => simp [replicate.loop]
exact aux n []
You can also introduce auxiliary recursive declarations using where clause after your definition. Lean converts them into a let rec.
def replicate (n : Nat) (a : α) : List α :=
loop n []
where
loop : Nat → List α → List α
| 0, as => as
| n+1, as => loop n (a::as)
theorem length_replicate (n : Nat) (a : α) : (replicate n a).length = n := by
exact aux n []
where
aux (n : Nat) (as : List α)
: (replicate.loop a n as).length = n + as.length := by
match n with
| 0 => simp [replicate.loop]
## Well-Founded Recursion and Induction
When structural recursion cannot be used, we can prove termination using well-founded recursion. We need a well-founded relation and a proof that each recursive application is decreasing with respect to this relation. Dependent type theory is powerful enough to encode and justify well-founded recursion. Let us start with the logical background that is needed to understand how it works.
Lean's standard library defines two predicates, Acc r a and WellFounded r, where r is a binary relation on a type α, and a is an element of type α.
variable (α : Sort u)
variable (r : α → α → Prop)
#check (Acc r : α → Prop)
#check (WellFounded r : Prop)
The first, Acc, is an inductively defined predicate. According to its definition, Acc r x is equivalent to ∀ y, r y x → Acc r y. If you think of r y x as denoting a kind of order relation y ≺ x, then Acc r x says that x is accessible from below, in the sense that all its predecessors are accessible. In particular, if x has no predecessors, it is accessible. Given any type α, we should be able to assign a value to each accessible element of α, recursively, by assigning values to all its predecessors first.
The statement that r is well founded, denoted WellFounded r, is exactly the statement that every element of the type is accessible. By the above considerations, if r is a well-founded relation on a type α, we should have a principle of well-founded recursion on α, with respect to the relation r. And, indeed, we do: the standard library defines WellFounded.fix, which serves exactly that purpose.
noncomputable def f {α : Sort u}
(r : α → α → Prop)
(h : WellFounded r)
(C : α → Sort v)
(F : (x : α) → ((y : α) → r y x → C y) → C x)
: (x : α) → C x := WellFounded.fix h F
There is a long cast of characters here, but the first block we have already seen: the type, α, the relation, r, and the assumption, h, that r is well founded. The variable C represents the motive of the recursive definition: for each element x : α, we would like to construct an element of C x. The function F provides the inductive recipe for doing that: it tells us how to construct an element C x, given elements of C y for each predecessor y of x.
Note that WellFounded.fix works equally well as an induction principle. It says that if ≺ is well founded and you want to prove ∀ x, C x, it suffices to show that for an arbitrary x, if we have ∀ y ≺ x, C y, then we have C x.
In the example above we use the modifier noncomputable because the code generator currently does not support WellFounded.fix. The function WellFounded.fix is another tool Lean uses to justify that a function terminates.
Lean knows that the usual order < on the natural numbers is well founded. It also knows a number of ways of constructing new well founded orders from others, for example, using lexicographic order.
Here is essentially the definition of division on the natural numbers that is found in the standard library.
open Nat
theorem div_lemma {x y : Nat} : 0 < y ∧ y ≤ x → x - y < x :=
fun h => sub_lt (Nat.lt_of_lt_of_le h.left h.right) h.left
def div.F (x : Nat) (f : (x₁ : Nat) → x₁ < x → Nat → Nat) (y : Nat) : Nat :=
if h : 0 < y ∧ y ≤ x then
f (x - y) (div_lemma h) y + 1
else
zero
noncomputable def div := WellFounded.fix (measure id).wf div.F
#reduce div 8 2 -- 4
The definition is somewhat inscrutable. Here the recursion is on x, and div.F x f : Nat → Nat returns the "divide by y" function for that fixed x. You have to remember that the second argument to div.F, the recipe for the recursion, is a function that is supposed to return the divide by y function for all values x₁ smaller than x.
The elaborator is designed to make definitions like this more convenient. It accepts the following:
def div (x y : Nat) : Nat :=
if h : 0 < y ∧ y ≤ x then
have : x - y < x := Nat.sub_lt (Nat.lt_of_lt_of_le h.1 h.2) h.1
div (x - y) y + 1
else
0
When Lean encounters a recursive definition, it first tries structural recursion, and only when that fails, does it fall back on well-founded recursion. Lean uses the tactic decreasing_tactic to show that the recursive applications are smaller. The auxiliary propostion x - y < x in the example above should be viewed as a hint for this tactic.
The defining equation for div does not hold definitionally, but we can unfold div using the unfold tactic. We use conv to select which div application we want to unfold.
def div (x y : Nat) : Nat :=
if h : 0 < y ∧ y ≤ x then
have : x - y < x := Nat.sub_lt (Nat.lt_of_lt_of_le h.1 h.2) h.1
div (x - y) y + 1
else
0
example (x y : Nat) : div x y = if 0 < y ∧ y ≤ x then div (x - y) y + 1 else 0 := by
conv => lhs; unfold div -- unfold occurrence in the left-hand-side of the equation
example (x y : Nat) (h : 0 < y ∧ y ≤ x) : div x y = div (x - y) y + 1 := by
conv => lhs; unfold div
simp [h]
The following example is similar: it converts any natural number to a binary expression, represented as a list of 0's and 1's. We have to provide evidence that the recursive call is decreasing, which we do here with a sorry. The sorry does not prevent the interpreter from evaluating the function successfully.
def natToBin : Nat → List Nat
| 0 => [0]
| 1 => [1]
| n + 2 =>
have : (n + 2) / 2 < n + 2 := sorry
natToBin ((n + 2) / 2) ++ [n % 2]
#eval natToBin 1234567
As a final example, we observe that Ackermann's function can be defined directly, because it is justified by the well foundedness of the lexicographic order on the natural numbers. The termination_by clause instructs Lean to use a lexicographic order. This clause is actually mapping the function arguments to elements of type Nat × Nat. Then, Lean uses typeclass resolution to synthesize an element of type WellFoundedRelation (Nat × Nat).
def ack : Nat → Nat → Nat
| 0, y => y+1
| x+1, 0 => ack x 1
| x+1, y+1 => ack x (ack (x+1) y)
termination_by ack x y => (x, y)
Note that a lexicographic order is used in the example above because the instance WellFoundedRelation (α × β) uses a lexicographic order. Lean also defines the instance
instance (priority := low) [SizeOf α] : WellFoundedRelation α :=
sizeOfWFRel
In the following example, we prove termination by showing that as.size - i is decreasing in the recursive application.
def takeWhile (p : α → Bool) (as : Array α) : Array α :=
go 0 #[]
where
go (i : Nat) (r : Array α) : Array α :=
if h : i < as.size then
let a := as.get ⟨i, h⟩
if p a then
go (i+1) (r.push a)
else
r
else
r
termination_by go i r => as.size - i
Note that, auxiliary function go is recursive in this example, but takeWhile is not.
By default, Lean uses the tactic decreasing_tactic to prove recursive applications are decreasing. The modifier decreasing_by allows us to provide our own tactic. Here is an example.
theorem div_lemma {x y : Nat} : 0 < y ∧ y ≤ x → x - y < x :=
fun ⟨ypos, ylex⟩ => Nat.sub_lt (Nat.lt_of_lt_of_le ypos ylex) ypos
def div (x y : Nat) : Nat :=
if h : 0 < y ∧ y ≤ x then
div (x - y) y + 1
else
0
decreasing_by apply div_lemma; assumption
Note that decreasing_by is not replacement for termination_by, they complement each other. termination_by is used to specify a well-founded relation, and decreasing_by for providing our own tactic for showing recursive applications are decreasing. In the following example, we use both of them.
def ack : Nat → Nat → Nat
| 0, y => y+1
| x+1, 0 => ack x 1
| x+1, y+1 => ack x (ack (x+1) y)
termination_by ack x y => (x, y)
decreasing_by
simp_wf -- unfolds well-founded recursion auxiliary definitions
first | apply Prod.Lex.right; simp_arith
| apply Prod.Lex.left; simp_arith
We can use decreasing_by sorry to instruct Lean to "trust" us that the function terminates.
def natToBin : Nat → List Nat
| 0 => [0]
| 1 => [1]
| n + 2 => natToBin ((n + 2) / 2) ++ [n % 2]
decreasing_by sorry
#eval natToBin 1234567
Recall that using sorry is equivalent to using a new axiom, and should be avoided. In the following example, we used the sorry to prove False. The command #print axioms shows that unsound depends on the unsound axiom sorryAx used to implement sorry.
def unsound (x : Nat) : False :=
unsound (x + 1)
decreasing_by sorry
#check unsound 0
-- unsound 0 is a proof of False
#print axioms unsound
-- 'unsound' depends on axioms: [sorryAx]
Summary:
• If there is no termination_by, a well-founded relation is derived (if possible) by selecting an argument and then using typeclass resolution to synthesize a well-founded relation for this argument's type.
• If termination_by is specified, it maps the arguments of the function to a type α and type class resolution is again used. Recall that, the default instance for β × γ is a lexicographic order based on the well-founded relations for β and γ.
• The default well-founded relation instance for Nat is <.
• By default, the tactic decreasing_tactic is used to show that recursive applications are smaller with respect to the selected well-founded relation. If decreasing_tactic fails, the error message includes the remaining goal ... |- G. Note that, the decreasing_tactic uses assumption. So, you can include a have-expression to prove goal G. You can also provide your own tactic using decreasing_by.
## Mutual Recursion
Lean also supports mutual recursive definitions. The syntax is similar to that for mutual inductive types. Here is an example:
mutual
def even : Nat → Bool
| 0 => true
| n+1 => odd n
def odd : Nat → Bool
| 0 => false
| n+1 => even n
end
example : even (a + 1) = odd a := by
simp [even]
example : odd (a + 1) = even a := by
simp [odd]
theorem even_eq_not_odd : ∀ a, even a = not (odd a) := by
intro a; induction a
. simp [even, odd]
. simp [even, odd, *]
What makes this a mutual definition is that even is defined recursively in terms of odd, while odd is defined recursively in terms of even. Under the hood, this is compiled as a single recursive definition. The internally defined function takes, as argument, an element of a sum type, either an input to even, or an input to odd. It then returns an output appropriate to the input. To define that function, Lean uses a suitable well-founded measure. The internals are meant to be hidden from users; the canonical way to make use of such definitions is to use simp (or unfold), as we did above.
Mutual recursive definitions also provide natural ways of working with mutual and nested inductive types. Recall the definition of Even and Odd as mutual inductive predicates as presented before.
mutual
inductive Even : Nat → Prop where
| even_zero : Even 0
| even_succ : ∀ n, Odd n → Even (n + 1)
inductive Odd : Nat → Prop where
| odd_succ : ∀ n, Even n → Odd (n + 1)
end
The constructors, even_zero, even_succ, and odd_succ provide positive means for showing that a number is even or odd. We need to use the fact that the inductive type is generated by these constructors to know that the zero is not odd, and that the latter two implications reverse. As usual, the constructors are kept in a namespace that is named after the type being defined, and the command open Even Odd allows us to access them move conveniently.
mutual
inductive Even : Nat → Prop where
| even_zero : Even 0
| even_succ : ∀ n, Odd n → Even (n + 1)
inductive Odd : Nat → Prop where
| odd_succ : ∀ n, Even n → Odd (n + 1)
end
open Even Odd
theorem not_odd_zero : ¬ Odd 0 :=
fun h => nomatch h
theorem even_of_odd_succ : ∀ n, Odd (n + 1) → Even n
| _, odd_succ n h => h
theorem odd_of_even_succ : ∀ n, Even (n + 1) → Odd n
| _, even_succ n h => h
For another example, suppose we use a nested inductive type to define a set of terms inductively, so that a term is either a constant (with a name given by a string), or the result of applying a constant to a list of constants.
inductive Term where
| const : String → Term
| app : String → List term → Term
We can then use a mutual recursive definition to count the number of constants occurring in a term, as well as the number occurring in a list of terms.
inductive Term where
| const : String → Term
| app : String → List Term → Term
namespace Term
mutual
def numConsts : Term → Nat
| const _ => 1
| app _ cs => numConstsLst cs
def numConstsLst : List Term → Nat
| [] => 0
| c :: cs => numConsts c + numConstsLst cs
end
def sample := app "f" [app "g" [const "x"], const "y"]
#eval numConsts sample
end Term
As a final example, we define a function replaceConst a b e that replaces a constant a with b in a term e, and then prove the numbers of constants is the same. Note that, our proof uses mutual recursion (aka induction).
inductive Term where
| const : String → Term
| app : String → List Term → Term
namespace Term
mutual
def numConsts : Term → Nat
| const _ => 1
| app _ cs => numConstsLst cs
def numConstsLst : List Term → Nat
| [] => 0
| c :: cs => numConsts c + numConstsLst cs
end
mutual
def replaceConst (a b : String) : Term → Term
| const c => if a == c then const b else const c
| app f cs => app f (replaceConstLst a b cs)
def replaceConstLst (a b : String) : List Term → List Term
| [] => []
| c :: cs => replaceConst a b c :: replaceConstLst a b cs
end
mutual
theorem numConsts_replaceConst (a b : String) (e : Term)
: numConsts (replaceConst a b e) = numConsts e := by
match e with
| const c => simp [replaceConst]; split <;> simp [numConsts]
| app f cs => simp [replaceConst, numConsts, numConsts_replaceConstLst a b cs]
theorem numConsts_replaceConstLst (a b : String) (es : List Term)
: numConstsLst (replaceConstLst a b es) = numConstsLst es := by
match es with
| [] => simp [replaceConstLst, numConstsLst]
| c :: cs =>
simp [replaceConstLst, numConstsLst, numConsts_replaceConst a b c,
numConsts_replaceConstLst a b cs]
end
## Dependent Pattern Matching
All the examples of pattern matching we considered in Section Pattern Matching can easily be written using cases_on and rec_on. However, this is often not the case with indexed inductive families such as vector α n, since case splits impose constraints on the values of the indices. Without the equation compiler, we would need a lot of boilerplate code to define very simple functions such as map, zip, and unzip using recursors. To understand the difficulty, consider what it would take to define a function tail which takes a vector v : vector α (succ n) and deletes the first element. A first thought might be to use the casesOn function:
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
#check @Vector.casesOn
/-
{α : Type u}
→ {motive : (a : Nat) → Vector α a → Sort v} →
→ {a : Nat} → (t : Vector α a)
→ motive 0 nil
→ ((a : α) → {n : Nat} → (a_1 : Vector α n) → motive (n + 1) (cons a a_1))
→ motive a t
-/
end Vector
But what value should we return in the nil case? Something funny is going on: if v has type Vector α (succ n), it can't be nil, but it is not clear how to tell that to casesOn.
One solution is to define an auxiliary function:
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def tailAux (v : Vector α m) : m = n + 1 → Vector α n :=
Vector.casesOn (motive := fun x _ => x = n + 1 → Vector α n) v
(fun h : 0 = n + 1 => Nat.noConfusion h)
(fun (a : α) (m : Nat) (as : Vector α m) =>
fun (h : m + 1 = n + 1) =>
Nat.noConfusion h (fun h1 : m = n => h1 ▸ as))
def tail (v : Vector α (n+1)) : Vector α n :=
tailAux v rfl
end Vector
In the nil case, m is instantiated to 0, and noConfusion makes use of the fact that 0 = succ n cannot occur. Otherwise, v is of the form a :: w, and we can simply return w, after casting it from a vector of length m to a vector of length n.
The difficulty in defining tail is to maintain the relationships between the indices. The hypothesis e : m = n + 1 in tailAux is used to communicate the relationship between n and the index associated with the minor premise. Moreover, the zero = n + 1 case is unreachable, and the canonical way to discard such a case is to use noConfusion.
The tail function is, however, easy to define using recursive equations, and the equation compiler generates all the boilerplate code automatically for us. Here are a number of similar examples:
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def head : {n : Nat} → Vector α (n+1) → α
| n, cons a as => a
def tail : {n : Nat} → Vector α (n+1) → Vector α n
| n, cons a as => as
theorem eta : ∀ {n : Nat} (v : Vector α (n+1)), cons (head v) (tail v) = v
| n, cons a as => rfl
def map (f : α → β → γ) : {n : Nat} → Vector α n → Vector β n → Vector γ n
| 0, nil, nil => nil
| n+1, cons a as, cons b bs => cons (f a b) (map f as bs)
def zip : {n : Nat} → Vector α n → Vector β n → Vector (α × β) n
| 0, nil, nil => nil
| n+1, cons a as, cons b bs => cons (a, b) (zip as bs)
end Vector
Note that we can omit recursive equations for "unreachable" cases such as head nil. The automatically generated definitions for indexed families are far from straightforward. For example:
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def map (f : α → β → γ) : {n : Nat} → Vector α n → Vector β n → Vector γ n
| 0, nil, nil => nil
| n+1, cons a as, cons b bs => cons (f a b) (map f as bs)
#print map
#print map.match_1
end Vector
The map function is even more tedious to define by hand than the tail function. We encourage you to try it, using recOn, casesOn and noConfusion.
## Inaccessible Patterns
Sometimes an argument in a dependent matching pattern is not essential to the definition, but nonetheless has to be included to specialize the type of the expression appropriately. Lean allows users to mark such subterms as inaccessible for pattern matching. These annotations are essential, for example, when a term occurring in the left-hand side is neither a variable nor a constructor application, because these are not suitable targets for pattern matching. We can view such inaccessible patterns as "don't care" components of the patterns. You can declare a subterm inaccessible by writing .(t). If the inaccessible pattern can be inferred, you can also write _.
The following example, we declare an inductive type that defines the property of "being in the image of f". You can view an element of the type ImageOf f b as evidence that b is in the image of f, whereby the constructor imf is used to build such evidence. We can then define any function f with an "inverse" which takes anything in the image of f to an element that is mapped to it. The typing rules forces us to write f a for the first argument, but this term is neither a variable nor a constructor application, and plays no role in the pattern-matching definition. To define the function inverse below, we have to mark f a inaccessible.
inductive ImageOf {α β : Type u} (f : α → β) : β → Type u where
| imf : (a : α) → ImageOf f (f a)
open ImageOf
def inverse {f : α → β} : (b : β) → ImageOf f b → α
| .(f a), imf a => a
def inverse' {f : α → β} : (b : β) → ImageOf f b → α
| _, imf a => a
In the example above, the inaccessible annotation makes it clear that f is not a pattern matching variable.
Inaccessible patterns can be used to clarify and control definitions that make use of dependent pattern matching. Consider the following definition of the function Vector.add, which adds two vectors of elements of a type, assuming that type has an associated addition function:
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def add [Add α] : {n : Nat} → Vector α n → Vector α n → Vector α n
| 0, nil, nil => nil
| n+1, cons a as, cons b bs => cons (a + b) (add as bs)
end Vector
The argument {n : Nat} appear after the colon, because it cannot be held fixed throughout the definition. When implementing this definition, the equation compiler starts with a case distinction as to whether the first argument is 0 or of the form n+1. This is followed by nested case splits on the next two arguments, and in each case the equation compiler rules out the cases are not compatible with the first pattern.
But, in fact, a case split is not required on the first argument; the casesOn eliminator for Vector automatically abstracts this argument and replaces it by 0 and n + 1 when we do a case split on the second argument. Using inaccessible patterns, we can prompt the equation compiler to avoid the case split on n
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def add [Add α] : {n : Nat} → Vector α n → Vector α n → Vector α n
| .(_), nil, nil => nil
| .(_), cons a as, cons b bs => cons (a + b) (add as bs)
end Vector
Marking the position as an inaccessible pattern tells the equation compiler first, that the form of the argument should be inferred from the constraints posed by the other arguments, and, second, that the first argument should not participate in pattern matching.
The inaccessible pattern .(_) can be written as _ for convenience.
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def add [Add α] : {n : Nat} → Vector α n → Vector α n → Vector α n
| _, nil, nil => nil
| _, cons a as, cons b bs => cons (a + b) (add as bs)
end Vector
As we mentioned above, the argument {n : Nat} is part of the pattern matching, because it cannot be held fixed throughout the definition. In previous Lean versions, users often found it cumbersome to have to include these extra discriminants. Thus, Lean 4 implements a new feature, discriminant refinement, which includes these extra discriminants automatically for us.
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def add [Add α] {n : Nat} : Vector α n → Vector α n → Vector α n
| nil, nil => nil
| cons a as, cons b bs => cons (a + b) (add as bs)
end Vector
When combined with the auto bound implicits feature, you can simplify the declare further and write:
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def add [Add α] : Vector α n → Vector α n → Vector α n
| nil, nil => nil
| cons a as, cons b bs => cons (a + b) (add as bs)
end Vector
Using these new features, you can write the other vector functions defined in the previous sections more compactly as follows:
inductive Vector (α : Type u) : Nat → Type u
| nil : Vector α 0
| cons : α → {n : Nat} → Vector α n → Vector α (n+1)
namespace Vector
def head : Vector α (n+1) → α
| cons a as => a
def tail : Vector α (n+1) → Vector α n
| cons a as => as
theorem eta : (v : Vector α (n+1)) → cons (head v) (tail v) = v
| cons a as => rfl
def map (f : α → β → γ) : Vector α n → Vector β n → Vector γ n
| nil, nil => nil
| cons a as, cons b bs => cons (f a b) (map f as bs)
def zip : Vector α n → Vector β n → Vector (α × β) n
| nil, nil => nil
| cons a as, cons b bs => cons (a, b) (zip as bs)
end Vector
## Match Expressions
Lean also provides a compiler for match-with expressions found in many functional languages.
def isNotZero (m : Nat) : Bool :=
match m with
| 0 => false
| n+1 => true
This does not look very different from an ordinary pattern matching definition, but the point is that a match can be used anywhere in an expression, and with arbitrary arguments.
def isNotZero (m : Nat) : Bool :=
match m with
| 0 => false
| n+1 => true
def filter (p : α → Bool) : List α → List α
| [] => []
| a :: as =>
match p a with
| true => a :: filter p as
| false => filter p as
example : filter isNotZero [1, 0, 0, 3, 0] = [1, 3] := rfl
Here is another example:
def foo (n : Nat) (b c : Bool) :=
5 + match n - 5, b && c with
| 0, true => 0
| m+1, true => m + 7
| 0, false => 5
| m+1, false => m + 3
#eval foo 7 true false
example : foo 7 true false = 9 := rfl
Lean uses the match construct internally to implement pattern-matching in all parts of the system. Thus, all four of these definitions have the same net effect.
def bar₁ : Nat × Nat → Nat
| (m, n) => m + n
def bar₂ (p : Nat × Nat) : Nat :=
match p with
| (m, n) => m + n
def bar₃ : Nat × Nat → Nat :=
fun (m, n) => m + n
def bar₄ (p : Nat × Nat) : Nat :=
let (m, n) := p; m + n
These variations are equally useful for destructing propositions:
variable (p q : Nat → Prop)
example : (∃ x, p x) → (∃ y, q y) → ∃ x y, p x ∧ q y
| ⟨x, px⟩, ⟨y, qy⟩ => ⟨x, y, px, qy⟩
example (h₀ : ∃ x, p x) (h₁ : ∃ y, q y)
: ∃ x y, p x ∧ q y :=
match h₀, h₁ with
| ⟨x, px⟩, ⟨y, qy⟩ => ⟨x, y, px, qy⟩
example : (∃ x, p x) → (∃ y, q y) → ∃ x y, p x ∧ q y :=
fun ⟨x, px⟩ ⟨y, qy⟩ => ⟨x, y, px, qy⟩
example (h₀ : ∃ x, p x) (h₁ : ∃ y, q y)
: ∃ x y, p x ∧ q y :=
let ⟨x, px⟩ := h₀
let ⟨y, qy⟩ := h₁
⟨x, y, px, qy⟩
## Local Recursive Declarations
You can define local recursive declarations using the let rec keyword.
def replicate (n : Nat) (a : α) : List α :=
let rec loop : Nat → List α → List α
| 0, as => as
| n+1, as => loop n (a::as)
loop n []
#check @replicate.loop
-- {α : Type} → α → Nat → List α → List α
Lean creates an auxiliary declaration for each let rec. In the example above, it created the declaration replicate.loop for the let rec loop occurring at replicate. Note that, Lean "closes" the declaration by adding any local variable occurring in the let rec declaration as additional parameters. For example, the local variable a occurs at let rec loop.
You can also use let rec in tactic mode and for creating proofs by induction.
def replicate (n : Nat) (a : α) : List α :=
let rec loop : Nat → List α → List α
| 0, as => as
| n+1, as => loop n (a::as)
loop n []
theorem length_replicate (n : Nat) (a : α) : (replicate n a).length = n := by
let rec aux (n : Nat) (as : List α)
: (replicate.loop a n as).length = n + as.length := by
match n with
| 0 => simp [replicate.loop]
exact aux n []
You can also introduce auxiliary recursive declarations using a where clause after your definition. Lean converts them into a let rec.
def replicate (n : Nat) (a : α) : List α :=
loop n []
where
loop : Nat → List α → List α
| 0, as => as
| n+1, as => loop n (a::as)
theorem length_replicate (n : Nat) (a : α) : (replicate n a).length = n := by
exact aux n []
where
aux (n : Nat) (as : List α)
: (replicate.loop a n as).length = n + as.length := by
match n with
| 0 => simp [replicate.loop]
## Exercises
1. Open a namespace Hidden to avoid naming conflicts, and use the equation compiler to define addition, multiplication, and exponentiation on the natural numbers. Then use the equation compiler to derive some of their basic properties.
2. Similarly, use the equation compiler to define some basic operations on lists (like the reverse function) and prove theorems about lists by induction (such as the fact that reverse (reverse xs) = xs for any list xs).
3. Define your own function to carry out course-of-value recursion on the natural numbers. Similarly, see if you can figure out how to define WellFounded.fix on your own.
4. Following the examples in Section Dependent Pattern Matching, define a function that will append two vectors. This is tricky; you will have to define an auxiliary function.
5. Consider the following type of arithmetic expressions. The idea is that var n is a variable, vₙ, and const n is the constant whose value is n.
inductive Expr where
| const : Nat → Expr
| var : Nat → Expr
| plus : Expr → Expr → Expr
| times : Expr → Expr → Expr
deriving Repr
open Expr
def sampleExpr : Expr :=
plus (times (var 0) (const 7)) (times (const 2) (var 1))
Here sampleExpr represents (v₀ * 7) + (2 * v₁).
Write a function that evaluates such an expression, evaluating each var n to v n.
inductive Expr where
| const : Nat → Expr
| var : Nat → Expr
| plus : Expr → Expr → Expr
| times : Expr → Expr → Expr
deriving Repr
open Expr
def sampleExpr : Expr :=
plus (times (var 0) (const 7)) (times (const 2) (var 1))
def eval (v : Nat → Nat) : Expr → Nat
| const n => sorry
| var n => v n
| plus e₁ e₂ => sorry
| times e₁ e₂ => sorry
def sampleVal : Nat → Nat
| 0 => 5
| 1 => 6
| _ => 0
-- Try it out. You should get 47 here.
-- #eval eval sampleVal sampleExpr
Implement "constant fusion," a procedure that simplifies subterms like 5 + 7 to 12. Using the auxiliary function simpConst, define a function "fuse": to simplify a plus or a times, first simplify the arguments recursively, and then apply simpConst to try to simplify the result.
inductive Expr where
| const : Nat → Expr
| var : Nat → Expr
| plus : Expr → Expr → Expr
| times : Expr → Expr → Expr
deriving Repr
open Expr
def eval (v : Nat → Nat) : Expr → Nat
| const n => sorry
| var n => v n
| plus e₁ e₂ => sorry
| times e₁ e₂ => sorry
def simpConst : Expr → Expr
| plus (const n₁) (const n₂) => const (n₁ + n₂)
| times (const n₁) (const n₂) => const (n₁ * n₂)
| e => e
def fuse : Expr → Expr := sorry
theorem simpConst_eq (v : Nat → Nat)
: ∀ e : Expr, eval v (simpConst e) = eval v e :=
sorry
theorem fuse_eq (v : Nat → Nat)
: ∀ e : Expr, eval v (fuse e) = eval v e :=
sorry
The last two theorems show that the definitions preserve the value.
# Structures and Records
We have seen that Lean's foundational system includes inductive types. We have, moreover, noted that it is a remarkable fact that it is possible to construct a substantial edifice of mathematics based on nothing more than the type universes, dependent arrow types, and inductive types; everything else follows from those. The Lean standard library contains many instances of inductive types (e.g., Nat, Prod, List), and even the logical connectives are defined using inductive types.
Recall that a non-recursive inductive type that contains only one constructor is called a structure or record. The product type is a structure, as is the dependent product (Sigma) type. In general, whenever we define a structure S, we usually define projection functions that allow us to "destruct" each instance of S and retrieve the values that are stored in its fields. The functions prod.fst and prod.snd, which return the first and second elements of a pair, are examples of such projections.
When writing programs or formalizing mathematics, it is not uncommon to define structures containing many fields. The structure command, available in Lean, provides infrastructure to support this process. When we define a structure using this command, Lean automatically generates all the projection functions. The structure command also allows us to define new structures based on previously defined ones. Moreover, Lean provides convenient notation for defining instances of a given structure.
## Declaring Structures
The structure command is essentially a "front end" for defining inductive data types. Every structure declaration introduces a namespace with the same name. The general form is as follows:
structure <name> <parameters> <parent-structures> where
<constructor> :: <fields>
Most parts are optional. Here is an example:
structure Point (α : Type u) where
mk :: (x : α) (y : α)
Values of type Point are created using Point.mk a b, and the fields of a point p are accessed using Point.x p and Point.y p (but p.x and p.y also work, see below). The structure command also generates useful recursors and theorems. Here are some of the constructions generated for the declaration above.
structure Point (α : Type u) where
mk :: (x : α) (y : α)
#check Point -- a Type
#check @Point.rec -- the eliminator
#check @Point.mk -- the constructor
#check @Point.x -- a projection
#check @Point.y -- a projection
If the constructor name is not provided, then a constructor is named mk by default. You can also avoid the parentheses around field names if you add a line break between each field.
structure Point (α : Type u) where
x : α
y : α
Here are some simple theorems and expressions that use the generated constructions. As usual, you can avoid the prefix Point by using the command open Point.
structure Point (α : Type u) where
x : α
y : α
#eval Point.x (Point.mk 10 20)
#eval Point.y (Point.mk 10 20)
open Point
example (a b : α) : x (mk a b) = a :=
rfl
example (a b : α) : y (mk a b) = b :=
rfl
Given p : Point Nat, the dot notation p.x is shorthand for Point.x p. This provides a convenient way of accessing the fields of a structure.
structure Point (α : Type u) where
x : α
y : α
def p := Point.mk 10 20
#check p.x -- Nat
#eval p.x -- 10
#eval p.y -- 20
The dot notation is convenient not just for accessing the projections of a record, but also for applying functions defined in a namespace with the same name. Recall from the Conjunction section if p has type Point, the expression p.foo is interpreted as Point.foo p, assuming that the first non-implicit argument to foo has type Point. The expression p.add q is therefore shorthand for Point.add p q in the example below.
structure Point (α : Type u) where
x : α
y : α
deriving Repr
def Point.add (p q : Point Nat) :=
mk (p.x + q.x) (p.y + q.y)
def p : Point Nat := Point.mk 1 2
def q : Point Nat := Point.mk 3 4
#eval p.add q -- {x := 4, y := 6}
In the next chapter, you will learn how to define a function like add so that it works generically for elements of Point α rather than just Point Nat, assuming α has an associated addition operation.
More generally, given an expression p.foo x y z where p : Point, Lean will insert p at the first argument to Point.foo of type Point. For example, with the definition of scalar multiplication below, p.smul 3 is interpreted as Point.smul 3 p.
structure Point (α : Type u) where
x : α
y : α
deriving Repr
def Point.smul (n : Nat) (p : Point Nat) :=
Point.mk (n * p.x) (n * p.y)
def p : Point Nat := Point.mk 1 2
#eval p.smul 3 -- {x := 3, y := 6}
It is common to use a similar trick with the List.map function, which takes a list as its second non-implicit argument:
#check @List.map
def xs : List Nat := [1, 2, 3]
def f : Nat → Nat := fun x => x * x
#eval xs.map f -- [1, 4, 9]
Here xs.map f is interpreted as List.map f xs.
## Objects
We have been using constructors to create elements of a structure type. For structures containing many fields, this is often inconvenient, because we have to remember the order in which the fields were defined. Lean therefore provides the following alternative notations for defining elements of a structure type.
{ (<field-name> := <expr>)* : structure-type }
or
{ (<field-name> := <expr>)* }
The suffix : structure-type can be omitted whenever the name of the structure can be inferred from the expected type. For example, we use this notation to define "points." The order that the fields are specified does not matter, so all the expressions below define the same point.
structure Point (α : Type u) where
x : α
y : α
#check { x := 10, y := 20 : Point Nat } -- Point ℕ
#check { y := 20, x := 10 : Point _ }
#check ({ x := 10, y := 20 } : Point Nat)
example : Point Nat :=
{ y := 20, x := 10 }
If the value of a field is not specified, Lean tries to infer it. If the unspecified fields cannot be inferred, Lean flags an error indicating the corresponding placeholder could not be synthesized.
structure MyStruct where
{α : Type u}
{β : Type v}
a : α
b : β
#check { a := 10, b := true : MyStruct }
Record update is another common operation which amounts to creating a new record object by modifying the value of one or more fields in an old one. Lean allows you to specify that unassigned fields in the specification of a record should be taken from a previously defined structure object s by adding the annotation s with before the field assignments. If more than one record object is provided, then they are visited in order until Lean finds one that contains the unspecified field. Lean raises an error if any of the field names remain unspecified after all the objects are visited.
structure Point (α : Type u) where
x : α
y : α
deriving Repr
def p : Point Nat :=
{ x := 1, y := 2 }
#eval { p with y := 3 } -- { x := 1, y := 3 }
#eval { p with x := 4 } -- { x := 4, y := 2 }
structure Point3 (α : Type u) where
x : α
y : α
z : α
def q : Point3 Nat :=
{ x := 5, y := 5, z := 5 }
def r : Point3 Nat :=
{ p, q with x := 6 }
example : r.x = 6 := rfl
example : r.y = 2 := rfl
example : r.z = 5 := rfl
## Inheritance
We can extend existing structures by adding new fields. This feature allows us to simulate a form of inheritance.
structure Point (α : Type u) where
x : α
y : α
inductive Color where
| red | green | blue
structure ColorPoint (α : Type u) extends Point α where
c : Color
In the next example, we define a structure using multiple inheritance, and then define an object using objects of the parent structures.
structure Point (α : Type u) where
x : α
y : α
z : α
structure RGBValue where
red : Nat
green : Nat
blue : Nat
structure RedGreenPoint (α : Type u) extends Point α, RGBValue where
no_blue : blue = 0
def p : Point Nat :=
{ x := 10, y := 10, z := 20 }
def rgp : RedGreenPoint Nat :=
{ p with red := 200, green := 40, blue := 0, no_blue := rfl }
example : rgp.x = 10 := rfl
example : rgp.red = 200 := rfl
# Type classes
Type classes were introduced as a principled way of enabling ad-hoc polymorphism in functional programming languages. We first observe that it would be easy to implement an ad-hoc polymorphic function (such as addition) if the function simply took the type-specific implementation of addition as an argument and then called that implementation on the remaining arguments. For example, suppose we declare a structure in Lean to hold implementations of addition
namespace Ex
structure Add (a : Type) where
add : a -> a -> a
end Ex
In the above Lean code, the field add has type Add.add : {a : Type} → Add a → a → a → a where the curly braces around the type a mean that it is an implicit argument. We could implement double by
namespace Ex
structure Add (a : Type) where
add : a -> a -> a
def double (s : Add a) (x : a) : a :=
-- 20
#eval double { add := Nat.mul } 10
-- 100
-- 20
end Ex
Note that you can double a natural number n by double { add := Nat.add } n. Of course, it would be highly cumbersome for users to manually pass the implementations around in this way. Indeed, it would defeat most of the potential benefits of ad-hoc polymorphism.
The main idea behind type classes is to make arguments such as Add a implicit, and to use a database of user-defined instances to synthesize the desired instances automatically through a process known as typeclass resolution. In Lean, by changing structure to class in the example above, the type of Add.add becomes
namespace Ex
class Add (a : Type) where
add : a -> a -> a
-- Add.add : {a : Type} → [self : Add a] → a → a → a
end Ex
where the square brackets indicate that the argument of type Add a is instance implicit, i.e. that it should be synthesized using typeclass resolution. This version of add is the Lean analogue of the Haskell term add :: Add a => a -> a -> a. Similarly, we can register instances by
namespace Ex
class Add (a : Type) where
add : a -> a -> a
end Ex
Then for n : Nat and m : Nat, the term Add.add n m triggers typeclass resolution with the goal of Add Nat, and typeclass resolution will synthesize the instance for Nat above. We can now reimplement double using an instance implicit by
namespace Ex
class Add (a : Type) where
add : a -> a -> a
def double [Add a] (x : a) : a :=
#check @double
-- @double : {a : Type} → [inst : Add a] → a → a
#eval double 10
-- 20
#eval double (10 : Int)
-- 100
#eval double (7 : Float)
-- 14.000000
#eval double (239.0 + 2)
-- 482.000000
end Ex
In general, instances may depend on other instances in complicated ways. For example, you can declare an (anonymous) instance stating that if a has addition, then Array a has addition:
instance [Add a] : Add (Array a) where
add x y := Array.zipWith x y (· + ·)
-- #[4, 6]
#eval #[1, 2] + #[3, 4]
-- #[4, 6]
Note that (· + ·) is notation for fun x y => x + y in Lean.
The example above demonstrates how type classes are used to overload notation. Now, we explore another application. We often need an arbitrary element of a given type. Recall that types may not have any elements in Lean. It often happens that we would like a definition to return an arbitrary element in a "corner case." For example, we may like the expression head xs to be of type a when xs is of type List a. Similarly, many theorems hold under the additional assumption that a type is not empty. For example, if a is a type, exists x : a, x = x is true only if a is not empty. The standard library defines a type class Inhabited to enable type class inference to infer a "default" element of an inhabited type. Let us start with the first step of the program above, declaring an appropriate class:
namespace Ex
class Inhabited (a : Type u) where
default : a
#check @Inhabited.default
-- Inhabited.default : {a : Type u} → [self : Inhabited a] → a
end Ex
Note Inhabited.default doesn't have any explicit argument.
An element of the class Inhabited a is simply an expression of the form Inhabited.mk x, for some element x : a. The projection Inhabited.default will allow us to "extract" such an element of a from an element of Inhabited a. Now we populate the class with some instances:
namespace Ex
class Inhabited (a : Type _) where
default : a
instance : Inhabited Bool where
default := true
instance : Inhabited Nat where
default := 0
instance : Inhabited Unit where
default := ()
instance : Inhabited Prop where
default := True
#eval (Inhabited.default : Nat)
-- 0
#eval (Inhabited.default : Bool)
-- true
end Ex
You can use the command export to create the alias default for Inhabited.default
namespace Ex
class Inhabited (a : Type _) where
default : a
instance : Inhabited Bool where
default := true
instance : Inhabited Nat where
default := 0
instance : Inhabited Unit where
default := ()
instance : Inhabited Prop where
default := True
export Inhabited (default)
#eval (default : Nat)
-- 0
#eval (default : Bool)
-- true
end Ex
## Chaining Instances
If that were the extent of type class inference, it would not be all that impressive; it would be simply a mechanism of storing a list of instances for the elaborator to find in a lookup table. What makes type class inference powerful is that one can chain instances. That is, an instance declaration can in turn depend on an implicit instance of a type class. This causes class inference to chain through instances recursively, backtracking when necessary, in a Prolog-like search.
For example, the following definition shows that if two types a and b are inhabited, then so is their product:
instance [Inhabited a] [Inhabited b] : Inhabited (a × b) where
default := (default, default)
With this added to the earlier instance declarations, type class instance can infer, for example, a default element of Nat × Bool:
namespace Ex
class Inhabited (a : Type u) where
default : a
instance : Inhabited Bool where
default := true
instance : Inhabited Nat where
default := 0
opaque default [Inhabited a] : a :=
Inhabited.default
instance [Inhabited a] [Inhabited b] : Inhabited (a × b) where
default := (default, default)
#eval (default : Nat × Bool)
-- (0, true)
end Ex
Similarly, we can inhabit type function with suitable constant functions:
instance [Inhabited b] : Inhabited (a -> b) where
default := fun _ => default
As an exercise, try defining default instances for other types, such as List and Sum types.
The Lean standard library contains the definition inferInstance. It has type {α : Sort u} → [i : α] → α, and is useful for triggering the type class resolution procedure when the expected type is an instance.
#check (inferInstance : Inhabited Nat) -- Inhabited Nat
def foo : Inhabited (Nat × Nat) :=
inferInstance
theorem ex : foo.default = (default, default) :=
rfl
You can use the command #print to inspect how simple inferInstance is.
#print inferInstance
## ToString
The polymorphic method toString has type {α : Type u} → [ToString α] → α → String. You implement the instance for your own types and use chaining to convert complex values into strings. Lean comes with ToString instances for most builtin types.
structure Person where
name : String
age : Nat
instance : ToString Person where
toString p := p.name ++ "@" ++ toString p.age
#eval toString { name := "Leo", age := 542 : Person }
#eval toString ({ name := "Daniel", age := 18 : Person }, "hello")
## Numerals
Numerals are polymorphic in Lean. You can use a numeral (e.g., 2) to denote an element of any type that implements the type class OfNat.
structure Rational where
num : Int
den : Nat
inv : den ≠ 0
instance : OfNat Rational n where
ofNat := { num := n, den := 1, inv := by decide }
instance : ToString Rational where
toString r := s!"{r.num}/{r.den}"
#eval (2 : Rational) -- 2/1
#check (2 : Rational) -- Rational
#check (2 : Nat) -- Nat
Lean elaborates the terms (2 : Nat) and (2 : Rational) as OfNat.ofNat Nat 2 (instOfNatNat 2) and OfNat.ofNat Rational 2 (instOfNatRational 2) respectively. We say the numerals 2 occurring in the elaborated terms are raw natural numbers. You can input the raw natural number 2 using the macro nat_lit 2.
#check nat_lit 2 -- Nat
Raw natural numbers are not polymorphic.
The OfNat instance is parametric on the numeral. So, you can define instances for particular numerals. The second argument is often a variable as in the example above, or a raw natural number.
class Monoid (α : Type u) where
unit : α
op : α → α → α
instance [s : Monoid α] : OfNat α (nat_lit 1) where
ofNat := s.unit
def getUnit [Monoid α] : α :=
1
## Output parameters
By default, Lean only tries to synthesize an instance Inhabited T when the term T is known and does not contain missing parts. The following command produces the error "failed to create type class instance for Inhabited (Nat × ?m.1499)" because the type has a missing part (i.e., the _).
#check_failure (inferInstance : Inhabited (Nat × _))
You can view the parameter of the type class Inhabited as an input value for the type class synthesizer. When a type class has multiple parameters, you can mark some of them as output parameters. Lean will start type class synthesizer even when these parameters have missing parts. In the following example, we use output parameters to define a heterogeneous polymorphic multiplication.
namespace Ex
class HMul (α : Type u) (β : Type v) (γ : outParam (Type w)) where
hMul : α → β → γ
export HMul (hMul)
instance : HMul Nat Nat Nat where
hMul := Nat.mul
instance : HMul Nat (Array Nat) (Array Nat) where
hMul a bs := bs.map (fun b => hMul a b)
#eval hMul 4 3 -- 12
#eval hMul 4 #[2, 3, 4] -- #[8, 12, 16]
end Ex
The parameters α and β are considered input parameters and γ an output one. Given an application hMul a b, after types of a and b are known, the type class synthesizer is invoked, and the resulting type is obtained from the output parameter γ. In the example above, we defined two instances. The first one is the homogeneous multiplication for natural numbers. The second is the scalar multiplication for arrays. Note that you chain instances and generalize the second instance.
namespace Ex
class HMul (α : Type u) (β : Type v) (γ : outParam (Type w)) where
hMul : α → β → γ
export HMul (hMul)
instance : HMul Nat Nat Nat where
hMul := Nat.mul
instance : HMul Int Int Int where
hMul := Int.mul
instance [HMul α β γ] : HMul α (Array β) (Array γ) where
hMul a bs := bs.map (fun b => hMul a b)
#eval hMul 4 3 -- 12
#eval hMul 4 #[2, 3, 4] -- #[8, 12, 16]
#eval hMul (-2) #[3, -1, 4] -- #[-6, 2, -8]
#eval hMul 2 #[#[2, 3], #[0, 4]] -- #[#[4, 6], #[0, 8]]
end Ex
You can use our new scalar array multiplication instance on arrays of type Array β with a scalar of type α whenever you have an instance HMul α β γ. In the last #eval, note that the instance was used twice on an array of arrays.
## Default instances
In the class HMul, the parameters α and β are treated as input values. Thus, type class synthesis only starts after these two types are known. This may often be too restrictive.
namespace Ex
class HMul (α : Type u) (β : Type v) (γ : outParam (Type w)) where
hMul : α → β → γ
export HMul (hMul)
instance : HMul Int Int Int where
hMul := Int.mul
def xs : List Int := [1, 2, 3]
-- Error "failed to create type class instance for HMul Int ?m.1767 (?m.1797 x)"
#check_failure fun y => xs.map (fun x => hMul x y)
end Ex
The instance HMul is not synthesized by Lean because the type of y has not been provided. However, it is natural to assume that the type of y and x should be the same in this kind of situation. We can achieve exactly that using default instances.
namespace Ex
class HMul (α : Type u) (β : Type v) (γ : outParam (Type w)) where
hMul : α → β → γ
export HMul (hMul)
@[defaultInstance]
instance : HMul Int Int Int where
hMul := Int.mul
def xs : List Int := [1, 2, 3]
#check fun y => xs.map (fun x => hMul x y) -- Int -> List Int
end Ex
By tagging the instance above with the attribute defaultInstance, we are instructing Lean to use this instance on pending type class synthesis problems. The actual Lean implementation defines homogeneous and heterogeneous classes for arithmetical operators. Moreover, a+b, a*b, a-b, a/b, and a%b are notations for the heterogeneous versions. The instance OfNat Nat n is the default instance (with priority 100) for the OfNat class. This is why the numeral 2 has type Nat when the expected type is not known. You can define default instances with higher priority to override the builtin ones.
structure Rational where
num : Int
den : Nat
inv : den ≠ 0
@[defaultInstance 200]
instance : OfNat Rational n where
ofNat := { num := n, den := 1, inv := by decide }
instance : ToString Rational where
toString r := s!"{r.num}/{r.den}"
#check 2 -- Rational
Priorities are also useful to control the interaction between different default instances. For example, suppose xs has type α, when elaboration xs.map (fun x => 2 * x), we want the homogeneous instance for multiplication to have higher priority than the default instance for OfNat. This is particularly important when we have implemented only the instance HMul α α α, and did not implement HMul Nat α α. Now, we reveal how the notation a*b is defined in Lean.
namespace Ex
class OfNat (α : Type u) (n : Nat) where
ofNat : α
@[defaultInstance]
instance (n : Nat) : OfNat Nat n where
ofNat := n
class HMul (α : Type u) (β : Type v) (γ : outParam (Type w)) where
hMul : α → β → γ
class Mul (α : Type u) where
mul : α → α → α
@[defaultInstance 10]
instance [Mul α] : HMul α α α where
hMul a b := Mul.mul a b
infixl:70 " * " => HMul.hMul
end Ex
The Mul class is convenient for types that only implement the homogeneous multiplication.
## Local Instances
Type classes are implemented using attributes in Lean. Thus, you can use the local modifier to indicate that they only have effect until the current section or namespace is closed, or until the end of the current file.
structure Point where
x : Nat
y : Nat
section
local instance : Add Point where
add a b := { x := a.x + b.x, y := a.y + b.y }
def double (p : Point) :=
p + p
end -- instance Add Point is not active anymore
-- def triple (p : Point) :=
-- p + p + p -- Error: failed to synthesize instance
You can also temporarily disable an instance using the attribute command until the current section or namespace is closed, or until the end of the current file.
structure Point where
x : Nat
y : Nat
add a b := { x := a.x + b.x, y := a.y + b.y }
def double (p : Point) :=
p + p
-- def triple (p : Point) :=
-- p + p + p -- Error: failed to synthesize instance
We recommend you only use this command to diagnose problems.
## Scoped Instances
You can also declare scoped instances in namespaces. This kind of instance is only active when you are inside of the namespace or open the namespace.
structure Point where
x : Nat
y : Nat
namespace Point
scoped instance : Add Point where
add a b := { x := a.x + b.x, y := a.y + b.y }
def double (p : Point) :=
p + p
end Point
-- instance Add Point is not active anymore
-- #check fun (p : Point) => p + p + p -- Error
namespace Point
-- instance Add Point is active again
#check fun (p : Point) => p + p + p
end Point
open Point -- activates instance Add Point
#check fun (p : Point) => p + p + p
You can use the command open scoped <namespace> to activate scoped attributes but will not "open" the names from the namespace.
structure Point where
x : Nat
y : Nat
namespace Point
scoped instance : Add Point where
add a b := { x := a.x + b.x, y := a.y + b.y }
def double (p : Point) :=
p + p
end Point
open scoped Point -- activates instance Add Point
#check fun (p : Point) => p + p + p
-- #check fun (p : Point) => double p -- Error: unknown identifier 'double'
## Decidable Propositions
Let us consider another example of a type class defined in the standard library, namely the type class of Decidable propositions. Roughly speaking, an element of Prop is said to be decidable if we can decide whether it is true or false. The distinction is only useful in constructive mathematics; classically, every proposition is decidable. But if we use the classical principle, say, to define a function by cases, that function will not be computable. Algorithmically speaking, the Decidable type class can be used to infer a procedure that effectively determines whether or not the proposition is true. As a result, the type class supports such computational definitions when they are possible while at the same time allowing a smooth transition to the use of classical definitions and classical reasoning.
In the standard library, Decidable is defined formally as follows:
namespace Hidden
class inductive Decidable (p : Prop) where
| isFalse (h : ¬p) : Decidable p
| isTrue (h : p) : Decidable p
end Hidden
Logically speaking, having an element t : Decidable p is stronger than having an element t : p ∨ ¬p; it enables us to define values of an arbitrary type depending on the truth value of p. For example, for the expression if p then a else b to make sense, we need to know that p is decidable. That expression is syntactic sugar for ite p a b, where ite is defined as follows:
namespace Hidden
def ite {α : Sort u} (c : Prop) [h : Decidable c] (t e : α) : α :=
Decidable.casesOn (motive := fun _ => α) h (fun _ => e) (fun _ => t)
end Hidden
The standard library also contains a variant of ite called dite, the dependent if-then-else expression. It is defined as follows:
namespace Hidden
def dite {α : Sort u} (c : Prop) [h : Decidable c] (t : c → α) (e : Not c → α) : α :=
Decidable.casesOn (motive := fun _ => α) h e t
end Hidden
That is, in dite c t e, we can assume hc : c in the "then" branch, and hnc : ¬ c in the "else" branch. To make dite more convenient to use, Lean allows us to write if h : c then t else e instead of dite c (λ h : c, t) (λ h : ¬ c, e).
Without classical logic, we cannot prove that every proposition is decidable. But we can prove that certain propositions are decidable. For example, we can prove the decidability of basic operations like equality and comparisons on the natural numbers and the integers. Moreover, decidability is preserved under propositional connectives:
#check @instDecidableAnd
-- {p q : Prop} → [Decidable p] → [Decidable q] → Decidable (And p q)
#check @instDecidableOr
#check @instDecidableNot
Thus we can carry out definitions by cases on decidable predicates on the natural numbers:
def step (a b x : Nat) : Nat :=
if x < a ∨ x > b then 0 else 1
set_option pp.explicit true
#print step
Turning on implicit arguments shows that the elaborator has inferred the decidability of the proposition x < a ∨ x > b, simply by applying appropriate instances.
With the classical axioms, we can prove that every proposition is decidable. You can import the classical axioms and make the generic instance of decidability available by opening the Classical namespace.
open Classical
Thereafter decidable p has an instance for every p. Thus all theorems in the library that rely on decidability assumptions are freely available when you want to reason classically. In Chapter Axioms and Computation, we will see that using the law of the excluded middle to define functions can prevent them from being used computationally. Thus, the standard library assigns a low priority to the propDecidable instance.
namespace Hidden
open Classical
noncomputable scoped
instance (priority := low) propDecidable (a : Prop) : Decidable a :=
choice <| match em a with
| Or.inl h => ⟨isTrue h⟩
| Or.inr h => ⟨isFalse h⟩
end Hidden
This guarantees that Lean will favor other instances and fall back on propDecidable only after other attempts to infer decidability have failed.
The Decidable type class also provides a bit of small-scale automation for proving theorems. The standard library introduces the tactic decide that uses the Decidable instance to solve simple goals.
example : 10 < 5 ∨ 1 > 0 := by
decide
example : ¬ (True ∧ False) := by
decide
example : 10 * 20 = 200 := by
decide
theorem ex : True ∧ 2 = 1+1 := by
decide
#print ex
-- theorem ex : True ∧ 2 = 1 + 1 :=
-- of_decide_eq_true (Eq.refl true)
#check @of_decide_eq_true
-- ∀ {p : Prop} [Decidable p], decide p = true → p
#check @decide
-- (p : Prop) → [Decidable p] → Bool
They work as follows. The expression decide p tries to infer a decision procedure for p, and, if it is successful, evaluates to either true or false. In particular, if p is a true closed expression, decide p will reduce definitionally to the Boolean true. On the assumption that decide p = true holds, of_decide_eq_true produces a proof of p. The tactic decide puts it all together: to prove a target p. By the previous observations, decide will succeed any time the inferred decision procedure for c has enough information to evaluate, definitionally, to the isTrue case.
## Managing Type Class Inference
If you are ever in a situation where you need to supply an expression that Lean can infer by type class inference, you can ask Lean to carry out the inference using inferInstance:
def foo : Add Nat := inferInstance
def bar : Inhabited (Nat → Nat) := inferInstance
#check @inferInstance
-- {α : Sort u} → [α] → α
In fact, you can use Lean's (t : T) notation to specify the class whose instance you are looking for, in a concise manner:
#check (inferInstance : Add Nat)
You can also use the auxiliary definition inferInstanceAs:
#check inferInstanceAs (Add Nat)
#check @inferInstanceAs
-- (α : Sort u) → [α] → α
Sometimes Lean can't find an instance because the class is buried under a definition. For example, Lean cannot find an instance of Inhabited (Set α). We can declare one explicitly:
def Set (α : Type u) := α → Prop
-- fails
-- example : Inhabited (Set α) :=
-- inferInstance
instance : Inhabited (Set α) :=
inferInstanceAs (Inhabited (α → Prop))
At times, you may find that the type class inference fails to find an expected instance, or, worse, falls into an infinite loop and times out. To help debug in these situations, Lean enables you to request a trace of the search:
set_option trace.Meta.synthInstance true
If you are using VS Code, you can read the results by hovering over the relevant theorem or definition, or opening the messages window with Ctrl-Shift-Enter. In Emacs, you can use C-c C-x to run an independent Lean process on your file, and the output buffer will show a trace every time the type class resolution procedure is subsequently triggered.
You can also limit the search using the following options:
set_option synthInstance.maxHeartbeats 10000
set_option synthInstance.maxSize 400
Option synthInstance.maxHeartbeats specifies the maximum amount of heartbeats per typeclass resolution problem. A heartbeat is the number of (small) memory allocations (in thousands), 0 means there is no limit. Option synthInstance.maxSize is the maximum number of instances used to construct a solution in the type class instance synthesis procedure.
Remember also that in both the VS Code and Emacs editor modes, tab completion works in set_option, to help you find suitable options.
As noted above, the type class instances in a given context represent a Prolog-like program, which gives rise to a backtracking search. Both the efficiency of the program and the solutions that are found can depend on the order in which the system tries the instance. Instances which are declared last are tried first. Moreover, if instances are declared in other modules, the order in which they are tried depends on the order in which namespaces are opened. Instances declared in namespaces which are opened later are tried earlier.
You can change the order that type classes instances are tried by assigning them a priority. When an instance is declared, it is assigned a default priority value. You can assign other priorities when defining an instance. The following example illustrates how this is done:
class Foo where
a : Nat
b : Nat
instance (priority := default+1) i1 : Foo where
a := 1
b := 1
instance i2 : Foo where
a := 2
b := 2
example : Foo.a = 1 :=
rfl
instance (priority := default+2) i3 : Foo where
a := 3
b := 3
example : Foo.a = 3 :=
rfl
## Coercions using Type Classes
The most basic type of coercion maps elements of one type to another. For example, a coercion from Nat to Int allows us to view any element n : Nat as an element of Int. But some coercions depend on parameters; for example, for any type α, we can view any element as : List α as an element of Set α, namely, the set of elements occurring in the list. The corresponding coercion is defined on the "family" of types List α, parameterized by α.
Lean allows us to declare three kinds of coercions:
• from a family of types to another family of types
• from a family of types to the class of sorts
• from a family of types to the class of function types
The first kind of coercion allows us to view any element of a member of the source family as an element of a corresponding member of the target family. The second kind of coercion allows us to view any element of a member of the source family as a type. The third kind of coercion allows us to view any element of the source family as a function. Let us consider each of these in turn.
In Lean, coercions are implemented on top of the type class resolution framework. We define a coercion from α to β by declaring an instance of Coe α β. For example, we can define a coercion from Bool to Prop as follows:
instance : Coe Bool Prop where
coe b := b = true
This enables us to use boolean terms in if-then-else expressions:
#eval if true then 5 else 3
#eval if false then 5 else 3
We can define a coercion from List α to Set α as follows:
def Set (α : Type u) := α → Prop
def Set.empty {α : Type u} : Set α := fun _ => False
def Set.mem (a : α) (s : Set α) : Prop := s a
def Set.singleton (a : α) : Set α := fun x => x = a
def Set.union (a b : Set α) : Set α := fun x => a x ∨ b x
notation "{ " a " }" => Set.singleton a
infix:55 " ∪ " => Set.union
def List.toSet : List α → Set α
| [] => Set.empty
| a::as => {a} ∪ as.toSet
instance : Coe (List α) (Set α) where
coe a := a.toSet
def s : Set Nat := {1}
#check s ∪ [2, 3]
-- s ∪ List.toSet [2, 3] : Set Nat
We can use the notation ↑ to force a coercion to be introduced in a particular place. It is also helpful to make our intent clear, and work around limitations of the coercion resolution system.
def Set (α : Type u) := α → Prop
def Set.empty {α : Type u} : Set α := fun _ => False
def Set.mem (a : α) (s : Set α) : Prop := s a
def Set.singleton (a : α) : Set α := fun x => x = a
def Set.union (a b : Set α) : Set α := fun x => a x ∨ b x
notation "{ " a " }" => Set.singleton a
infix:55 " ∪ " => Set.union
def List.toSet : List α → Set α
| [] => Set.empty
| a::as => {a} ∪ as.toSet
instance : Coe (List α) (Set α) where
coe a := a.toSet
def s : Set Nat := {1}
#check let x := ↑[2, 3]; s ∪ x
-- let x := List.toSet [2, 3]; s ∪ x : Set Nat
#check let x := [2, 3]; s ∪ x
-- let x := [2, 3]; s ∪ List.toSet x : Set Nat
Lean also supports dependent coercions using the type class CoeDep. For example, we cannot coerce arbitrary propositions to Bool, only the ones that implement the Decidable typeclass.
instance (p : Prop) [Decidable p] : CoeDep Prop p Bool where
coe := decide p
Lean will also chain (non-dependent) coercions as necessary. Actually, the type class CoeT is the transitive closure of Coe.
Let us now consider the second kind of coercion. By the class of sorts, we mean the collection of universes Type u. A coercion of the second kind is of the form
c : (x1 : A1) → ... → (xn : An) → F x1 ... xn → Type u
where F is a family of types as above. This allows us to write s : t whenever t is of type F a1 ... an. In other words, the coercion allows us to view the elements of F a1 ... an as types. This is very useful when defining algebraic structures in which one component, the carrier of the structure, is a Type. For example, we can define a semigroup as follows:
structure Semigroup where
carrier : Type u
mul : carrier → carrier → carrier
mul_assoc (a b c : carrier) : mul (mul a b) c = mul a (mul b c)
instance (S : Semigroup) : Mul S.carrier where
mul a b := S.mul a b
In other words, a semigroup consists of a type, carrier, and a multiplication, mul, with the property that the multiplication is associative. The instance command allows us to write a * b instead of Semigroup.mul S a b whenever we have a b : S.carrier; notice that Lean can infer the argument S from the types of a and b. The function Semigroup.carrier maps the class Semigroup to the sort Type u:
structure Semigroup where
carrier : Type u
mul : carrier → carrier → carrier
mul_assoc (a b c : carrier) : mul (mul a b) c = mul a (mul b c)
instance (S : Semigroup) : Mul S.carrier where
mul a b := S.mul a b
#check Semigroup.carrier
If we declare this function to be a coercion, then whenever we have a semigroup S : Semigroup, we can write a : S instead of a : S.carrier:
structure Semigroup where
carrier : Type u
mul : carrier → carrier → carrier
mul_assoc (a b c : carrier) : mul (mul a b) c = mul a (mul b c)
instance (S : Semigroup) : Mul S.carrier where
mul a b := S.mul a b
instance : CoeSort Semigroup (Type u) where
coe s := s.carrier
example (S : Semigroup) (a b c : S) : (a * b) * c = a * (b * c) :=
Semigroup.mul_assoc _ a b c
It is the coercion that makes it possible to write (a b c : S). Note that, we define an instance of CoeSort Semigroup (Type u) instead of Coe Semigroup (Type u).
By the class of function types, we mean the collection of Pi types (z : B) → C. The third kind of coercion has the form
c : (x1 : A1) → ... → (xn : An) → (y : F x1 ... xn) → (z : B) → C
where F is again a family of types and B and C can depend on x1, ..., xn, y. This makes it possible to write t s whenever t is an element of F a1 ... an. In other words, the coercion enables us to view elements of F a1 ... an as functions. Continuing the example above, we can define the notion of a morphism between semigroups S1 and S2. That is, a function from the carrier of S1 to the carrier of S2 (note the implicit coercion) that respects the multiplication. The projection morphism.mor takes a morphism to the underlying function:
structure Semigroup where
carrier : Type u
mul : carrier → carrier → carrier
mul_assoc (a b c : carrier) : mul (mul a b) c = mul a (mul b c)
instance (S : Semigroup) : Mul S.carrier where
mul a b := S.mul a b
instance : CoeSort Semigroup (Type u) where
coe s := s.carrier
structure Morphism (S1 S2 : Semigroup) where
mor : S1 → S2
resp_mul : ∀ a b : S1, mor (a * b) = (mor a) * (mor b)
#check @Morphism.mor
As a result, it is a prime candidate for the third type of coercion.
structure Semigroup where
carrier : Type u
mul : carrier → carrier → carrier
mul_assoc (a b c : carrier) : mul (mul a b) c = mul a (mul b c)
instance (S : Semigroup) : Mul S.carrier where
mul a b := S.mul a b
instance : CoeSort Semigroup (Type u) where
coe s := s.carrier
structure Morphism (S1 S2 : Semigroup) where
mor : S1 → S2
resp_mul : ∀ a b : S1, mor (a * b) = (mor a) * (mor b)
instance (S1 S2 : Semigroup) : CoeFun (Morphism S1 S2) (fun _ => S1 → S2) where
coe m := m.mor
theorem resp_mul {S1 S2 : Semigroup} (f : Morphism S1 S2) (a b : S1)
: f (a * b) = f a * f b :=
f.resp_mul a b
example (S1 S2 : Semigroup) (f : Morphism S1 S2) (a : S1) :
f (a * a * a) = f a * f a * f a :=
calc f (a * a * a) = f (a * a) * f a := by rw [resp_mul f]
_ = f a * f a * f a := by rw [resp_mul f]
With the coercion in place, we can write f (a * a * a) instead of f.mor (a * a * a). When the Morphism, f, is used where a function is expected, Lean inserts the coercion. Similar to CoeSort, we have yet another class CoeFun for this class of coercions. The field F is used to specify the function type we are coercing to. This type may depend on the type we are coercing from.
# The Conversion Tactic Mode
Inside a tactic block, one can use the keyword conv to enter conversion mode. This mode allows to travel inside assumptions and goals, even inside function abstractions and dependent arrows, to apply rewriting or simplifying steps.
As a first example, let us prove example (a b c : Nat) : a * (b * c) = a * (c * b) (examples in this file are somewhat artificial since other tactics could finish them immediately). The naive first attempt is to enter tactic mode and try rw [Nat.mul_comm]. But this transforms the goal into b * c * a = a * (c * b), after commuting the very first multiplication appearing in the term. There are several ways to fix this issue, and one way is to use a more precise tool : the conversion mode. The following code block shows the current target after each line.
example (a b c : Nat) : a * (b * c) = a * (c * b) := by
conv =>
-- |- a * (b * c) = a * (c * b)
lhs
-- |- a * (b * c)
congr
-- 2 goals : |- a and |- b * c
rfl
-- |- b * c
rw [Nat.mul_comm]
The above snippet show three navigation commands:
• lhs navigates to the left hand side of a relation (here equality), there is also a rhs navigating to the right hand side.
• congr creates as many targets as there are (nondependent and explicit) arguments to the current head function (here the head function is multiplication).
• rfl closes target using reflexivity.
Once arrived at the relevant target, we can use rw as in normal tactic mode.
The second main reason to use conversion mode is to rewrite under binders. Suppose we want to prove example (fun x : Nat => 0 + x) = (fun x => x). The naive first attempt is to enter tactic mode and try rw [zero_add]. But this fails with a frustrating
error: tactic 'rewrite' failed, did not find instance of the pattern
in the target expression
0 + ?n
⊢ (fun x => 0 + x) = fun x => x
The solution is:
example : (fun x : Nat => 0 + x) = (fun x => x) := by
conv =>
lhs
intro x
where intro x is the navigation command entering inside the fun binder. Note that this example is somewhat artificial, one could also do:
example : (fun x : Nat => 0 + x) = (fun x => x) := by
or just
example : (fun x : Nat => 0 + x) = (fun x => x) := by
simp
All this is also available to rewrite an hypothesis h from the local context using conv at h.
## Pattern matching
Navigation using the above commands can be tedious. One can shortcut it using pattern matching as follows:
example (a b c : Nat) : a * (b * c) = a * (c * b) := by
conv in b * c => rw [Nat.mul_comm]
which is just syntax sugar for
example (a b c : Nat) : a * (b * c) = a * (c * b) := by
conv =>
pattern b * c
rw [Nat.mul_comm]
Of course, wildcards are allowed:
example (a b c : Nat) : a * (b * c) = a * (c * b) := by
conv in _ * c => rw [Nat.mul_comm]
## Structuring conversion tactics
Curly brackets and . can also be used in conv mode to structure tactics.
example (a b c : Nat) : (0 + a) * (b * c) = a * (c * b) := by
conv =>
lhs
congr
. rw [Nat.mul_comm]
## Other tactics inside conversion mode
• arg i enter the i-th nondependent explicit argument of an application.
example (a b c : Nat) : a * (b * c) = a * (c * b) := by
conv =>
-- |- a * (b * c) = a * (c * b)
lhs
-- |- a * (b * c)
arg 2
-- |- b * c
rw [Nat.mul_comm]
• args alternative name for congr
• simp applies the simplifier to the current goal. It supports the same options available in regular tactic mode.
def f (x : Nat) :=
if x > 0 then x + 1 else x + 2
example (g : Nat → Nat) (h₁ : g x = x + 1) (h₂ : x > 0) : g x = f x := by
conv =>
rhs
simp [f, h₂]
exact h₁
• enter [1, x, 2, y] iterate arg and intro with the given arguments. It is just the macro.
syntax enterArg := ident <|> num
syntax "enter " "[" (colGt enterArg),+ "]": conv
macro_rules
| (conv| enter [$i:numLit]) => (conv| arg$i)
| (conv| enter [$id:ident]) => (conv| ext$id)
| (conv| enter [$arg:enterArg,$args,*]) => (conv| (enter [$arg]; enter [$args,*]))
• done fail if there are unsolved goals.
• traceState display the current tactic state.
• whnf put term in weak head normal form.
• tactic => <tactic sequence> go back to regular tactic mode. This is useful for discharging goals not supported by conv mode, and applying custom congruence and extensionality lemmas.
example (g : Nat → Nat → Nat)
(h₁ : ∀ x, x ≠ 0 → g x x = 1)
(h₂ : x ≠ 0)
: g x x + x = 1 + x := by
conv =>
lhs
-- |- g x x + x
arg 1
-- |- g x x
rw [h₁]
-- 2 goals: |- 1, |- x ≠ 0
. skip
. tactic => exact h₂
• apply <term> is syntax sugar for tactic => apply <term>
example (g : Nat → Nat → Nat)
(h₁ : ∀ x, x ≠ 0 → g x x = 1)
(h₂ : x ≠ 0)
: g x x + x = 1 + x := by
conv =>
lhs
arg 1
rw [h₁]
. skip
. apply h₂
# Axioms and Computation
We have seen that the version of the Calculus of Constructions that has been implemented in Lean includes dependent function types, inductive types, and a hierarchy of universes that starts with an impredicative, proof-irrelevant Prop at the bottom. In this chapter, we consider ways of extending the CIC with additional axioms and rules. Extending a foundational system in such a way is often convenient; it can make it possible to prove more theorems, as well as make it easier to prove theorems that could have been proved otherwise. But there can be negative consequences of adding additional axioms, consequences which may go beyond concerns about their correctness. In particular, the use of axioms bears on the computational content of definitions and theorems, in ways we will explore here.
Lean is designed to support both computational and classical reasoning. Users that are so inclined can stick to a "computationally pure" fragment, which guarantees that closed expressions in the system evaluate to canonical normal forms. In particular, any closed computationally pure expression of type Nat, for example, will reduce to a numeral.
Lean's standard library defines an additional axiom, propositional extensionality, and a quotient construction which in turn implies the principle of function extensionality. These extensions are used, for example, to develop theories of sets and finite sets. We will see below that using these theorems can block evaluation in Lean's kernel, so that closed terms of type Nat no longer evaluate to numerals. But Lean erases types and propositional information when compiling definitions to bytecode for its virtual machine evaluator, and since these axioms only add new propositions, they are compatible with that computational interpretation. Even computationally inclined users may wish to use the classical law of the excluded middle to reason about computation. This also blocks evaluation in the kernel, but it is compatible with compilation to bytecode.
The standard library also defines a choice principle that is entirely antithetical to a computational interpretation, since it magically produces "data" from a proposition asserting its existence. Its use is essential to some classical constructions, and users can import it when needed. But expressions that use this construction to produce data do not have computational content, and in Lean we are required to mark such definitions as noncomputable to flag that fact.
Using a clever trick (known as Diaconescu's theorem), one can use propositional extensionality, function extensionality, and choice to derive the law of the excluded middle. As noted above, however, use of the law of the excluded middle is still compatible with bytecode compilation and code extraction, as are other classical principles, as long as they are not used to manufacture data.
To summarize, then, on top of the underlying framework of universes, dependent function types, and inductive types, the standard library adds three additional components:
• the axiom of propositional extensionality
• a quotient construction, which implies function extensionality
• a choice principle, which produces data from an existential proposition.
The first two of these block normalization within Lean, but are compatible with bytecode evaluation, whereas the third is not amenable to computational interpretation. We will spell out the details more precisely below.
## Historical and Philosophical Context
For most of its history, mathematics was essentially computational: geometry dealt with constructions of geometric objects, algebra was concerned with algorithmic solutions to systems of equations, and analysis provided means to compute the future behavior of systems evolving over time. From the proof of a theorem to the effect that "for every x, there is a y such that ...", it was generally straightforward to extract an algorithm to compute such a y given x.
In the nineteenth century, however, increases in the complexity of mathematical arguments pushed mathematicians to develop new styles of reasoning that suppress algorithmic information and invoke descriptions of mathematical objects that abstract away the details of how those objects are represented. The goal was to obtain a powerful "conceptual" understanding without getting bogged down in computational details, but this had the effect of admitting mathematical theorems that are simply false on a direct computational reading.
There is still fairly uniform agreement today that computation is important to mathematics. But there are different views as to how best to address computational concerns. From a constructive point of view, it is a mistake to separate mathematics from its computational roots; every meaningful mathematical theorem should have a direct computational interpretation. From a classical point of view, it is more fruitful to maintain a separation of concerns: we can use one language and body of methods to write computer programs, while maintaining the freedom to use a nonconstructive theories and methods to reason about them. Lean is designed to support both of these approaches. Core parts of the library are developed constructively, but the system also provides support for carrying out classical mathematical reasoning.
Computationally, the purest part of dependent type theory avoids the use of Prop entirely. Inductive types and dependent function types can be viewed as data types, and terms of these types can be "evaluated" by applying reduction rules until no more rules can be applied. In principle, any closed term (that is, term with no free variables) of type Nat should evaluate to a numeral, succ (... (succ zero)...).
Introducing a proof-irrelevant Prop and marking theorems irreducible represents a first step towards separation of concerns. The intention is that elements of a type p : Prop should play no role in computation, and so the particular construction of a term t : p is "irrelevant" in that sense. One can still define computational objects that incorporate elements of type Prop; the point is that these elements can help us reason about the effects of the computation, but can be ignored when we extract "code" from the term. Elements of type Prop are not entirely innocuous, however. They include equations s = t : α for any type α, and such equations can be used as casts, to type check terms. Below, we will see examples of how such casts can block computation in the system. However, computation is still possible under an evaluation scheme that erases propositional content, ignores intermediate typing constraints, and reduces terms until they reach a normal form. This is precisely what Lean's virtual machine does.
Having adopted a proof-irrelevant Prop, one might consider it legitimate to use, for example, the law of the excluded middle, p ∨ ¬p, where p is any proposition. Of course, this, too, can block computation according to the rules of CIC, but it does not block bytecode evaluation, as described above. It is only the choice principles discussed in :numref:choice that completely erase the distinction between the proof-irrelevant and data-relevant parts of the theory.
## Propositional Extensionality
Propositional extensionality is the following axiom:
namespace Hidden
axiom propext {a b : Prop} : (a ↔ b) → a = b
end Hidden
It asserts that when two propositions imply one another, they are actually equal. This is consistent with set-theoretic interpretations in which any element a : Prop is either empty or the singleton set {*}, for some distinguished element *. The axiom has the effect that equivalent propositions can be substituted for one another in any context:
theorem thm₁ (a b c d e : Prop) (h : a ↔ b) : (c ∧ a ∧ d → e) ↔ (c ∧ b ∧ d → e) :=
propext h ▸ Iff.refl _
theorem thm₂ (a b : Prop) (p : Prop → Prop) (h : a ↔ b) (h₁ : p a) : p b :=
propext h ▸ h₁
## Function Extensionality
Similar to propositional extensionality, function extensionality asserts that any two functions of type (x : α) → β x that agree on all their inputs are equal.
universe u v
#check (@funext :
{α : Type u}
→ {β : α → Type u}
→ {f g : (x : α) → β x}
→ (∀ (x : α), f x = g x)
→ f = g)
#print funext
From a classical, set-theoretic perspective, this is exactly what it means for two functions to be equal. This is known as an "extensional" view of functions. From a constructive perspective, however, it is sometimes more natural to think of functions as algorithms, or computer programs, that are presented in some explicit way. It is certainly the case that two computer programs can compute the same answer for every input despite the fact that they are syntactically quite different. In much the same way, you might want to maintain a view of functions that does not force you to identify two functions that have the same input / output behavior. This is known as an "intensional" view of functions.
In fact, function extensionality follows from the existence of quotients, which we describe in the next section. In the Lean standard library, therefore, funext is thus proved from the quotient construction.
Suppose that for α : Type we define the Set α := α → Prop to denote the type of subsets of α, essentially identifying subsets with predicates. By combining funext and propext, we obtain an extensional theory of such sets:
def Set (α : Type u) := α → Prop
namespace Set
def mem (x : α) (a : Set α) := a x
infix:50 (priority := high) "∈" => mem
theorem setext {a b : Set α} (h : ∀ x, x ∈ a ↔ x ∈ b) : a = b :=
funext (fun x => propext (h x))
end Set
We can then proceed to define the empty set and set intersection, for example, and prove set identities:
def Set (α : Type u) := α → Prop
namespace Set
def mem (x : α) (a : Set α) := a x
infix:50 (priority := high) "∈" => mem
theorem setext {a b : Set α} (h : ∀ x, x ∈ a ↔ x ∈ b) : a = b :=
funext (fun x => propext (h x))
def empty : Set α := fun x => False
notation (priority := high) "∅" => empty
def inter (a b : Set α) : Set α :=
fun x => x ∈ a ∧ x ∈ b
infix:70 " ∩ " => inter
theorem inter_self (a : Set α) : a ∩ a = a :=
setext fun x => Iff.intro
(fun ⟨h, _⟩ => h)
(fun h => ⟨h, h⟩)
theorem inter_empty (a : Set α) : a ∩ ∅ = ∅ :=
setext fun x => Iff.intro
(fun ⟨_, h⟩ => h)
(fun h => False.elim h)
theorem empty_inter (a : Set α) : ∅ ∩ a = ∅ :=
setext fun x => Iff.intro
(fun ⟨h, _⟩ => h)
(fun h => False.elim h)
theorem inter.comm (a b : Set α) : a ∩ b = b ∩ a :=
setext fun x => Iff.intro
(fun ⟨h₁, h₂⟩ => ⟨h₂, h₁⟩)
(fun ⟨h₁, h₂⟩ => ⟨h₂, h₁⟩)
end Set
The following is an example of how function extensionality blocks computation inside the Lean kernel.
def f (x : Nat) := x
def g (x : Nat) := 0 + x
theorem f_eq_g : f = g :=
funext fun x => (Nat.zero_add x).symm
def val : Nat :=
Eq.recOn (motive := fun _ _ => Nat) f_eq_g 0
-- does not reduce to 0
#reduce val
-- evaluates to 0
#eval val
First, we show that the two functions f and g are equal using function extensionality, and then we cast 0 of type Nat by replacing f by g in the type. Of course, the cast is vacuous, because Nat does not depend on f. But that is enough to do the damage: under the computational rules of the system, we now have a closed term of Nat that does not reduce to a numeral. In this case, we may be tempted to reduce the expression to 0. But in nontrivial examples, eliminating cast changes the type of the term, which might make an ambient expression type incorrect. The virtual machine, however, has no trouble evaluating the expression to 0. Here is a similarly contrived example that shows how propext can get in the way.
theorem tteq : (True ∧ True) = True :=
propext (Iff.intro (fun ⟨h, _⟩ => h) (fun h => ⟨h, h⟩))
def val : Nat :=
Eq.recOn (motive := fun _ _ => Nat) tteq 0
-- does not reduce to 0
#reduce val
-- evaluates to 0
#eval val
Current research programs, including work on observational type theory and cubical type theory, aim to extend type theory in ways that permit reductions for casts involving function extensionality, quotients, and more. But the solutions are not so clear cut, and the rules of Lean's underlying calculus do not sanction such reductions.
In a sense, however, a cast does not change the meaning of an expression. Rather, it is a mechanism to reason about the expression's type. Given an appropriate semantics, it then makes sense to reduce terms in ways that preserve their meaning, ignoring the intermediate bookkeeping needed to make the reductions type correct. In that case, adding new axioms in Prop does not matter; by proof irrelevance, an expression in Prop carries no information, and can be safely ignored by the reduction procedures.
## Quotients
Let α be any type, and let r be an equivalence relation on α. It is mathematically common to form the "quotient" α / r, that is, the type of elements of α "modulo" r. Set theoretically, one can view α / r as the set of equivalence classes of α modulo r. If f : α → β is any function that respects the equivalence relation in the sense that for every x y : α, r x y implies f x = f y, then f "lifts" to a function f' : α / r → β defined on each equivalence class ⟦x⟧ by f' ⟦x⟧ = f x. Lean's standard library extends the Calculus of Constructions with additional constants that perform exactly these constructions, and installs this last equation as a definitional reduction rule.
In its most basic form, the quotient construction does not even require r to be an equivalence relation. The following constants are built into Lean:
namespace Hidden
universe u v
axiom Quot : {α : Sort u} → (α → α → Prop) → Sort u
axiom Quot.mk : {α : Sort u} → (r : α → α → Prop) → α → Quot r
axiom Quot.ind :
∀ {α : Sort u} {r : α → α → Prop} {β : Quot r → Prop},
(∀ a, β (Quot.mk r a)) → (q : Quot r) → β q
axiom Quot.lift :
{α : Sort u} → {r : α → α → Prop} → {β : Sort u} → (f : α → β)
→ (∀ a b, r a b → f a = f b) → Quot r → β
end Hidden
The first one forms a type Quot r given a type α by any binary relation r on α. The second maps α to Quot α, so that if r : α → α → Prop and a : α, then Quot.mk r a is an element of Quot r. The third principle, Quot.ind, says that every element of Quot.mk r a is of this form. As for Quot.lift, given a function f : α → β, if h is a proof that f respects the relation r, then Quot.lift f h is the corresponding function on Quot r. The idea is that for each element a in α, the function Quot.lift f h maps Quot.mk r a (the r-class containing a) to f a, wherein h shows that this function is well defined. In fact, the computation principle is declared as a reduction rule, as the proof below makes clear.
def mod7Rel (x y : Nat) : Prop :=
x % 7 = y % 7
-- the quotient type
#check (Quot mod7Rel : Type)
-- the class of a
#check (Quot.mk mod7Rel 4 : Quot mod7Rel)
def f (x : Nat) : Bool :=
x % 7 = 0
theorem f_respects (a b : Nat) (h : mod7Rel a b) : f a = f b := by
simp [mod7Rel, f] at *
rw [h]
#check (Quot.lift f f_respects : Quot mod7Rel → Bool)
-- the computation principle
example (a : Nat) : Quot.lift f f_respects (Quot.mk mod7Rel a) = f a :=
rfl
The four constants, Quot, Quot.mk, Quot.ind, and Quot.lift in and of themselves are not very strong. You can check that the Quot.ind is satisfied if we take Quot r to be simply α, and take Quot.lift to be the identity function (ignoring h). For that reason, these four constants are not viewed as additional axioms.
They are, like inductively defined types and the associated constructors and recursors, viewed as part of the logical framework.
What makes the Quot construction into a bona fide quotient is the following additional axiom:
namespace Hidden
universe u v
axiom Quot.sound :
∀ {α : Type u} {r : α → α → Prop} {a b : α},
r a b → Quot.mk r a = Quot.mk r b
end Hidden
This is the axiom that asserts that any two elements of α that are related by r become identified in the quotient. If a theorem or definition makes use of Quot.sound, it will show up in the #print axioms command.
Of course, the quotient construction is most commonly used in situations when r is an equivalence relation. Given r as above, if we define r' according to the rule r' a b iff Quot.mk r a = Quot.mk r b, then it's clear that r' is an equivalence relation. Indeed, r' is the kernel of the function a ↦ quot.mk r a. The axiom Quot.sound says that r a b implies r' a b. Using Quot.lift and Quot.ind, we can show that r' is the smallest equivalence relation containing r, in the sense that if r'' is any equivalence relation containing r, then r' a b implies r'' a b. In particular, if r was an equivalence relation to start with, then for all a and b we have r a b iff r' a b.
To support this common use case, the standard library defines the notion of a setoid, which is simply a type with an associated equivalence relation:
namespace Hidden
class Setoid (α : Sort u) where
r : α → α → Prop
iseqv : Equivalence r
instance {α : Sort u} [Setoid α] : HasEquiv α :=
⟨Setoid.r⟩
namespace Setoid
variable {α : Sort u} [Setoid α]
theorem refl (a : α) : a ≈ a :=
iseqv.refl a
theorem symm {a b : α} (hab : a ≈ b) : b ≈ a :=
iseqv.symm hab
theorem trans {a b c : α} (hab : a ≈ b) (hbc : b ≈ c) : a ≈ c :=
iseqv.trans hab hbc
end Setoid
end Hidden
Given a type α, a relation r on α, and a proof p that r is an equivalence relation, we can define Setoid.mk p as an instance of the setoid class.
namespace Hidden
def Quotient {α : Sort u} (s : Setoid α) :=
@Quot α Setoid.r
end Hidden
The constants Quotient.mk, Quotient.ind, Quotient.lift, and Quotient.sound are nothing more than the specializations of the corresponding elements of Quot. The fact that type class inference can find the setoid associated to a type α brings a number of benefits. First, we can use the notation a ≈ b (entered with \approx) for Setoid.r a b, where the instance of Setoid is implicit in the notation Setoid.r. We can use the generic theorems Setoid.refl, Setoid.symm, Setoid.trans to reason about the relation. Specifically with quotients we can use the generic notation ⟦a⟧ for Quot.mk Setoid.r where the instance of Setoid is implicit in the notation Setoid.r, as well as the theorem Quotient.exact:
universe u
#check (@Quotient.exact :
∀ {α : Sort u} {s : Setoid α} {a b : α},
Quotient.mk s a = Quotient.mk s b → a ≈ b)
Together with Quotient.sound, this implies that the elements of the quotient correspond exactly to the equivalence classes of elements in α.
Recall that in the standard library, α × β represents the Cartesian product of the types α and β. To illustrate the use of quotients, let us define the type of unordered pairs of elements of a type α as a quotient of the type α × α. First, we define the relevant equivalence relation:
private def eqv (p₁ p₂ : α × α) : Prop :=
(p₁.1 = p₂.1 ∧ p₁.2 = p₂.2) ∨ (p₁.1 = p₂.2 ∧ p₁.2 = p₂.1)
infix:50 " ~ " => eqv
The next step is to prove that eqv is in fact an equivalence relation, which is to say, it is reflexive, symmetric and transitive. We can prove these three facts in a convenient and readable way by using dependent pattern matching to perform case-analysis and break the hypotheses into pieces that are then reassembled to produce the conclusion.
private def eqv (p₁ p₂ : α × α) : Prop :=
(p₁.1 = p₂.1 ∧ p₁.2 = p₂.2) ∨ (p₁.1 = p₂.2 ∧ p₁.2 = p₂.1)
infix:50 " ~ " => eqv
private theorem eqv.refl (p : α × α) : p ~ p :=
Or.inl ⟨rfl, rfl⟩
private theorem eqv.symm : ∀ {p₁ p₂ : α × α}, p₁ ~ p₂ → p₂ ~ p₁
| (a₁, a₂), (b₁, b₂), (Or.inl ⟨a₁b₁, a₂b₂⟩) =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (Or.inr ⟨a₁b₂, a₂b₁⟩) =>
Or.inr (by simp_all)
private theorem eqv.trans : ∀ {p₁ p₂ p₃ : α × α}, p₁ ~ p₂ → p₂ ~ p₃ → p₁ ~ p₃
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inl (by simp_all)
private theorem is_equivalence : Equivalence (@eqv α) :=
{ refl := eqv.refl, symm := eqv.symm, trans := eqv.trans }
Now that we have proved that eqv is an equivalence relation, we can construct a Setoid (α × α), and use it to define the type UProd α of unordered pairs.
private def eqv (p₁ p₂ : α × α) : Prop :=
(p₁.1 = p₂.1 ∧ p₁.2 = p₂.2) ∨ (p₁.1 = p₂.2 ∧ p₁.2 = p₂.1)
infix:50 " ~ " => eqv
private theorem eqv.refl (p : α × α) : p ~ p :=
Or.inl ⟨rfl, rfl⟩
private theorem eqv.symm : ∀ {p₁ p₂ : α × α}, p₁ ~ p₂ → p₂ ~ p₁
| (a₁, a₂), (b₁, b₂), (Or.inl ⟨a₁b₁, a₂b₂⟩) =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (Or.inr ⟨a₁b₂, a₂b₁⟩) =>
Or.inr (by simp_all)
private theorem eqv.trans : ∀ {p₁ p₂ p₃ : α × α}, p₁ ~ p₂ → p₂ ~ p₃ → p₁ ~ p₃
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inl (by simp_all)
private theorem is_equivalence : Equivalence (@eqv α) :=
{ refl := eqv.refl, symm := eqv.symm, trans := eqv.trans }
instance uprodSetoid (α : Type u) : Setoid (α × α) where
r := eqv
iseqv := is_equivalence
def UProd (α : Type u) : Type u :=
Quotient (uprodSetoid α)
namespace UProd
def mk {α : Type} (a₁ a₂ : α) : UProd α :=
Quotient.mk' (a₁, a₂)
notation "{ " a₁ ", " a₂ " }" => mk a₁ a₂
end UProd
Notice that we locally define the notation {a₁, a₂} for ordered pairs as Quotient.mk (a₁, a₂). This is useful for illustrative purposes, but it is not a good idea in general, since the notation will shadow other uses of curly brackets, such as for records and sets.
We can easily prove that {a₁, a₂} = {a₂, a₁} using quot.sound, since we have (a₁, a₂) ~ (a₂, a₁).
private def eqv (p₁ p₂ : α × α) : Prop :=
(p₁.1 = p₂.1 ∧ p₁.2 = p₂.2) ∨ (p₁.1 = p₂.2 ∧ p₁.2 = p₂.1)
infix:50 " ~ " => eqv
private theorem eqv.refl (p : α × α) : p ~ p :=
Or.inl ⟨rfl, rfl⟩
private theorem eqv.symm : ∀ {p₁ p₂ : α × α}, p₁ ~ p₂ → p₂ ~ p₁
| (a₁, a₂), (b₁, b₂), (Or.inl ⟨a₁b₁, a₂b₂⟩) =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (Or.inr ⟨a₁b₂, a₂b₁⟩) =>
Or.inr (by simp_all)
private theorem eqv.trans : ∀ {p₁ p₂ p₃ : α × α}, p₁ ~ p₂ → p₂ ~ p₃ → p₁ ~ p₃
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inl (by simp_all)
private theorem is_equivalence : Equivalence (@eqv α) :=
{ refl := eqv.refl, symm := eqv.symm, trans := eqv.trans }
instance uprodSetoid (α : Type u) : Setoid (α × α) where
r := eqv
iseqv := is_equivalence
def UProd (α : Type u) : Type u :=
Quotient (uprodSetoid α)
namespace UProd
def mk {α : Type} (a₁ a₂ : α) : UProd α :=
Quotient.mk' (a₁, a₂)
notation "{ " a₁ ", " a₂ " }" => mk a₁ a₂
theorem mk_eq_mk (a₁ a₂ : α) : {a₁, a₂} = {a₂, a₁} :=
Quot.sound (Or.inr ⟨rfl, rfl⟩)
end UProd
To complete the example, given a : α and u : uprod α, we define the proposition a ∈ u which should hold if a is one of the elements of the unordered pair u. First, we define a similar proposition mem_fn a u on (ordered) pairs; then we show that mem_fn respects the equivalence relation eqv with the lemma mem_respects. This is an idiom that is used extensively in the Lean standard library.
private def eqv (p₁ p₂ : α × α) : Prop :=
(p₁.1 = p₂.1 ∧ p₁.2 = p₂.2) ∨ (p₁.1 = p₂.2 ∧ p₁.2 = p₂.1)
infix:50 " ~ " => eqv
private theorem eqv.refl (p : α × α) : p ~ p :=
Or.inl ⟨rfl, rfl⟩
private theorem eqv.symm : ∀ {p₁ p₂ : α × α}, p₁ ~ p₂ → p₂ ~ p₁
| (a₁, a₂), (b₁, b₂), (Or.inl ⟨a₁b₁, a₂b₂⟩) =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (Or.inr ⟨a₁b₂, a₂b₁⟩) =>
Or.inr (by simp_all)
private theorem eqv.trans : ∀ {p₁ p₂ p₃ : α × α}, p₁ ~ p₂ → p₂ ~ p₃ → p₁ ~ p₃
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inl (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inl ⟨a₁b₁, a₂b₂⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inl ⟨b₁c₁, b₂c₂⟩ =>
Or.inr (by simp_all)
| (a₁, a₂), (b₁, b₂), (c₁, c₂), Or.inr ⟨a₁b₂, a₂b₁⟩, Or.inr ⟨b₁c₂, b₂c₁⟩ =>
Or.inl (by simp_all)
private theorem is_equivalence : Equivalence (@eqv α) :=
{ refl := eqv.refl, symm := eqv.symm, trans := eqv.trans }
instance uprodSetoid (α : Type u) : Setoid (α × α) where
r := eqv
iseqv := is_equivalence
def UProd (α : Type u) : Type u :=
Quotient (uprodSetoid α)
namespace UProd
def mk {α : Type} (a₁ a₂ : α) : UProd α :=
Quotient.mk' (a₁, a₂)
notation "{ " a₁ ", " a₂ " }" => mk a₁ a₂
theorem mk_eq_mk (a₁ a₂ : α) : {a₁, a₂} = {a₂, a₁} :=
Quot.sound (Or.inr ⟨rfl, rfl⟩)
private def mem_fn (a : α) : α × α → Prop
| (a₁, a₂) => a = a₁ ∨ a = a₂
-- auxiliary lemma for proving mem_respects
private theorem mem_swap {a : α} :
∀ {p : α × α}, mem_fn a p = mem_fn a (⟨p.2, p.1⟩)
| (a₁, a₂) => by
apply propext
apply Iff.intro
. intro
| Or.inl h => exact Or.inr h
| Or.inr h => exact Or.inl h
. intro
| Or.inl h => exact Or.inr h
| Or.inr h => exact Or.inl h
private theorem mem_respects
: {p₁ p₂ : α × α} → (a : α) → p₁ ~ p₂ → mem_fn a p₁ = mem_fn a p₂
| (a₁, a₂), (b₁, b₂), a, Or.inl ⟨a₁b₁, a₂b₂⟩ => by simp_all
| (a₁, a₂), (b₁, b₂), a, Or.inr ⟨a₁b₂, a₂b₁⟩ => by simp_all; apply mem_swap
def mem (a : α) (u : UProd α) : Prop :=
Quot.liftOn u (fun p => mem_fn a p) (fun p₁ p₂ e => mem_respects a e)
infix:50 (priority := high) " ∈ " => mem
theorem mem_mk_left (a b : α) : a ∈ {a, b} :=
Or.inl rfl
theorem mem_mk_right (a b : α) : b ∈ {a, b} :=
Or.inr rfl
theorem mem_or_mem_of_mem_mk {a b c : α} : c ∈ {a, b} → c = a ∨ c = b :=
fun h => h
end UProd
For convenience, the standard library also defines Quotient.lift₂ for lifting binary functions, and Quotient.ind₂ for induction on two variables.
We close this section with some hints as to why the quotient construction implies function extenionality. It is not hard to show that extensional equality on the (x : α) → β x is an equivalence relation, and so we can consider the type extfun α β of functions "up to equivalence." Of course, application respects that equivalence in the sense that if f₁ is equivalent to f₂, then f₁ a is equal to f₂ a. Thus application gives rise to a function extfun_app : extfun α β → (x : α) → β x. But for every f, extfun_app ⟦f⟧ is definitionally equal to fun x => f x, which is in turn definitionally equal to f. So, when f₁ and f₂ are extensionally equal, we have the following chain of equalities:
f₁ = extfun_app ⟦f₁⟧ = extfun_app ⟦f₂⟧ = f₂
As a result, f₁ is equal to f₂.
## Choice
To state the final axiom defined in the standard library, we need the Nonempty type, which is defined as follows:
namespace Hidden
class inductive Nonempty (α : Sort u) : Prop where
| intro (val : α) : Nonempty α
end Hidden
Because Nonempty α has type Prop and its constructor contains data, it can only eliminate to Prop. In fact, Nonempty α is equivalent to ∃ x : α, True:
example (α : Type u) : Nonempty α ↔ ∃ x : α, True :=
Iff.intro (fun ⟨a⟩ => ⟨a, trivial⟩) (fun ⟨a, h⟩ => ⟨a⟩)
Our axiom of choice is now expressed simply as follows:
namespace Hidden
universe u
axiom choice {α : Sort u} : Nonempty α → α
end Hidden
Given only the assertion h that α is nonempty, choice h magically produces an element of α. Of course, this blocks any meaningful computation: by the interpretation of Prop, h contains no information at all as to how to find such an element.
This is found in the Classical namespace, so the full name of the theorem is Classical.choice. The choice principle is equivalent to the principle of indefinite description, which can be expressed with subtypes as follows:
namespace Hidden
universe u
axiom choice {α : Sort u} : Nonempty α → α
noncomputable def indefiniteDescription {α : Sort u} (p : α → Prop)
(h : ∃ x, p x) : {x // p x} :=
choice <| let ⟨x, px⟩ := h; ⟨⟨x, px⟩⟩
end Hidden
Because it depends on choice, Lean cannot generate bytecode for indefiniteDescription, and so requires us to mark the definition as noncomputable. Also in the Classical namespace, the function choose and the property choose_spec decompose the two parts of the output of indefinite_description:
open Classical
namespace Hidden
noncomputable def choose {α : Sort u} {p : α → Prop} (h : ∃ x, p x) : α :=
(indefiniteDescription p h).val
theorem choose_spec {α : Sort u} {p : α → Prop} (h : ∃ x, p x) : p (choose h) :=
(indefiniteDescription p h).property
end Hidden
The choice principle also erases the distinction between the property of being Nonempty and the more constructive property of being Inhabited:
open Classical
theorem inhabited_of_nonempty :Nonempty α → Inhabited α :=
fun h => choice (let ⟨a⟩ := h; ⟨⟨a⟩⟩)
In the next section, we will see that propext, funext, and choice, taken together, imply the law of the excluded middle and the decidability of all propositions. Using those, one can strengthen the principle of indefinite description as follows:
open Classical
universe u
#check (@strongIndefiniteDescription :
{α : Sort u} → (p : α → Prop)
→ Nonempty α → {x // (∃ (y : α), p y) → p x})
Assuming the ambient type α is nonempty, strongIndefiniteDescription p produces an element of α satisfying p if there is one. The data component of this definition is conventionally known as Hilbert's epsilon function:
open Classical
universe u
#check (@epsilon :
{α : Sort u} → [Nonempty α]
→ (α → Prop) → α)
#check (@epsilon_spec :
∀ {a : Sort u} {p : a → Prop}(hex : ∃ (y : a), p y),
p (@epsilon _ (nonempty_of_exists hex) p))
## The Law of the Excluded Middle
The law of the excluded middle is the following
open Classical
#check (@em : ∀ (p : Prop), p ∨ ¬p)
Diaconescu's theorem states that the axiom of choice is sufficient to derive the law of excluded middle. More precisely, it shows that the law of the excluded middle follows from Classical.choice, propext, and funext. We sketch the proof that is found in the standard library.
First, we import the necessary axioms, and define two predicates U and V:
namespace Hidden
open Classical
theorem em (p : Prop) : p ∨ ¬p :=
let U (x : Prop) : Prop := x = True ∨ p
let V (x : Prop) : Prop := x = False ∨ p
have exU : ∃ x, U x := ⟨True, Or.inl rfl⟩
have exV : ∃ x, V x := ⟨False, Or.inl rfl⟩
sorry
end Hidden
If p is true, then every element of Prop is in both U and V. If p is false, then U is the singleton true, and V is the singleton false.
Next, we use some to choose an element from each of U and V:
namespace Hidden
open Classical
theorem em (p : Prop) : p ∨ ¬p :=
let U (x : Prop) : Prop := x = True ∨ p
let V (x : Prop) : Prop := x = False ∨ p
have exU : ∃ x, U x := ⟨True, Or.inl rfl⟩
have exV : ∃ x, V x := ⟨False, Or.inl rfl⟩
let u : Prop := choose exU
let v : Prop := choose exV
have u_def : U u := choose_spec exU
have v_def : V v := choose_spec exV
sorry
end Hidden
Each of U and V is a disjunction, so u_def and v_def represent four cases. In one of these cases, u = True and v = False, and in all the other cases, p is true. Thus we have:
namespace Hidden
open Classical
theorem em (p : Prop) : p ∨ ¬p :=
let U (x : Prop) : Prop := x = True ∨ p
let V (x : Prop) : Prop := x = False ∨ p
have exU : ∃ x, U x := ⟨True, Or.inl rfl⟩
have exV : ∃ x, V x := ⟨False, Or.inl rfl⟩
let u : Prop := choose exU
let v : Prop := choose exV
have u_def : U u := choose_spec exU
have v_def : V v := choose_spec exV
have not_uv_or_p : u ≠ v ∨ p :=
match u_def, v_def with
| Or.inr h, _ => Or.inr h
| _, Or.inr h => Or.inr h
| Or.inl hut, Or.inl hvf =>
have hne : u ≠ v := by simp [hvf, hut, true_ne_false]
Or.inl hne
sorry
end Hidden
On the other hand, if p is true, then, by function extensionality and propositional extensionality, U and V are equal. By the definition of u and v, this implies that they are equal as well.
namespace Hidden
open Classical
theorem em (p : Prop) : p ∨ ¬p :=
let U (x : Prop) : Prop := x = True ∨ p
let V (x : Prop) : Prop := x = False ∨ p
have exU : ∃ x, U x := ⟨True, Or.inl rfl⟩
have exV : ∃ x, V x := ⟨False, Or.inl rfl⟩
let u : Prop := choose exU
let v : Prop := choose exV
have u_def : U u := choose_spec exU
have v_def : V v := choose_spec exV
have not_uv_or_p : u ≠ v ∨ p :=
match u_def, v_def with
| Or.inr h, _ => Or.inr h
| _, Or.inr h => Or.inr h
| Or.inl hut, Or.inl hvf =>
have hne : u ≠ v := by simp [hvf, hut, true_ne_false]
Or.inl hne
have p_implies_uv : p → u = v :=
fun hp =>
have hpred : U = V :=
funext fun x =>
have hl : (x = True ∨ p) → (x = False ∨ p) :=
fun _ => Or.inr hp
have hr : (x = False ∨ p) → (x = True ∨ p) :=
fun _ => Or.inr hp
show (x = True ∨ p) = (x = False ∨ p) from
propext (Iff.intro hl hr)
have h₀ : ∀ exU exV, @choose _ U exU = @choose _ V exV := by
rw [hpred]; intros; rfl
show u = v from h₀ _ _
sorry
end Hidden
Putting these last two facts together yields the desired conclusion:
namespace Hidden
open Classical
theorem em (p : Prop) : p ∨ ¬p :=
let U (x : Prop) : Prop := x = True ∨ p
let V (x : Prop) : Prop := x = False ∨ p
have exU : ∃ x, U x := ⟨True, Or.inl rfl⟩
have exV : ∃ x, V x := ⟨False, Or.inl rfl⟩
let u : Prop := choose exU
let v : Prop := choose exV
have u_def : U u := choose_spec exU
have v_def : V v := choose_spec exV
have not_uv_or_p : u ≠ v ∨ p :=
match u_def, v_def with
| Or.inr h, _ => Or.inr h
| _, Or.inr h => Or.inr h
| Or.inl hut, Or.inl hvf =>
have hne : u ≠ v := by simp [hvf, hut, true_ne_false]
Or.inl hne
have p_implies_uv : p → u = v :=
fun hp =>
have hpred : U = V :=
funext fun x =>
have hl : (x = True ∨ p) → (x = False ∨ p) :=
fun _ => Or.inr hp
have hr : (x = False ∨ p) → (x = True ∨ p) :=
fun _ => Or.inr hp
show (x = True ∨ p) = (x = False ∨ p) from
propext (Iff.intro hl hr)
have h₀ : ∀ exU exV, @choose _ U exU = @choose _ V exV := by
rw [hpred]; intros; rfl
show u = v from h₀ _ _
match not_uv_or_p with
| Or.inl hne => Or.inr (mt p_implies_uv hne)
| Or.inr h => Or.inl h
end Hidden
Consequences of excluded middle include double-negation elimination, proof by cases, and proof by contradiction, all of which are described in the Section Classical Logic. The law of the excluded middle and propositional extensionality imply propositional completeness:
namespace Hidden
open Classical
theorem propComplete (a : Prop) : a = True ∨ a = False :=
match em a with
| Or.inl ha => Or.inl (propext (Iff.intro (fun _ => ⟨⟩) (fun _ => ha)))
| Or.inr hn => Or.inr (propext (Iff.intro (fun h => hn h) (fun h => False.elim h)))
end Hidden
Together with choice, we also get the stronger principle that every proposition is decidable. Recall that the class of Decidable propositions is defined as follows:
namespace Hidden
class inductive Decidable (p : Prop) where
| isFalse (h : ¬p) : Decidable p
| isTrue (h : p) : Decidable p
end Hidden
In contrast to p ∨ ¬ p, which can only eliminate to Prop, the type decidable p is equivalent to the sum type Sum p (¬ p), which can eliminate to any type. It is this data that is needed to write an if-then-else expression.
As an example of classical reasoning, we use choose to show that if f : α → β is injective and α is inhabited, then f has a left inverse. To define the left inverse linv, we use a dependent if-then-else expression. Recall that if h : c then t else e is notation for dite c (fun h : c => t) (fun h : ¬ c => e). In the definition of linv, choice is used twice: first, to show that (∃ a : A, f a = b) is "decidable," and then to choose an a such that f a = b. Notice that propDecidable is a scoped instance and is activated by the open Classical command. We use this instance to justify the if-then-else expression. (See also the discussion in Section Decidable Propositions).
open Classical
noncomputable def linv [Inhabited α] (f : α → β) : β → α :=
fun b : β => if ex : (∃ a : α, f a = b) then choose ex else default
theorem linv_comp_self {f : α → β} [Inhabited α]
(inj : ∀ {a b}, f a = f b → a = b)
: linv f ∘ f = id :=
funext fun a =>
have ex : ∃ a₁ : α, f a₁ = f a := ⟨a, rfl⟩
have feq : f (choose ex) = f a := choose_spec ex
calc linv f (f a) = choose ex := dif_pos ex
_ = a := inj feq
From a classical point of view, linv is a function. From a constructive point of view, it is unacceptable; because there is no way to implement such a function in general, the construction is not informative.
|
2023-02-02 11:59:59
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.58309406042099, "perplexity": 1769.3179531541807}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500017.27/warc/CC-MAIN-20230202101933-20230202131933-00174.warc.gz"}
|
https://studyadda.com/solved-papers/neet/physics/transmission-of-heat/jee-pyq-transmission-of-heat/1117
|
# Solved papers for JEE Main & Advanced Physics Transmission of Heat JEE PYQ-Transmission Of Heat
### done JEE PYQ-Transmission Of Heat Total Questions - 32
• question_answer1) Wavelength of light used in an optical instrument are ${{\lambda }_{1}}=4000\,\overset{0}{\mathop{A}}\,$ and ${{\lambda }_{2}}=5000\,\overset{0}{\mathop{A}}\,$, then ratio of their respective resolving powers (corresponding to${{\lambda }_{1}}$and${{\lambda }_{2}}$) is [AIEEE 2002]
A)
$16:25$
B)
$9:1$
C)
$4:5$
D)
$5:4$
• question_answer2) Which of the following is more close to a black body? [AIEEE 2002]
A)
Black board paint
B)
Green leaves
C)
Black holes
D)
Red roses
• question_answer3) Which statement is incorrect? [AIEEE 2002]
A)
All reversible cycles have same efficiency
B)
Reversible cycle has more efficiency than an irreversible one
C)
Carnot cycle is a reversible one
D)
Carnot cycle has the maximum efficiency in all cycles
• question_answer4) Two spheres of the same material have radii 1 m and 4 m and temperatures 4000 K and 2000 K respectively. The ratio of the energy radiated per second by the first sphere to that by the second is [AIEEE 2002]
A)
$1:1$
B)
$16:1$
C)
$4:1$
D)
$1:9$
• question_answer5) The earth radiates in the infrared region of the spectrum. The spectrum is correctly given by [AIEEE 2003]
A)
Rayleigh Jeans law
B)
C)
D)
Wien's law
• question_answer6) According to Newton's law of cooling, the rate of cooling of a body is proportional to ${{(\Delta \theta )}^{n}}$, where $\Delta \theta$ is the difference of the temperature of the body and the surroundings and n is equal to [AIEEE 2003]
A)
2
B)
3
C)
4
D)
1
• question_answer7) If the temperature of the sun were to increase from T to 2T and its radius from R to 2R, then the ratio of the radiant energy received on the earth to what it was previously, will be [AIEEE 2004]
A)
4
B)
16
C)
32
D)
64
• question_answer8) The temperature of the two outer surfaces of a composite slab, consisting of two materials having coefficients of thermal conductivity K and$2K$and thickness$x$and$4x,$respectively are${{T}_{2}},$and${{T}_{1}}({{T}_{2}}>{{T}_{1}})$. The rate of heat transfer through the slab, in a steady state is$\left( \frac{A({{T}_{2}}-{{T}_{1}})K}{x} \right)f,$with f equals [AIEEE 2004]
A)
1
B)
1/2
C)
2/3
D)
1/3
• question_answer9) The figure shows a system of two concentric spheres of radii${{r}_{1}},{{r}_{2}}$and kept at temperatures ${{T}_{1}},{{T}_{2}},$respectively. The radial rate of flow of heat in a substance between the two concentric spheres, is proportional to [AIEEE 2005]
A)
$\frac{({{r}_{2}}-{{r}_{1}})}{({{r}_{1}}{{r}_{2}})}$
B)
in $\left( \frac{{{r}_{2}}}{{{r}_{1}}} \right)$
C)
$\frac{{{r}_{1}}{{r}_{2}}}{({{r}_{2}}-{{r}_{1}})}$
D)
$({{r}_{2}}-{{r}_{1}})$
• question_answer10) Assuming the sun to be a spherical body of radius R at a temperature of T K, evaluate the total radiant power, incident on earth, at a distance r from the sun. [AIEEE 2006]
A)
$4\pi r_{0}^{2}{{R}^{2}}\sigma {{T}^{4}}/{{r}^{2}}$
B)
$\pi r_{0}^{2}{{R}^{2}}\sigma {{T}^{4}}/{{r}^{2}}$
C)
$r_{0}^{2}{{R}^{2}}\sigma {{T}^{4}}/4\pi {{r}^{2}}$
D)
${{R}^{2}}\sigma {{T}^{4}}/{{r}^{2}}$
• question_answer11) One end of a thermally insulated rod is kept at a temperature$m{{y}^{2}}+(1-{{m}^{2}})xy-m{{x}^{2}}=0$and the other at$xy=0,$. The rod is composed of two sections of lengths$-\frac{1}{2}$and$-2$and thermal conductivities$\pm 1$and$F(x)=f(x)+f\left( \frac{1}{x} \right),$ respectively. The temperature at the interface of the two sections is [AIEEE 2007]
A)
$f(x)=\int_{1}^{x}{\frac{\log \,t}{1+t}}dt$
B)
$\frac{1}{2}$
C)
$f:R\to R$
D)
$f(x)=$
• question_answer12) A long metallic bar is carrying heat from one of its ends to the other end under steady-state. The variation of temperature $\theta$ along the length$x$of the bar from its hot end is best described by which of the following figures? [AIEEE 2009]
A)
B)
C)
D)
• question_answer13) A liquid in a beaker has temperature $\theta (t)$ at time t and ${{\theta }_{0}}$ is temperature of surroundings, then according to Newton's law of cooling the correct graph between ${{\log }_{e}}(\theta -{{\theta }_{0}})$ and t is: [AIEEE 2012]
A)
B)
C)
D)
• question_answer14) The heat radiated per unit area in 1 hour by a furnace whose temperature is 3000 K is $(\sigma =5.7\times {{10}^{-8}}W\,{{m}^{-2}}{{K}^{-4}})$ [JEE ONLINE 07-05-2012]
A)
$1.7\times {{10}^{10}}J$
B)
$1.1\times {{10}^{12}}J$
C)
$2.8\times {{10}^{8}}J$
D)
$4.6\times {{10}^{6}}J$
• question_answer15) A large cylindrical rod of length L is made by joining two identical rods of copper and steel of length $\left( \frac{L}{2} \right)$each. The rods are completely insulated from the surroundings. If the free end If copper rod is maintained at 100°C and that of steel at 0°C then the temperature of junction is Thermal conductivity of copper is 9 times that if steel) [JEE ONLINE 19-05-2012]
A)
90°C
B)
50°C
C)
10°C
D)
67°C
• question_answer16) If a piece of metal is heated to temperature$\theta$ and then allowed to cool in a room which is at temperature ${{\theta }_{0}},$ the graph between the temperature T of the metal and time t will be closed to: [JEE MAIN 2013]
A)
B)
C)
D)
• question_answer17) Three rods of Copper, Brass and Steel are welded together to form a Y-shaped structure. Area of cross section of each rod End of copper rod is maintained at 100 °C where as ends of brass and steel are kept at 0 °C. Lengths of the copper, brass and steel rods are 46, 13 and 12 cms respectively. The rods are thermally insulated from surroundings except at ends. Thermal conductivities of copper, brass and steel are 0.92, 0.26 and 0.12 CGS units respectively. Rate of heat flow through copper rod is: [JEE MAIN 2014]
A)
4.8 cal/s
B)
6.0 cal/s
C)
1.2 cal/s
D)
2.4 cal/s
• question_answer18) A hot body, obeying Newtons law of cooling is cooling down from its peak value 80°C to an ambient temperature of 30°C. It takes 5 minutes in cooling down from 80°C to 40°C. [JEE ONLINE 11-04-2014] How much time will it take to cool down from 62°C to 32°C? (Given In 2 = 0.693, In 5 = 1.609)
A)
3.75 minutes
B)
8.6 minutes
C)
9.6 minutes
D)
6.5 minutes
• question_answer19) Hot water cools from 60°C to 50°C in the first 10 minutes and to 42°C in the next 10 minutes. The temperature of the surroundings is: [JEE ONLINE 12-04-2014]
A)
25°C
B)
10°C
C)
15°C
D)
20°C
• question_answer20) A black colored solid sphere of radius R and mass M is inside a cavity with vacuum inside. The walls of the cavity are maintained at temperature ${{T}_{0}}.$ The initial temperature of the sphere is $3{{T}_{0}}.$If the specific heat of the material of the sphere varies as $\alpha {{T}^{3}}$per unit mass with the temperature T of the sphere, where $\alpha$ is a constant, then the time taken for the sphere to cool down to temperature $2{{T}_{0}}$ will be ($\sigma$is Stefan Boltzmann constant) [JEE ONLINE 19-04-2014]
A)
$\frac{M\alpha }{4\pi {{R}^{2}}\sigma }\ln \left( \frac{3}{2} \right)$
B)
$\frac{M\alpha }{4\pi {{R}^{2}}\sigma }\ln \left( \frac{16}{3} \right)$
C)
$\frac{M\alpha }{16\pi {{R}^{2}}\sigma }\ln \left( \frac{16}{3} \right)$
D)
$\frac{M\alpha }{16\pi {{R}^{2}}\sigma }\ln \left( \frac{3}{2} \right)$
• question_answer21) Consider a spherical shell of radius R at temperature T. The black body radiation inside it can be considered as an ideal gas of photons with internal energy per unit volume$u=\frac{U}{V}\propto {{T}^{4}}$and pressure$p=\frac{1}{3}\left( \frac{U}{V} \right).$If the shell now undergoes an adiabatic expansion the relation between T and R is: [JEE MAIN 2015]
A)
$T\propto \frac{1}{R}$
B)
$T\propto \frac{1}{{{R}^{3}}}$
C)
$T\propto {{e}^{-R}}$
D)
$T\propto {{e}^{-3R}}$
• question_answer22) A body takes 10 minutes to cool from $60{}^\circ C$ to$50{}^\circ C$. The temperature of surroundings is constant at$25{}^\circ C$. Then, the temperature of the body after next 10 minutes will be approximately [JEE Online 15-04-2018 (II)]
A)
$43{}^\circ C$
B)
$47{}^\circ C$
C)
$41{}^\circ C$
D)
$45{}^\circ C$
• question_answer23) Temperature difference of $120{}^\circ \,C$ is maintained between two ends of a uniform rod AB of length 2L. Another bent rod PQ, of same cross-section as AB and length $\frac{3L}{2}$, is connected across AB (See figure). In steady state, temperature difference between P and Q will be close to: [JEE Main 09-Jan-2019 Morning]
A)
$45{}^\circ \,C$
B)
$75{}^\circ \,C$
C)
$35{}^\circ \,C$
D)
$60{}^\circ \,C$
• question_answer24) A 15 g mass of nitrogen gas is enclosed in a vessel at a temperature$27{}^\circ C$. Amount of heat transferred to the gas, so that rms velocity of molecules is doubled, is about: [JEE Main 09-Jan-2019 Evening] [Take$\,R=8.3$ J/K mole]
A)
10 J
B)
0.9 kJ
C)
14 kJ
D)
6 kJ
• question_answer25) A heat source at $T={{10}^{3}}$ K is connected to another heat reservoir at $T={{10}^{2}}$ K by a copper slab which is 1 m thick. Given that the thermal conductivity of copper is 0.1 $W{{K}^{-}}^{1}{{m}^{-}}^{1}$, the energy flux through it in the steady state is [JEE Main 10-Jan-2019 Morning]
A)
200 $W{{m}^{-}}^{2}$
B)
65 $W{{m}^{-}}^{2}$
C)
120 $W{{m}^{-}}^{2}$
D)
90 $W{{m}^{-}}^{2}$
• question_answer26) Two kg of a monoatomic gas is at a pressure of $4\times {{10}^{4}}N/{{m}^{2}}$. The density of the gas is $8\text{ }kg/{{m}^{3}}$. What is the order of energy of the gas due to its thermal motion? [JEE Main 10-Jan-2019 Evening]
A)
${{10}^{4}}$ J
B)
${{10}^{3}}J$
C)
${{10}^{5}}\text{ }J$
D)
${{10}^{6}}J$
• question_answer27) When 100 g of a liquid A at $100{}^\circ C$is added to 50 g of a liquid B at temperature$75{}^\circ C$, the temperature of the mixture becomes$90{}^\circ C$. The temperature of the mixture, if 100 g of liquid A at $100{}^\circ C$ is added to 50 g of liquid B at $50{}^\circ C$will be- [JEE Main 11-Jan-2019 Evening]
A)
$70{}^\circ C$
B)
$85{}^\circ C$
C)
$60{}^\circ C$
D)
$80{}^\circ C$
• question_answer28) A metal ball of mass 0.1 kg is heated upto $500{}^\circ C$ and dropped into a vessel of heat capacity$800\,\,J{{K}^{-1}}$ and containing 0.5 kg water. The initial temperature of water and vessel is $30{}^\circ C$. What is the approximate percentage increment in the temperature of the water? [JEE Main 11-Jan-2019 Evening] [Specific heat capacities of water and metal are, respectively, 4200 $Jk{{g}^{-1}}\,{{K}^{-1}}$and 400 $J\,k{{g}^{-1}}\,{{K}^{-1}}$]
A)
15%
B)
30%
C)
25%
D)
20%
• question_answer29) A cylinder of radius R is surrounded by a cylindrical shell of inner radius R and outer radius 2R. The thermal conductivity of the material of the inner cylinder is ${{K}_{1}}$and that of the outer cylinder is${{K}_{2}}$. Assuming no loss of heat, the effective thermal conductivity of the system for heat flowing along the length of the cylinder is- [JEE Main 12-Jan-2019 Morning]
A)
$\frac{2{{K}_{1}}+3{{K}_{2}}}{5}$
B)
$\frac{{{K}_{1}}+{{K}_{2}}}{2}$
C)
${{K}_{1}}+{{K}_{2}}$
D)
$\frac{{{K}_{1}}+3{{K}_{2}}}{4}$
• question_answer30) Radiation coming from transitions n = 2 to n = 1 of hydrogen atoms fall on $H{{e}^{+}}$ ions in n = 1 and n = 2 states. The possible transition of helium ions as they absorb energy from the radiation is: [JEE Main 8-4-2019 Morning]
A)
$n=1\to n=4$
B)
$n=2\to n=4$
C)
$n=2\to n=5$
D)
$n=2\to n=3$
• question_answer31) Two materials having coefficients of thermal conductivity '3K' and 'K' and thickness 'd' and '3d', respectively, are joined to form a slab as shown in the figure. The temperatures of the outer surfaces are $'{{\theta }_{2}}'$and $'{{\theta }_{1}}'$ respectively, $({{\theta }_{2}}>{{\theta }_{1}}).$The temperature at the interface is:-[JEE Main 9-4-2019 Afternoon]
A)
$\frac{{{\theta }_{2}}+{{\theta }_{1}}}{2}$
B)
$\frac{{{\theta }_{1}}}{10}+\frac{9{{\theta }_{2}}}{10}$
C)
$\frac{{{\theta }_{1}}}{3}+\frac{2{{\theta }_{2}}}{3}$
D)
$\frac{{{\theta }_{1}}}{6}+\frac{5{{\theta }_{2}}}{6}$
• question_answer32) One kg of water, at $20{}^\text{o}C,$is heated in an electric kettle whose heating element has a mean (temperature averaged) resistance of $20\Omega$. The rms voltage in the mains is 200 V. Ignoring heat loss from the kettle, time taken for water to evaporate fully, is close to: [Specific heat of water $=4200\text{ }J/kg\text{ }{}^\text{o}C$), Latent heat of water = 2260 kJ/kg] [JEE Main 12-4-2019 Afternoon]
A)
3 minutes
B)
22 minutes
C)
10 minutes
D)
16 minutes
|
2022-12-04 18:16:28
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7407765984535217, "perplexity": 1743.2384828935167}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446710978.15/warc/CC-MAIN-20221204172438-20221204202438-00876.warc.gz"}
|
https://batman.readthedocs.io/en/develop/pod.html
|
# POD for Proper Orthogonal Decomposition¶
## What is it?¶
The Proper Orthogonal Decomposition (POD) is a technique used to decompose a matrix and characterize it by its principal components which are called modes [AnindyaChatterjee2000]. To approximate a function $$z(x,t)$$, only a finite sum of terms is required:
$z(x,t) \simeq \sum_{k=1}^{m} a_k(t) \phi_k(x).$
The function $$\phi_{k}(x)$$ have an infinite representation. It can be chosen as a Fourier series or Chebyshev polynomials, etc. For a chosen basis of function, a set of unique time-functions $$a_k(t)$$ arise. In case of the POD, the basis function are orthonormal. Meaning that:
$\begin{split}\int_{x} \phi_{k_1} \phi_{k_2} dx &= \left\{\begin{array}{rcl} 1 & \text{if} & k_1 = k_2 \\ 0 & \text{if} & k_1 \neq k_2\end{array}\right. ,\\ a_k (t) &= \int_{x} z(x,t) \phi_k(x) dx.\end{split}$
The principle of the POD is to choose $$\phi_k(x)$$ such that the approximation of $$z(x,t)$$ is the best in a least squares sense. These orthonormal functions are called the proper orthogonal modes of the function.
When dealing with CFD simulations, the size of the domain $$m$$ is usually smaller than the number of measures, snapshots, $$n$$. Hence, from the existing decomposition methods, the Singular Value Decomposition (SVD) is used. It is the snapshots methods [Cordier2006].
The Singular Value Decomposition (SVD) is a factorization operation of a matrix expressed as:
$A = U \Sigma V^T,$
with $$V$$ diagonalizes $$A^TA$$, $$U$$ diagonalizes $$AA^T$$ and $$\Sigma$$ is the singular value matrix which diagonal is composed by the singular values of $$A$$. Knowing that a singular value is the square root of an eigen value. $$u_i$$ and $$v_i$$ are eigen vectors of respectively $$U$$ and $$V$$ which form an orthonormal basis. Thus, the initial matrix can be rewritten:
$A = \sum_{i=1}^{r} \sigma_i u_i v_i^T,$
$$r$$ being the rank of the matrix. If taken $$k < r$$, an approximation of the initial matrix can be constructed. This allows to compress the data as only an extract of $$u$$ and $$v$$ need to be stored.
### References¶
AnindyaChatterjee2000
Anindya Chatterjee. “An introduction to the proper orthogonal decomposition”. Current Science 78.7. 2000.
Cordier2006
1. Cordierand M. Bergmann. “Réduction de dynamique par décomposition orthogonale aux valeurs propres (POD)”. Ecole de printemps OCET. 2006.
|
2021-06-14 14:20:46
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8817093968391418, "perplexity": 440.41108459434855}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-25/segments/1623487612537.23/warc/CC-MAIN-20210614135913-20210614165913-00020.warc.gz"}
|
https://www.coinsmart.com/blog/erc-721-nft-blueprint/
|
Exciting News! CoinSmart is officially a publicly-traded company on the NEO Exchange trading under ticker SMRT.
# NFT Blueprint: What is ERC-721?
NOTE: At the end of the article, we have a GetSmart Quiz for you. If you correctly answer all the questions, you will receive (1) entry to win $4,000 CAD of Bitcoin! Draws are held at the end of every calendar month. ## In Brief: • NFTs have become the hottest thing in crypto in a very short time. • NFT = Non-Fungible Tokens • “Non-fungibility” is the property that makes an asset unique and irreplaceable. • ERC-721 is one of the most well-known token standards that imparts non-fungibility. • ERC-721 defines the functions that help in “establishing token ownership” and “transfer of ownership.” Everyone is talking about NFTs. By the way, that’s not an exaggeration. Like we said….EVERYONE. Here is a fun fact for you. NFTs are so mainstream that even SNL has covered it. Earlier last month, news came out that NFTs have ballooned into a billion-dollar market. With Beeple selling his art for$69 million in the prestigious Christie’s auction house, to Lindsay Lohan and Paris Hilton selling their digital art, NFTs have quickly become a household term. Marketplaces like OpenSea and Rarible have made NFTs more accessible than ever before.
So, what exactly are NFTs? Well…let’s start with the most obvious question first.
## What does “Non-Fungible” mean?
NFT stands for Non-Fungible Tokens. To understand what that’s supposed to mean, let’s first learn about the differences between fungibility and non-fungibility.
Fungibility is the property of an asset that makes it interchangeable with another asset of the same type. To understand this, let’s take an example of the most popular fungible assets– money. Imagine you borrowed a $100 note from your friend. When you pay back, you don’t need to give her back that exact same note. You can pay her back with: • Another$100 note.
• Two $50 notes. • Ten$10 notes.
The reason being, fiat currency is fungible. You can easily replace one note with another (of the same type and value). You can also break it down and pay it back with smaller denominations. This fungible property of currency allows the citizens of a country to unanimously accept it as a valuable and reliable entity. Every unit of that currency is worth the same no matter which unit is being spent.
Now, let’s look at the other side of the equation. Imagine you borrowed your wife’s car for the weekend.
What do you think will happen if you return it piece-by-piece? What if instead of a car, you give her a seat, an engine, and a tailpipe?
Well, if that does happen, you might as well get comfortable sleeping on the couch!
Cars are an example of a non-fungible asset. You can’t break it down into smaller units. In fact, you can’t even replace it with another car, even if it is of the same make and model.
A non-fungible token gets its value from the very fact that it is unique and irreplaceable. NFTs can represent digital files such as art, audio, videos, items in video games, and other forms of creative work.
## Ethereum Token Standards: ERC-20 vs ERC-721
Now, if you have been around the crypto-space, you must have heard the terms “ERC-20” and “ERC-721” thrown around quite a bit. “ERC” stands for “Ethereum Request for Comment,” while 20 and 721 are the numbers assigned to the requests. The ERCs are used to create a token standard that the developers use in their smart contracts.
So, why is this necessary?
Imagine that you are walking down the street with 4 different shops accepting 4 different currencies. Can you imagine how much of a nightmare that will be? Not only do you need to have all four currencies, but these shops need to find out ways to work with each other and constantly keep an eye out for currency exchange rates.
Now, extend the same logic to Ethereum.
For Ethereum to be a healthy ecosystem, the dApps built on top of it need to be as interoperable as possible. We can’t have Project A with its own unique token and Project B with another unique token. The tokens need to follow a set of rules to ensure that they can easily move in and out of different apps within the ecosystem.
This is why the ERC-20 standard was adopted for fungible tokens and ERC-721 was adopted for non-fungible tokens.
## ERC-721 – The Non-Fungible Token Standards
In this section, let us run through the different features of the ERC-721 standard, which allows it to create non-fungible tokens. The ownership functions defined in the standard are as follows:
• ownerOf(): The function keeps track of the token owner’s address. This way the NFT is continually mapped to the owner.
• approve(): The function permits another entity to transfer the token on the owner’s behalf. So, if you own an NFT, you can transfer it to a friend by calling this function.
• takeOwnership(): This function acts as a withdrawal function wherein an outside party can call it to take tokens out of another user’s account. When a user has been approved to own a certain amount of tokens, they can call this function to withdraw the tokens from the user’s balance.
• transfer(): This function allows the owner to send the token to another user. This function can only be executed if the receiver has already been approved to own the token by the sender.
• tokenOfOwnerByIndex(): Think of this function as a database that keeps track of all the NFT tokens owned by the user.
As defined by ERC-721, the functions explained above get triggered when one of these two events occurs – Ownership Transfer and Transfer Approval.
### Event #1: Ownership Transfer
This event gets fired every time a token’s ownership changes hands. During this transfer of ownership, the functions detail the following data –
• The account that sent the token
• The account that received the token
• The token ID that was transferred
### Event #2: Transfer Approval
The second event is the transfer approval, wherein a user allows another user to take ownership of a particular token.
## The Rise and Rise Of NFTs
While DeFi may be the most innovative space in crypto, NFTs have carved out a niche for themselves by appealing to the masses. Slowly and surely, “NFTs” has become the defining narrative of 2021, not just in the crypto space but also overall. ERC-721 is the token standard that has made this revolution happen.
## Alright, it's quiz time!
Before you take the quiz, make sure that:
• You have a verified CoinSmart account (to get your reward if you successfully answer all the questions).
• You use the same email in the quiz that you use to register your CoinSmart account.
ERC-721 GetSmart Quiz: Answer All The Questions And Earn An Entry To Win \$1,000 CAD of Bitcoin
|
2022-06-30 06:34:50
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.1864476352930069, "perplexity": 2208.620012120109}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103669266.42/warc/CC-MAIN-20220630062154-20220630092154-00573.warc.gz"}
|
http://content.myhometuition.com/category/pt3-maths/statistics-ii/
|
# 4.2.2 Statistics (II), PT3 Focus Practice
4.2.2 Statistics (II), PT3 Focus Practice
Question 6:
Diagram below is a pie chart which shows the proportion of money allocated to five clubs.
The total amount of money allocated to Swimming Club and Squash Club is RM1800.
Calculate the total amount of money allocated to the five clubs.
Solution
:
Sum of the angles of the sectors for Swimming Club and Squash Club
= 360o – 65o – 85o – 90o
= 120o
Total amount of money allocated to the five clubs
$\begin{array}{l}=\frac{{360}^{o}}{{120}^{o}}×RM1800\\ =RM5400\end{array}$
Question 7:
Table below shows the number of students who watch four different TV channels in a week.
TV Channels Number of Students News 8 Sports 15 Movies 25 Music 12
The information for sports channel is shown fully in the pie chart in the answer space.
Complete the pie chart to represent all the information in the Table.
:
Solution:
Total number of students
= 8 + 15 + 25 + 12 = 60
$\begin{array}{l}\text{News channel}\\ =\frac{8}{60}×{360}^{o}={48}^{o}\\ \\ \text{Movies channel}\\ =\frac{25}{60}×{360}^{o}={150}^{o}\\ \\ \text{Music channel}\\ =\frac{12}{60}×{360}^{o}={72}^{o}\end{array}$
Question 8:
Diagram below is a pie chart showing the number of mangosteens eaten by 4 boys.
Calculate
(a) the mean number of mangosteens eaten by a boy,
(b) the angle of the sector representing Kenny.
Solution
:
(a)
$\begin{array}{l}\text{Mean}\\ =\frac{10+20+18+12}{4}\\ =\frac{60}{4}\\ =15\end{array}$
(b)
$\begin{array}{l}\text{Angle of the sector representing Kenny}\\ =\frac{18}{60}×{360}^{o}\\ ={108}^{o}\end{array}$
# 4.2.1 Statistics II, PT3 Focus Practice
4.2.1 Statistics II, PT3 Focus Practice
Question 1:
Given that the mode of the set of data 7, 5, 3, 2, 3, y, 7, 6 and 5 is 7, find the mean.
Solution:
If the mode is 7, then y = 7
$\begin{array}{l}\therefore \text{Mean}=\frac{7+5+3+2+3+7+7+6+5}{9}\\ \text{}=\frac{45}{9}\\ \text{}=5\end{array}$
Question 2:
The mean of the set of numbers 7, 2, x, 4, 5, 3, y is 5. The value of x + y is
Solution:
$\begin{array}{l}\text{Mean =}\frac{\text{sum of all values of data}}{\text{total number of data}}\\ \\ \frac{7+2+x+4+5+3+y}{7}=5\\ \therefore x+y+21=7×5\\ \text{}x+y=35-21\\ \text{}x+y=14\end{array}$
Question 3:
Table below shows the number of story books read by a group of pupils in a week.
Number of books 1 2 3 4 5 Number of pupils 3 0 1 5 6
The median of the data is
Solution:
Number of books 1 2 3 4 5 Number of pupils 3 0 1 5 6 Position 1 - 3 3 4 5 - 9 10 - 15
Number of pupils = 3 + 0 + 1 + 5 + 6 = 15
Middle position situated at 8th.
From the table, the position 8 has a value of 4, therefore the median of the data is 4.
Question 4:
Table below shows the scores for a group of pupils in a sport game.
Score 1 2 3 4 5 Number of pupils 4 11 5 3 2
Calculate the percentage number of pupils who obtain scores more than the mode score.
Solution:
Mode score = 2
Number of pupils who obtain scores more than 2
= 5 + 3 + 2
= 10
Total number of pupils
= 4 + 11 + 5 + 3 + 2
= 25
Percentage number of pupils who obtain scores more than the mode score
$\begin{array}{l}=\frac{10}{25}×100%\\ =40%\end{array}$
Question 5:
The mean age of Alex, Michelle and their three children is 34 years. The mean age of their three children is 20 years.
Calculate the mean age of Alex and Michelle.
Solution:
Total age = 34 × 5 = 170 years
Total age of their three children
= 20 × 3
= 60 years
Total age of Alex and Michelle
= 170 – 60
= 110 years
Mean age of Alex and Michelle
$\begin{array}{l}=\frac{110}{2}\\ =55\text{years}\end{array}$
# 4.1 Statistics II
4.1 Statistics II
4.1.1 Pie Charts
1. A pie chart is a graphic representation of data using sectors of a circle. The size of each sector shows the percentage of each category of data it represents.
Example:
2. The percentage of data represented by each sector can be calculated by using the formula below.
$\text{Percentage of data}=\frac{\text{angle of sector}}{{360}^{o}}×100%$
3. To construct a pie chart, the angle of each sector can be calculated by using the formulae below.
$\text{Angle of sector}=\frac{\text{data of each category}}{\text{overall data}}×{360}^{o}$
4. Data can also be represented by pictograms, bar charts and line graphs.
5. The choice of any these representations depends very much on the suitability of the data and the aim we wish to achieve in representing the data.
4.1.2 Mode, Median and Mean
1. The mode of a set of data is the value of item which occurs most frequently.
Example:
3, 7, 6, 9, 7, 1, 5, 7, 2
Mode = 7
2. When a set of data is given in a frequency table, the value or item which has the highest frequency is the mode.
3. The median of a set of data is the value located in the middle of the set when the data is arranged in numerical order.
- If the total number of data is odd, then the median is the value in the middle of the set.
- If the total number of data is even, then the median is the average of the two middle values of the set
Example 1:
Find the medians of the following sets of data:
(a) 10, 9, 11, 6, 5, 8, 7
(b) 10, 9, 11, 6, 5, 8, 7,12
Solution:
(a) Number of data values = 7 ← (Odd number)
Rearranging the data in order of magnitude:
5, 6, 7, 8, 9, 10, 11
Therefore, median = 8
(b) Number of data values = 8 ← (Even number)
Rearranging the data in order of magnitude:
5, 6, 7, 8, 9, 10, 11, 12
$\begin{array}{l}\therefore \text{Median}=\frac{8+9}{2}\\ \text{}=8.5\end{array}$
4. When a set of data is given in a frequency table, the value situated in the middle position of the data is the median.
5. The mean of a set of data is obtained by using formula below.
$\text{Mean =}\frac{\text{sum of all values of data}}{\text{total number of data}}$
Example:
Find the mean of the following sets of data items:
-5, -2, -1, 7, 4, 9
Solution:
$\begin{array}{l}\text{Mean}=\frac{\left(-5\right)+\left(-2\right)+\left(-1\right)+7+4+9}{6}\\ \text{}=\frac{12}{6}\\ \text{}=2\end{array}$
6. When data is given in a frequency table, the mean can be found by using the formula below.
$\text{Mean =}\frac{\text{sum of}\left(\text{value}×\text{frequency}\right)}{\text{total frequency}}$
Example:
The table below shows the scores obtained by a group of players in a game.
Score 1 2 3 4 5 Frequency 5 12 8 15 10
Find the mean of the scores.
Solution:
$\begin{array}{l}\text{Mean}\\ =\text{}\frac{\text{sum of}\left(\text{score}×\text{frequency}\right)}{\text{total frequency}}\\ =\frac{\left(1×5\right)+\left(2×12\right)+\left(3×8\right)+\left(4×15\right)+\left(5×10\right)}{5+12+8+15+10}\\ =\frac{163}{50}\\ =3.26\end{array}$
|
2020-09-24 08:46:18
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 15, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4837418496608734, "perplexity": 868.77941052901}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-40/segments/1600400214347.17/warc/CC-MAIN-20200924065412-20200924095412-00487.warc.gz"}
|
https://quantumfrontiers.com/category/experimental-highlights/page/2/
|
# Gently yoking yin to yang
The architecture at the University of California, Berkeley mystified me. California Hall evokes a Spanish mission. The main library consists of white stone pillared by ionic columns. A sea-green building scintillates in the sunlight like a scarab. The buildings straddle the map of styles.
So do Berkeley’s quantum scientists, information-theory users, and statistical mechanics.
The chemists rove from abstract quantum information (QI) theory to experiments. Physicists experiment with superconducting qubits, trapped ions, and numerical simulations. Computer scientists invent algorithms for quantum computers to perform.
Few activities light me up more than bouncing from quantum group to info-theory group to stat-mech group, hunting commonalities. I was honored to bounce from group to group at Berkeley this September.
What a trampoline Berkeley has.
The groups fan out across campus and science, but I found compatibility. Including a collaboration that illuminated quantum incompatibility.
Quantum incompatibility originated in studies by Werner Heisenberg. He and colleagues cofounded quantum mechanics during the early 20th century. Measuring one property of a quantum system, Heisenberg intuited, can affect another property.
The most famous example involves position and momentum. Say that I hand you an electron. The electron occupies some quantum state represented by $| \Psi \rangle$. Suppose that you measure the electron’s position. The measurement outputs one of many possible values $x$ (unless $| \Psi \rangle$ has an unusual form, the form a Dirac delta function).
But we can’t say that the electron occupies any particular point $x = x_0$ in space. Measurement devices have limited precision. You can measure the position only to within some error $\varepsilon$: $x = x_0 \pm \varepsilon$.
Suppose that, immediately afterward, you measure the electron’s momentum. This measurement, too, outputs one of many possible values. What probability $q(p) dp$ does the measurement have of outputting some value $p$? We can calculate $q(p) dp$, knowing the mathematical form of $| \Psi \rangle$ and knowing the values of $x_0$ and $\varepsilon$.
$q(p)$ is a probability density, which you can think of as a set of probabilities. The density can vary with $p$. Suppose that $q(p)$ varies little: The probabilities spread evenly across the possible $p$ values. You have no idea which value your momentum measurement will output. Suppose, instead, that $q(p)$ peaks sharply at some value $p = p_0$. You can likely predict the momentum measurement’s outcome.
The certainty about the momentum measurement trades off with the precision $\varepsilon$ of the position measurement. The smaller the $\varepsilon$ (the more precisely you measured the position), the greater the momentum’s unpredictability. We call position and momentum complementary, or incompatible.
You can’t measure incompatible properties, with high precision, simultaneously. Imagine trying to do so. Upon measuring the momentum, you ascribe a tiny range of momentum values $p$ to the electron. If you measured the momentum again, an instant later, you could likely predict that measurement’s outcome: The second measurement’s $q(p)$ would peak sharply (encode high predictability). But, in the first instant, you measure also the position. Hence, by the discussion above, $q(p)$ would spread out widely. But we just concluded that $q(p)$ would peak sharply. This contradiction illustrates that you can’t measure position and momentum, precisely, at the same time.
But you can simultaneously measure incompatible properties weakly. A weak measurement has an enormous $\varepsilon$. A weak position measurement barely spreads out $q(p)$. If you want more details, ask a Quantum Frontiers regular; I’ve been harping on weak measurements for months.
Blame Berkeley for my harping this month. Irfan Siddiqi’s and Birgitta Whaley’s groups collaborated on weak measurements of incompatible observables. They tracked how the measured quantum state $| \Psi (t) \rangle$ evolved in time (represented by $t$).
Irfan’s group manipulates superconducting qubits.1 The qubits sit in the physics building, a white-stone specimen stamped with an egg-and-dart motif. Across the street sit chemists, including members of Birgitta’s group. The experimental physicists and theoretical chemists teamed up to study a quantum lack of teaming up.
The experiment involved one superconducting qubit. The qubit has properties analogous to position and momentum: A ball, called the Bloch ball, represents the set of states that the qubit can occupy. Imagine an arrow pointing from the sphere’s center to any point in the ball. This Bloch vector represents the qubit’s state. Consider an arrow that points upward from the center to the surface. This arrow represents the qubit state $| 0 \rangle$. $| 0 \rangle$ is the quantum analog of the possible value 0 of a bit, or unit of information. The analogous downward-pointing arrow represents the qubit state $| 1 \rangle$, analogous to 1.
Infinitely many axes intersect the sphere. Different axes represent different observables that Irfan’s group can measure. Nonparallel axes represent incompatible observables. For example, the $x$-axis represents an observable $\sigma_x$ analogous to position. The $y$-axis represents an observable $\sigma_y$ analogous to momentum.
Siddiqi lab, decorated with the trademark for the paper’s tug-of-war between incompatible observables. Photo credit: Leigh Martin, one of the paper’s leading authors.
Irfan’s group stuck their superconducting qubit in a cavity, or box. The cavity contained light that interacted with the qubit. The interactions transferred information from the qubit to the light: The light measured the qubit’s state. The experimentalists controlled the interactions, controlling the axes “along which” the light was measured. The experimentalists weakly measured along two axes simultaneously.
Suppose that the axes coincided—say, at the $x$-axis $\hat{x}$. The qubit would collapse to the state $| \Psi \rangle = \frac{1}{ \sqrt{2} } ( | 0 \rangle + | 1 \rangle )$, represented by the arrow that points along $\hat{x}$ to the sphere’s surface, or to the state $| \Psi \rangle = \frac{1}{ \sqrt{2} } ( | 0 \rangle - | 1 \rangle )$, represented by the opposite arrow.
(Projection of) the Bloch Ball after the measurement. The system can access the colored points. The lighter a point, the greater the late-time state’s weight on the point.
Let $\hat{x}'$ denote an axis near $\hat{x}$—say, 18° away. Suppose that the group weakly measured along $\hat{x}$ and $\hat{x}'$. The state would partially collapse. The system would access points in the region straddled by $\hat{x}$ and $\hat{x}'$, as well as points straddled by $- \hat{x}$ and $- \hat{x}'$.
Finally, suppose that the group weakly measured along $\hat{x}$ and $\hat{y}$. These axes stand in for position and momentum. The state would, loosely speaking, swirl around the Bloch ball.
The Berkeley experiment illuminates foundations of quantum theory. Incompatible observables, physics students learn, can’t be measured simultaneously. This experiment blasts our expectations, using weak measurements. But the experiment doesn’t just destroy. It rebuilds the blast zone, by showing how $| \Psi (t) \rangle$ evolves.
“Position” and “momentum” can hang together. So can experimentalists and theorists, physicists and chemists. So, somehow, can the California mission and the ionic columns. Maybe I’ll understand the scarab building when we understand quantum theory.2
With thanks to Birgitta’s group, Irfan’s group, and the rest of Berkeley’s quantum/stat-mech/info-theory community for its hospitality. The Bloch-sphere figures come from http://www.nature.com/articles/nature19762.
1The qubit is the quantum analog of a bit. The bit is the basic unit of information. A bit can be in one of two possible states, which we can label as 0 and 1. Qubits can manifest in many physical systems, including superconducting circuits. Such circuits are tiny quantum circuits through which current can flow, without resistance, forever.
2Soda Hall dazzled but startled me.
# Standing back at Stanford
This T-shirt came to mind last September. I was standing in front of a large silver-colored table littered with wires, cylinders, and tubes. Greg Bentsen was pointing at components and explaining their functions. He works in Monika Schleier-Smith’s lab, as a PhD student, at Stanford.
Monika’s group manipulates rubidium atoms. A few thousand atoms sit in one of the cylinders. That cylinder contains another cylinder, an optical cavity, that contains the atoms. A mirror caps each of the cavity’s ends. Light in the cavity bounces off the mirrors.
Light bounces off your bathroom mirror similarly. But we can describe your bathroom’s light accurately with Maxwellian electrodynamics, a theory developed during the 1800s. We describe the cavity’s light with quantum electrodynamics (QED). Hence we call the lab’s set-up cavity QED.
The light interacts with the atoms, entangling with them. The entanglement imprints information about the atoms on the light. Suppose that light escaped from the cavity. Greg and friends could measure the light, then infer about the atoms’ quantum state.
A little light leaks through the mirrors, though most light bounces off. From leaked light, you can infer about the ensemble of atoms. You can’t infer about individual atoms. For example, consider an atom’s electrons. Each electron has a quantum property called a spin. We sometimes imagine the spin as an arrow that points upward or downward. Together, the electrons’ spins form the atom’s joint spin. You can tell, from leaked light, whether one atom’s spin points upward. But you can’t tell which atom’s spin points upward. You can’t see the atoms for the ensemble.
Monika’s team can. They’ve cut a hole in their cylinder. Light escapes the cavity through the hole. The light from the hole’s left-hand edge carries information about the leftmost atom, and so on. The team develops a photograph of the line of atoms. Imagine holding a photograph of a line of people. You can point to one person, and say, “Aha! She’s the xkcd fan.” Similarly, Greg and friends can point to one atom in their photograph and say, “Aha! That atom has an upward-pointing spin.” Monika’s team is developing single-site imaging.
Aha! She’s the xkcd fan.
Monika’s team plans to image atoms in such detail, they won’t need for light to leak through the mirrors. Light leakage creates problems, including by entangling the atoms with the world outside the cavity. Suppose you had to diminish the amount of light that leaks from a rubidium cavity. How should you proceed?
Tell the mirrors,
You should lengthen the cavity. Why? Imagine a photon, a particle of light, in the cavity. It zooms down the cavity’s length, hits a mirror, bounces off, retreats up the cavity’s length, hits the other mirror, and bounces off. The photon repeats this process until a mirror hit fails to generate a bounce. The mirror transmits the photon to the exterior; the photon leaks out. How can you reduce leaks? By preventing photons from hitting mirrors so often, by forcing the photons to zoom longer, by lengthening the cavity, by shifting the mirrors outward.
So Greg hinted, beside that silver-colored table in Monika’s lab. The hint struck a chord: I recognized the impulse to
The impulse had led me to Stanford.
Weeks earlier, I’d written my first paper about quantum chaos and information scrambling. I’d sat and read and calculated and read and sat and emailed and written. I needed to stand up, leave my cavity, and image my work from other perspectives.
Stanford physicists had written quantum-chaos papers I admired. So I visited, presented about my work, and talked. Patrick Hayden introduced me to a result that might help me apply my result to another problem. His group helped me simplify a mathematical expression. Monika reflected that a measurement scheme I’d proposed sounded not unreasonable for cavity QED.
And Greg led me to recognize the principle behind my visit: Sometimes, you have to
to move forward.
With gratitude to Greg, Monika, Patrick, and the rest of Monika’s and Patrick’s groups for their time, consideration, explanations, and feedback. With thanks to Patrick and Stanford’s Institute for Theoretical Physics for their hospitality.
# The power of information
Sara Imari Walker studies ants. Her entomologist colleague Gabriele Valentini cultivates ant swarms. Gabriele coaxes a swarm from its nest, hides the nest, and offers two alternative nests. Gabriele observe the ants’ responses, then analyzes their data with Sara.
Sara doesn’t usually study ants. She trained in physics, information theory, and astrobiology. (Astrobiology is the study of life; life’s origins; and conditions amenable to life, on Earth and anywhere else life may exist.) Sara analyzes how information reaches, propagates through, and manifests in the swarm.
Some ants inspect one nest; some, the other. Few ants encounter both choices. Yet most of the ants choose simultaneously. (How does Gabriele know when an ant chooses? Decided ants carry other ants toward the chosen nest. Undecided ants don’t.)
Gabriele and Sara plotted each ant’s status (decided or undecided) at each instant. All the ants’ lines start in the “undecided” region, high up in the graph. Most lines drop to the “decided” region together. Physicists call such dramatic, large-scale changes in many-particle systems “phase transitions.” The swarm transitions from the “undecided” phase to the “decided,” as moisture transitions from vapor to downpour.
Sara versus the ants
Look from afar, and you’ll see evidence of a hive mind: The lines clump and slump together. Look more closely, and you’ll find lags between ants’ decisions. Gabriele and Sara grouped the ants according to their behaviors. Sara explained the grouping at a workshop this spring.
The green lines, she said, are undecided ants.
My stomach dropped like Gabriele and Sara’s ant lines.
People call data “cold” and “hard.” Critics lambast scientists for not appealing to emotions. Politicians weave anecdotes into their numbers, to convince audiences to care.
But when Sara spoke, I looked at her green lines and thought, “That’s me.”
I’ve blogged about my indecisiveness. Postdoc Ning Bao and I formulated a quantum voting scheme in which voters can superpose—form quantum combinations of—options. Usually, when John Preskill polls our research group, I abstain from voting. Politics, and questions like “Does building a quantum computer require only engineering or also science?”,1 have many facets. I want to view such questions from many angles, to pace around the questions as around a sculpture, to hear other onlookers, to test my impressions on them, and to cogitate before choosing.2 However many perspectives I’ve gathered, I’m missing others worth seeing. I commiserated with the green-line ants.
I first met Sara in the building behind the statue. Sara earned her PhD in Dartmouth College’s physics department, with Professor Marcelo Gleiser.
Sara presented about ants at a workshop hosted by the Beyond Center for Fundamental Concepts in Science at Arizona State University (ASU). The organizers, Paul Davies of Beyond and Andrew Briggs of Oxford, entitled the workshop “The Power of Information.” Participants represented information theory, thermodynamics and statistical mechanics, biology, and philosophy.
Paul and Andrew posed questions to guide us: What status does information have? Is information “a real thing” “out there in the world”? Or is information only a mental construct? What roles can information play in causation?
We paced around these questions as around a Chinese viewing stone. We sat on a bench in front of those questions, stared, debated, and cogitated. We taught each other about ants, artificial atoms, nanoscale machines, and models for information processing.
Chinese viewing stone in Yuyuan Garden in Shanghai
I wonder if I’ll acquire opinions about Paul and Andrew’s questions. Maybe I’ll meander from “undecided” to “decided” over a career. Maybe I’ll phase-transition like Sara’s ants. Maybe I’ll remain near the top of her diagram, a green holdout.
I know little about information’s power. But Sara’s plot revealed one power of information: Information can move us—from homeless to belonging, from ambivalent to decided, from a plot’s top to its bottom, from passive listener to finding yourself in a green curve.
With thanks to Sara Imari Walker, Paul Davies, Andrew Briggs, Katherine Smith, and the Beyond Center for their hospitality and thoughts.
1By “only engineering,” I mean not “merely engineering” pejoratively, but “engineering and no other discipline.”
2I feel compelled to perform these activities before choosing. I try to. Psychological experiments, however, suggest that I might decide before realizing that I’ve decided.
# Glass beads and weak-measurement schemes
Richard Feynman fiddled with electronics in a home laboratory, growing up. I fiddled with arts and crafts.1 I glued popsicle sticks, painted plaques, braided yarn, and designed greeting cards. Of the supplies in my family’s crafts box, I adored the beads most. Of the beads, I favored the glass ones.
I would pour them on the carpet, some weekend afternoons. I’d inherited a hodgepodge: The beads’ sizes, colors, shapes, trimmings, and craftsmanship varied. No property divided the beads into families whose members looked like they belonged together. But divide the beads I tried. I might classify them by color, then subdivide classes by shape. The color and shape groupings precluded me from grouping by size. But, by loosening my original classification and combining members from two classes, I might incorporate trimmings into the categorization. I’d push my classification scheme as far as I could. Then, I’d rake the beads together and reorganize them according to different principles.
Why have I pursued theoretical physics? many people ask. I have many answers. They include “Because I adored organizing craft supplies at age eight.” I craft and organize ideas.
I’ve blogged about the out-of-time-ordered correlator (OTOC), a signature of how quantum information spreads throughout a many-particle system. Experimentalists want to measure the OTOC, to learn how information spreads. But measuring the OTOC requires tight control over many quantum particles.
I proposed a scheme for measuring the OTOC, with help from Chapman University physicist Justin Dressel. The scheme involves weak measurements. Weak measurements barely disturb the systems measured. (Most measurements of quantum systems disturb the measured systems. So intuited Werner Heisenberg when formulating his uncertainty principle.)
I had little hope for the weak-measurement scheme’s practicality. Consider the stereotypical experimentalist’s response to a stereotypical experimental proposal by a theorist: Oh, sure, we can implement that—in thirty years. Maybe. If the pace of technological development doubles. I expected to file the weak-measurement proposal in the “unfeasible” category.
But experimentalists started collaring me. The scheme sounds reasonable, they said. How many trials would one have to perform? Did the proposal require ancillas, helper systems used to control the measured system? Must each ancilla influence the whole measured system, or could an ancilla interact with just one particle? How did this proposal compare with alternatives?
I met with a cavity-QED2 experimentalist and a cold-atoms expert. I talked with postdocs over skype, with heads of labs at Caltech, with grad students in Taiwan, and with John Preskill in his office. I questioned an NMR3 experimentalist over lunch and fielded superconducting-qubit4 questions in the sunshine. I read papers, reread papers, and powwowed with Justin.
I wouldn’t have managed half so well without Justin and without Brian Swingle. Brian and coauthors proposed the first OTOC-measurement scheme. He reached out after finding my first OTOC paper.
According to that paper, the OTOC is a moment of a quasiprobability.5 How does that quasiprobability look, we wondered? How does it behave? What properties does it have? Our answers appear in a paper we released with Justin this month. We calculate the quasiprobability in two examples, prove properties of the quasiprobability, and argue that the OTOC motivates generalizations of quasiprobability theory. We also enhance the weak-measurement scheme and analyze it.
Amidst that analysis, in a 10 x 6 table, we classify glass beads.
We inventoried our experimental conversations and distilled them. We culled measurement-scheme features analogous to bead size, color, and shape. Each property labels a row in the table. Each measurement scheme labels a column. Each scheme has, I learned, gold flecks and dents, hues and mottling, an angle at which it catches the light.
I’ve kept most of the glass beads that fascinated me at age eight. Some of the beads have dispersed to necklaces, picture frames, and eyeglass leashes. I moved the remnants, a few years ago, to a compartmentalized box. Doesn’t it resemble the table?
That’s why I work at the IQIM.
1I fiddled in a home laboratory, too, in a garage. But I lived across the street from that garage. I lived two rooms from an arts-and-crafts box.
2Cavity QED consists of light interacting with atoms in a box.
3Lots of nuclei manipulated with magnetic fields. “NMR” stands for “nuclear magnetic resonance.” MRI machines, used to scan brains, rely on NMR.
4Superconducting circuits are tiny, cold quantum circuits.
5A quasiprobability resembles a probability but behaves more oddly: Probabilities range between zero and one; quasiprobabilities can dip below zero. Think of a moment as like an average.
With thanks to all who questioned me; to all who answered questions of mine; to my wonderful coauthors; and to my parents, who stocked the crafts box.
# The weak shall inherit the quasiprobability.
Justin Dressel’s office could understudy for the archetype of a physicist’s office. A long, rectangular table resembles a lab bench. Atop the table perches a tesla coil. A larger tesla coil perches on Justin’s desk. Rubik’s cubes and other puzzles surround a computer and papers. In front of the desk hangs a whiteboard.
A puzzle filled the whiteboard in August. Justin had written a model for a measurement of a quasiprobability. I introduced quasiprobabilities here last Halloween. Quasiprobabilities are to probabilities as ebooks are to books: Ebooks resemble books but can respond to touchscreen interactions through sounds and animation. Quasiprobabilities resemble probabilities but behave in ways that probabilities don’t.
A tesla coil of Justin Dressel’s
Let $p$ denote the probability that any given physicist keeps a tesla coil in his or her office. $p$ ranges between zero and one. Quasiprobabilities can dip below zero. They can assume nonreal values, dependent on the imaginary number $i = \sqrt{-1}$. Probabilities describe nonquantum phenomena, like tesla-coil collectors,1 and quantum phenomena, like photons. Quasiprobabilities appear nonclassical.2,3
We can infer the tesla-coil probability by observing many physicists’ offices:
$\text{Prob(any given physicist keeps a tesla coil in his/her office)} = \frac{ \text{\# physicists who keep tesla coils in their offices} }{ \text{\# physicists} } \, .$ We can infer quasiprobabilities from weak measurements, Justin explained. You can measure the number of tesla coils in an office by shining light on the office, correlating the light’s state with the tesla-coil number, and capturing the light on photographic paper. The correlation needn’t affect the tesla coils. Observing a quantum state changes the state, by the Uncertainty Principle heralded by Heisenberg.
We could observe a quantum system weakly. We’d correlate our measurement device (the analogue of light) with the quantum state (the analogue of the tesla-coil number) unreliably. Imagining shining a dull light on an office for a brief duration. Shadows would obscure our photo. We’d have trouble inferring the number of tesla coils. But the dull, brief light burst would affect the office less than a strong, long burst would.
Justin explained how to infer a quasiprobability from weak measurements. He’d explained on account of an action that others might regard as weak: I’d asked for help.
Chaos had seized my attention a few weeks earlier. Chaos is a branch of math and physics that involves phenomena we can’t predict, like weather. I had forayed into quantum chaos for reasons I’ll explain in later posts. I was studying a function $F(t)$ that can flag chaos in cold atoms, black holes, and superconductors.
I’d derived a theorem about $F(t)$. The theorem involved a UFO of a mathematical object: a probability amplitude that resembled a probability but could assume nonreal values. I presented the theorem to my research group, which was kind enough to provide feedback.
“Is this amplitude physical?” John Preskill asked. “Can you measure it?”
“I don’t know,” I admitted. “I can tell a story about what it signifies.”
“If you could measure it,” he said, “I might be more excited.”
You needn’t study chaos to predict that private clouds drizzled on me that evening. I was grateful to receive feedback from thinkers I respected, to learn of a weakness in my argument. Still, scientific works are creative works. Creative works carry fragments of their creators. A weakness in my argument felt like a weakness in me. So I took the step that some might regard as weak—by seeking help.
Some problems, one should solve alone. If you wake me at 3 AM and demand that I solve the Schrödinger equation that governs a particle in a box, I should be able to comply (if you comply with my demand for justification for the need to solve the Schrödinger equation at 3 AM).One should struggle far into problems before seeking help.
Some scientists extend this principle into a ban on assistance. Some students avoid asking questions for fear of revealing that they don’t understand. Some boast about passing exams and finishing homework without the need to attend office hours. I call their attitude “scientific machismo.”
I’ve all but lived in office hours. I’ve interrupted lectures with questions every few minutes. I didn’t know if I could measure that probability amplitude. But I knew three people who might know. Twenty-five minutes after I emailed them, Justin replied: “The short answer is yes!”
I visited Justin the following week, at Chapman University’s Institute for Quantum Studies. I sat at his bench-like table, eyeing the nearest tesla coil, as he explained. Justin had recognized my probability amplitude from studies of the Kirkwood-Dirac quasiprobability. Experimentalists infer the Kirkwood-Dirac quasiprobability from weak measurements. We could borrow these experimentalists’ techniques, Justin showed, to measure my probability amplitude.
The borrowing grew into a measurement protocol. The theorem grew into a paper. I plunged into quasiprobabilities and weak measurements, following Justin’s advice. John grew more excited.
The meek might inherit the Earth. But the weak shall measure the quasiprobability.
With gratitude to Justin for sharing his expertise and time; and to Justin, Matt Leifer, and Chapman University’s Institute for Quantum Studies for their hospitality.
Chapman’s community was gracious enough to tolerate a seminar from me about thermal states of quantum systems. You can watch the seminar here.
1Tesla-coil collectors consists of atoms described by quantum theory. But we can describe tesla-coil collectors without quantum theory.
2Readers foreign to quantum theory can interpret “nonclassical” roughly as “quantum.”
3Debate has raged about whether quasiprobabilities govern classical phenomena.
4I should be able also to recite the solutions from memory.
# Happy Halloween from…the discrete Wigner function?
Do you hope to feel a breath of cold air on the back of your neck this Halloween? I’ve felt one literally: I earned my Masters in the icebox called “Ontario,” at the Perimeter Institute for Theoretical Physics. Perimeter’s colloquia1 take place in an auditorium blacker than a Quentin Tarantino film. Aephraim Steinberg presented a colloquium one air-conditioned May.
Steinberg experiments on ultracold atoms and quantum optics2 at the University of Toronto. He introduced an idea that reminds me of biting into an apple whose coating you’d thought consisted of caramel, then tasting blood: a negative (quasi)probability.
Probabilities usually range from zero upward. Consider Shirley Jackson’s short story The Lottery. Villagers in a 20th-century American village prepare slips of paper. The number of slips equals the number of families in the village. One slip bears a black spot. Each family receives a slip. Each family has a probability $p > 0$ of receiving the marked slip. What happens to the family that receives the black spot? Read Jackson’s story—if you can stomach more than a Tarantino film.
Jackson peeled off skin to reveal the offal of human nature. Steinberg’s experiments reveal the offal of Nature. I’d expect humaneness of Jackson’s villagers and nonnegativity of probabilities. But what looks like a probability and smells like a probability might be hiding its odor with Special-Edition Autumn-Harvest Febreeze.
A quantum state resembles a set of classical3 probabilities. Consider a classical system that has too many components for us to track them all. Consider, for example, the cold breath on the back of your neck. The breath consists of air molecules at some temperature $T$. Suppose we measured the molecules’ positions and momenta. We’d have some probability $p_1$ of finding this particle here with this momentum, that particle there with that momentum, and so on. We’d have a probability $p_2$ of finding this particle there with that momentum, that particle here with this momentum, and so on. These probabilities form the air’s state.
We can tell a similar story about a quantum system. Consider the quantum light prepared in a Toronto lab. The light has properties analogous to position and momentum. We can represent the light’s state with a mathematical object similar to the air’s probability density.4 But this probability-like object can sink below zero. We call the object a quasiprobability, denoted by $\mu$.
If a $\mu$ sinks below zero, the quantum state it represents encodes entanglement. Entanglement is a correlation stronger than any achievable with nonquantum systems. Quantum information scientists use entanglement to teleport information, encrypt messages, and probe the nature of space-time. I usually avoid this cliché, but since Halloween is approaching: Einstein called entanglement “spooky action at a distance.”
Eugene Wigner and others defined quasiprobabilities shortly before Shirley Jackson wrote The Lottery. Quantum opticians use these $\mu$’s, because quantum optics and quasiprobabilities involve continuous variables. Examples of continuous variables include position: An air molecule can sit at this point (e.g., $x = 0$) or at that point (e.g., $x = 1$) or anywhere between the two (e.g., $x = 0.001$). The possible positions form a continuous set. Continuous variables model quantum optics as they model air molecules’ positions.
Information scientists use continuous variables less than we use discrete variables. A discrete variable assumes one of just a few possible values, such as $0$ or $1$, or trick or treat.
How a quantum-information theorist views Halloween.
Quantum-information scientists study discrete systems, such as electron spins. Can we represent discrete quantum systems with quasiprobabilities $\mu$ as we represent continuous quantum systems? You bet your barmbrack.
Bill Wootters and others have designed quasiprobabilities for discrete systems. Wootters stipulated that his $\mu$ have certain properties. The properties appear in this review. Most physicists label properties “1,” “2,” etc. or “Prop. 1,” “Prop. 2,” etc. The Wootters properties in this review have labels suited to Halloween.
Seeing (quasi)probabilities sink below zero feels like biting into an apple that you think has a caramel coating, then tasting blood. Did you eat caramel apples around age six? Caramel apples dislodge baby teeth. When baby teeth fall out, so does blood. Tasting blood can mark growth—as does the squeamishness induced by a colloquium that spooks a student. Who needs haunted mansions when you have negative quasiprobabilities?
For nonexperts:
1Weekly research presentations attended by a department.
2Light.
3Nonquantum (basically).
4Think “set of probabilities.”
# What matters to me, and why?
Students at my college asked every Tuesday. They gathered in a white, windowed room near the center of campus. “We serve,” read advertisements, “soup, bread, and food for thought.” One professor or visitor would discuss human rights, family, religion, or another pepper in the chili of life.
I joined occasionally. I listened by the window, in the circle of chairs that ringed the speaker. Then I ventured from college into physics.
The questions “What matters to you, and why?” have chased me through physics. I ask experimentalists and theorists, professors and students: Why do you do science? Which papers catch your eye? Why have you devoted to quantum information more years than many spouses devote to marriages?
One physicist answered with another question. Chris Jarzynski works as a professor at the University of Maryland. He studies statistical mechanics—how particles typically act and how often particles act atypically; how materials shine, how gases push back when we compress them, and more.
“How,” Chris asked, “should we quantify precision?”
Chris had in mind nonequilibrium fluctuation theoremsOut-of-equilibrium systems have large-scale properties, like temperature, that change significantly.1 Examples include white-bean soup cooling at a “What matters” lunch. The soup’s temperature drops to room temperature as the system approaches equilibrium.
Nonequilibrium. Tasty, tasty nonequilibrium.
Some out-of-equilibrium systems obey fluctuation theorems. Fluctuation theorems are equations derived in statistical mechanics. Imagine a DNA molecule floating in a watery solution. Water molecules buffet the strand, which twitches. But the strand’s shape doesn’t change much. The DNA is in equilibrium.
You can grab the strand’s ends and stretch them apart. The strand will leave equilibrium as its length changes. Imagine pulling the strand to some predetermined length. You’ll have exerted energy.
How much? The amount will vary if you repeat the experiment. Why? This trial began with the DNA curled this way; that trial began with the DNA curled that way. During this trial, the water batters the molecule more; during that trial, less. These discrepancies block us from predicting how much energy you’ll exert. But suppose you pick a number W. We can form predictions about the probability that you’ll have to exert an amount W of energy.
How do we predict? Using nonequilibrium fluctuation theorems.
Fluctuation theorems matter to me, as Quantum Frontiers regulars know. Why? Because I’ve written enough fluctuation-theorem articles to test even a statistical mechanic’s patience. More seriously, why do fluctuation theorems matter to me?
Fluctuation theorems fill a gap in the theory of statistical mechanics. Fluctuation theorems relate nonequilibrium processes (like the cooling of soup) to equilibrium systems (like room-temperature soup). Physicists can model equilibrium. But we know little about nonequilibrium. Fluctuation theorems bridge from the known (equilibrium) to the unknown (nonequilibrium).
Experiments take place out of equilibrium. (Stretching a DNA molecule changes the molecule’s length.) So we can measure properties of nonequilibrium processes. We can’t directly measure properties of equilibrium processes, which we can’t perform experimentally. But we can measure an equilibrium property indirectly: We perform nonequilibrium experiments, then plug our data into fluctuation theorems.
Which equilibrium property can we infer about? A free-energy difference, denoted by ΔF. Every equilibrated system (every room-temperature soup) has a free energy F. F represents the energy that the system can exert, such as the energy available to stretch a DNA molecule. Imagine subtracting one system’s free energy, F1, from another system’s free energy, F2. The subtraction yields a free-energy difference, ΔF = F2 – F1. We can infer the value of a ΔF from experiments.
How should we evaluate those experiments? Which experiments can we trust, and which need repeating?
Those questions mattered little to me, before I met Chris Jarzynski. Bridging equilibrium with nonequilibrium mattered to me, and bridging theory with experiment. Not experimental nitty-gritty.
I deserved a dunking in white-bean soup.
Suppose you performed infinitely many trials—stretched a DNA molecule infinitely many times. In each trial, you measured the energy exerted. You processed your data, then substituted into a fluctuation theorem. You could infer the exact value of ΔF.
But we can’t perform infinitely many trials. Imprecision mars our inference about ΔF. How does the imprecision relate to the number of trials performed?2
Chris and I adopted an information-theoretic approach. We quantified precision with a parameter $\delta$. Suppose you want to estimate ΔF with some precision. How many trials should you expect to need to perform? We bounded the number $N_\delta$ of trials, using an entropy. The bound tightens an earlier estimate of Chris’s. If you perform $N_\delta$ trials, you can estimate ΔF with a percent error that we estimated. We illustrated our results by modeling a gas.
I’d never appreciated the texture and richness of precision. But richness precision has: A few decimal places distinguish Albert Einstein’s general theory of relativity from Isaac Newton’s 17th-century mechanics. Particle physicists calculate constants of nature to many decimal places. Such a calculation earned a nod on physicist Julian Schwinger’s headstone. Precision serves as the bread and soup of much physics. I’d sniffed the importance of precision, but not tasted it, until questioned by Chris Jarzynski.
The questioning continues. My college has discontinued its “What matters” series. But I ask scientist after scientist—thoughtful human being after thoughtful human being—“What matters to you, and why?” Asking, listening, reading, calculating, and self-regulating sharpen my answers those questions. My answers often squish beneath the bread knife in my cutlery drawer of criticism. Thank goodness that repeating trials can reduce our errors.
1Or large-scale properties that will change. Imagine connecting the ends of a charged battery with a wire. Charge will flow from terminal to terminal, producing a current. You can measure, every minute, how quickly charge is flowing: You can measure how much current is flowing. The current won’t change much, for a while. But the current will die off as the battery nears depletion. A large-scale property (the current) appears constant but will change. Such a capacity to change characterizes nonequilibrium steady states (NESSes). NESSes form our second example of nonequilibrium states. Many-body localization forms a third, quantum example.
2Readers might object that scientists have tools for quantifying imprecision. Why not apply those tools? Because ΔF equals a logarithm, which is nonlinear. Other authors’ proposals appear in references 1-13 of our paper. Charlie Bennett addressed a related problem with his “acceptance ratio.” (Bennett also blogged about evil on Quantum Frontiers last month.)
|
2020-01-27 04:24:24
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 74, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5173931121826172, "perplexity": 3785.9175803409776}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579251694176.67/warc/CC-MAIN-20200127020458-20200127050458-00146.warc.gz"}
|
https://www.narom.no/undervisningsressurser/sarepta/rocket-theory/telemetry/link-analysis/
|
The ultimate goal of telemetry is to transfer a perfect signal copy from A to B. Practically speaking, however, an acceptable level of information loss must be balanced against power usage, transmission speed and other limiting factors (e.g. available bandwidth and budget). This motivates a theoretical study of the connection quality between sender and receiver—i.e. ‘link analysis’—and the concept of a ‘link budget’—a systematic accounting of how signal power propagates throughout the system.
Connection quality can be evaluated by several metrics differing in refinement, generality and computational complexity. Ultimately, the goal is to determine how much power the transmitter needs and/or how sensitive the receiver apparatus needs to be in order to keep the error rate (or equivalently, the likelihood of a transmission error) sufficiently minimized. The error rate depends on the signal-to-noise ratio—the ratio between received signal power and noise power, often written S/N or SNR—which itself, aside from some complicating factors related to what is meant by a ‘signal’, depends on the received power , which can be estimated by setting up a so-called link budget (of course, the signal-to-noise ratio also depends on the total noise power , but estimating noise is outside the scope of this article).
Using physical units (see below), a simplified link budget without noise takes the form
where is the transmitted power, the product of all amplification factors and the product of all loss factors.
When setting up a link budget, we are only interested in what happens after the signal exits the last electrical amplifier in the transmitter and before it enters the first electrical amplifier in the receiver. Hence, assuming that the transmitting antenna is passive, the total radiated power is at best (i.e. when assuming no loss in the antenna) given by
where is the line loss between the transmitter terminals and the antenna.
If we assume the transmitter antenna is isotropic—i.e. that it radiates equally in all directions (see figure 2)—and that the radiative medium can be treated as a vacuum, the received power becomes
where is the effective area of the receiving antenna, is the distance between the two antennas and is the line loss between the antenna and the receiver. If the receiving antenna is lossless and isotropic, it can be shown that its effective area is
where is the wavelength of the received electromagnetic radiation.
Together, the three last equations gives an expression for the received power under the assumption of lossless isotropic antennas in a vacuum. Accounting for anisotropy and antenna losses is done simply by multiplying by the antenna gains, as the gain of an antenna is defined by the power ratio between the actual, lossy anisotropic antenna and an ideal, lossless isotropic antenna. The effects of the environment and other mismatches between the antennas can be modeled as a product of loss factors . Hence, we finally obtain the transmission equation
where we introduced the so-called free-space path loss , which, for an electromagnetic wave with wavelength , models the path loss between two lossless isotropic antennas separated by a distance in a vacuum:
It should be noted that the frequency dependence of the ‘free-space path loss’ does not reflect how ‘easily’ electromagnetic waves propagate in a vacuum—according to our best measurements, this is completely frequency independent—but rather how much electrical power an antenna can capture from a radiative field.
### Other losses
Apart from the effects mentioned above, real-world telemetry systems are subject to several additional sources of signal attenuation and degradation (this list is not exhaustive!):
• Flame attenuation: If hot enough, a fire will produce plasma through ionization of the gases in its flame. In practice, this leads to a highly variable attenuation when the signal passes through fire, be it from the exhaust of a rocket engine or a bush fire in Australia. This effect is most pronounced when a vehicle travels fast enough to develop a plasma envelope—say, during re-entry—and has been researched by NASA since the 50s (see figure 3).
• Rain fade: Frequency dependent scattering due to rain and precipitation in general. Might be modeled as a frequency dependent attenuation.
• Pointing loss: Loss due to imperfect antenna aim.
• Multipath propagation: Interference effects due to the signal reaching the antenna by several paths of differing lengths. Leads to comb-filtering, i.e. frequency dependent drops and boosts in signal strength.
• Polarization mismatch: Loss due to differences in polarization. Might be severe if the receiver and transmitter use orthogonal polarization states.
### A note on units
Link analysis calculations are often done in decibel, as the involved quantities typically differ by several orders of magnitude. Decibel is a relative unit of measurement, and physical quantities—like, say, transmitted power —must therefore be written as ratios of some fixed reference value before they can be expressed in decibel. It is customary to add a suffix to the decibel symbol indicating the reference value. For power measurements, two references are in common usage: 1 watt, indicated by a suffix ‘W’, and 1 milliwatt, indicated by a suffix ‘m’. Hence, a value of e.g. ’20 dBm’ is a power of about 100 mW. In a similar manner, antenna gain is sometimes given in ‘dBi’, to emphasize that the quoted decibel value is relative to a (lossless) isotropic antenna.
Generally, quantities can be converted back and forth from decibel by
where is the chosen reference value, measured in the same units as . Using this, we can easily convert the transmission equation given above into decibels:
where the free-space path loss in decibels is given by
This article is part of a pre-course program used by NAROM in Fly a Rocket! and similar programs.
|
2022-05-25 06:03:44
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8227465748786926, "perplexity": 707.2970959102312}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662580803.75/warc/CC-MAIN-20220525054507-20220525084507-00186.warc.gz"}
|
https://myassignments-help.com/2022/11/18/option-pricing-theory-dai-xie-math150/
|
# 金融代写|期权定价理论代写Option Pricing Theory代考|MATH150
## 金融代写|期权定价理论代写Option Pricing Theory代考|The No Trade Region in Continuous Time for an Infinite
The extension of the asset allocation results under proportional transaction costs to continuous time is not a trivial exercise, and rigorous proofs with useful results exist only for special cases. This is surprising in view of the fact that the frictionless case for simple diffusion asset dynamics was derived by Merton as early as 1969 and has been extended since that time to several more complex cases. The key result is that the optimal consumption and portfolio policy keeps a constant proportion of risky to riskless asset at all times, the so-called Merton line, that depends on the risk premium and volatility of the risky asset as well as the risk aversion of the investor. Needless to say, this solution is infeasible in the presence of transaction costs since it requires continuous rebalancing of the portfolio.
Constantinides (1986) was the first to formulate and solve the asset allocation problem under proportional transaction costs and simple diffusion asset dynamics in continuous time, for a trader who maximizes the discounted flow of a constant relative risk aversion (CRRA) utility function of consumption $\frac{c_t^\gamma}{\gamma}$ over an infinite horizon. Nonetheless, as he states (p. 846), “results on the existence and form of the optimal consumption and investment policy have not been derived” under his formulation. For this reason he assumed a “simple” portfolio revision policy, in which the NT zone is as in the discrete time case covered in his 1979 paper: for CRRA utility investors it is a compact cone or wedge in $(x, y)$ space, in which the investor or trader refrains from trading as long as the portfolio stays within the NT zone and restructures the portfolio propor-tions to the nearest boundary when they go outside the zone. Further, he assumed that all consumption was a constant proportion of the riskless asset $x_t$, or $c_t=\beta x_t$, and both consumption and transaction costs are charged to the riskless asset. These assumptions resulted in an elegant solution that is sketched below.
## 金融代写|期权定价理论代写Option Pricing Theory代考|What Happens When the Horizon Is Finite?
When the upper limit of integration in (3.12) is a finite horizon $T$, as it would happen when the investor is a trader acting on behalf of an institution, the PDE (3.14) acquires an extra term $V_t$ that prevents the existence of a closed-form solution. Although to our knowledge there is no exact solution for this problem, there are two approximations that have appeared in the literature. Liu and Loewenstein (2002) formulated and solved the problem of the maximization of expected CRRA utility of terminal wealth for lognormal dynamics of the risky asset return and an exponentially distributed horizon, as in the case where a single Poisson event (“death”) takes place and terminates the portfolio. They also subsequently extended their analysis for a sequence of such events, in which case the terminal time has an Erlang distribution and tends to a constant limit as the number of events increases.
This approach produced some interesting and elegant results, such as the fact that the optimal strategy is clearly horizon-dependent and may not include any holdings of the risky asset when the horizon is short and/ or the transaction cost rate is large. Unfortunately, the approximation of the solution for the fixed finite horizon by a single Poisson event is poor when the horizon is relatively short, of the order of a couple of years or so, as can be realistically expected in the case of option traders. For the Erlangdistributed horizon the numerical work consists of recursive simultaneous solutions of several PDEs; it is computationally extensive and does not converge for several realistic parameter configurations. The same is true a fortiori when the risky asset dynamics are enriched by including jump components in the diffusion. ${ }^8$
# 期权理论代考
## 金融代写|期权定价理论代写Option Pricing Theory代考|The No Trade Region in Continuous Time for an Infinite
Constantinides (1986) 是第一个制定和解决连续时间比例交易成本和简单扩散资产动态下的资产配置问题,对于最大化恒定相对风险厌恶 (CRRA) 消费效用函数的贴现流量的交易者C吨CC在无限的地平线上。尽管如此,正如他所说(第 846 页),根据他的表述,“尚未得出关于最优消费和投资政策的存在和形式的结果”。出于这个原因,他假设了一个“简单”的投资组合修正政策,其中 NT 区域与他 1979 年论文中涵盖的离散时间案例一样:对于 CRRA 公用事业投资者来说,它是一个紧凑的锥形或楔形(X,是)空间,只要投资组合留在 NT 区域内,投资者或交易者就不会进行交易,并且当他们离开该区域时,将投资组合比例重组到最近的边界。此外,他假设所有消费都是无风险资产的固定比例X吨, 或者C吨=bX吨,并且消费和交易成本都计入无风险资产。这些假设导致了一个优雅的解决方案,如下所示。
## 金融代写|期权定价理论代写Option Pricing Theory代考|What Happens When the Horizon Is Finite?
myassignments-help数学代考价格说明
1、客户需提供物理代考的网址,相关账户,以及课程名称,Textbook等相关资料~客服会根据作业数量和持续时间给您定价~使收费透明,让您清楚的知道您的钱花在什么地方。
2、数学代写一般每篇报价约为600—1000rmb,费用根据持续时间、周作业量、成绩要求有所浮动(持续时间越长约便宜、周作业量越多约贵、成绩要求越高越贵),报价后价格觉得合适,可以先付一周的款,我们帮你试做,满意后再继续,遇到Fail全额退款。
3、myassignments-help公司所有MATH作业代写服务支持付半款,全款,周付款,周付款一方面方便大家查阅自己的分数,一方面也方便大家资金周转,注意:每周固定周一时先预付下周的定金,不付定金不予继续做。物理代写一次性付清打9.5折。
Math作业代写、数学代写常见问题
myassignments-help擅长领域包含但不是全部:
|
2023-03-26 22:32:11
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7361888289451599, "perplexity": 660.3726947017079}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296946535.82/warc/CC-MAIN-20230326204136-20230326234136-00480.warc.gz"}
|
https://weisser-zwerg.dev/posts/odroid-m1/
|
# ODROID-M1: an Experience Report
ODROID-M1, Ubuntu, ARM64
## Rational
As mentioned in my article Fuel Save Alerter, I was originally thinking about deploying the application locally to a Raspberry Pi, but due to the delivery problems I decided to go with an ODROID-M1 with 8GByte RAM instead. This is my experience report.
## Parts and Costs
Here is my part list:
Vendor Part Price Currency EUR Link
Hardkernel ODROID-M1 with 8GByte RAM 90.00 USD 89.52 € https://www.hardkernel.com/shop/odroid-m1-with-8gbyte-ram
Hardkernel M1 Metal case Kit 9.00 USD 9.95 € https://www.hardkernel.com/shop/m1-metal-case-kit
Hardkernel WiFi Module 5BK 8.90 USD 8.85 € https://www.hardkernel.com/shop/wifi-module-5bk
Hardkernel 12V/2A power supply EU plug 5.50 USD 5.47 € https://www.hardkernel.com/shop/12v-2a-power-supply-eu-plug
Hardkernel Shipping 26.63 USD 6.49 €
DHL EU Tax 24.29 EUR 24.29 €
DHL Duty Tax Receiver Service 14.88 EUR 14.88 €
Amazon Crucial P2 CT250P2SSD8 SSD Intern 250 GB 30.99 EUR 30.99 € https://www.amazon.de/gp/product/B086BKGSC1
209.44 €
So in total the device cost me something like 210€. Quite a bit more than I anticipated for my original Raspberry Pi idea.
The device looks like this:
In the middle picture you can also see the WiFi Module 5BK. I find it sad that WiFi is not directly on-board.
Originally, I bought a different NVMe M.2 module Transcend 240GB SATA III TS240GMTS820S for 31.79€, but this NVMe module was not recognized by the ODROID-M1 at all. I started to read a bit about NVMe and M.2 and learned a bit about M.2 Keys. The Transcend device has a B+M key (SATA + PCIe) and the Crucial device has a M key (PCIe). I guess this has something to do with why the Transcend device was not recognized. I tried to sign-up to the ODROID forums, but the sign-up procedure does not work. I never was sent a sign-up e-mail and without that I could not log-in to the forum. I tried with two different e-mail accounts. Then I tried to find out how to contact someone at the forum via e-mail, but nothing is documented, so I simply sent an e-mail to admin@forum.odroid.com, admin@odroid.com, webmaster@forum.odroid.com, webmaster@odroid.com. None of the e-mails bounced, but I also did not get an answer up until now. So I am not sure if my mail reached the eyes of a human at all.
In the ODROID Forum I found M1 NVMe compatibility reports and via this thread I was pointed to Tested/verified compatible M.2 NVMe for the ODROID M1. Like that I selected the Crucial device.
The installation of Ubuntu on the ODROID-M1 was quite straight forward. Especially this Petitboot boot-loader was a quite pleasant surprise.
2. put it onto a USB stick (don’t create a bootable USB[1],
3. boot into the ODROID-M1, where a Petitboot boot-loader awaits you,
4. go to the shell (bottom most option)
5. and follow the instructions from SSD only usage, which basically equates to
dd if=/usr/var/petitboot/mnt/dev/sda1/ubuntu-20.04-gnome-desktop-odroidm1-20220531.img of=/dev/nvme0n1 bs=4M.
After that you can remove the USB stick and reboot. Now you should be able to boot into the arm64 Ubuntu.
## Benchmark
I like to do a byte-unixbench on the environments I use. Just download the UnixBench5.1.3.tgz and copy it onto the ODROID-M1. You will need to install a couple of packages like a build environment including a C++ compiler. But once done you can untar the package and just execute the Run command inside the package.
The running 1 parallel copy of tests version resulated in a System Benchmarks Index Score of 467.5. Just as a comparison, on the netcup VPS for 2.99 € per month I get a value of 647.3, so a factor of 1.38 better.
2022-07-22 Addendum: I’ve now run the benchmark also on one of my old Raspberry Pi 3 Model B, where the running 1 parallel copy of tests version resulated in a System Benchmarks Index Score of 256.1. Even the running 4 parallel copies of tests resulted only in 437.9.
## Summary
All in all I have mixed feelings about the device. It looks nice, consumes little power[2] and has a nice boot process with the Petitboot boot-loader. On the other hand the deivce was quite expensive, does not include WiFi on-board out-of-the-box and in my opinion has a low computing power as shown by the byte-unixbench for that price. The experience with the forums was also not ideal. I still don’t have access to the forums. I was not expecting that a NVMe M.2 would not simply work out of the box. I’ve never experienced that. This is a standard storage interface. Why do you need a Tested/verified compatible M.2 NVMe page at all? At least a warning on the main ODROID-M1 with 8GByte RAM page about this issue might have been nice.
## Footnotes
1. important: just put it as the ubuntu-20.04-gnome-desktop-odroidm1-20220531.img on the USB stick and don’t create a bootable USB stick; actually booting from USB works, too, but I guess you would wanted to have the installation on the M.2 NVMe and not on a USB stick. ↩︎
2. According to the Power consumption and heat characteristics section on the ODROID-M1 with 8GByte RAM: Without any external peripherals connected, the M1 power consumption is about 4.5Watt with a very heavy computing load. It could be as low as 1.3Watt in the idle state. ↩︎
## Feedback
Have you written a response to this? Let me know the URL via telegraph.
No mentions yet.
|
2022-09-28 06:33:50
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.22265303134918213, "perplexity": 4642.872704314757}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030335124.77/warc/CC-MAIN-20220928051515-20220928081515-00711.warc.gz"}
|
https://math.stackexchange.com/questions/2278357/rotate-a-line-around-origin-to-pass-through-a-given-point-how-to-find-the-rotat
|
# Rotate a line around origin to pass through a given point, how to find the rotate angle
A given coefficients line : $$Ax + By + C = 0$$ I wish it rotate around the origin $O(0,0)$ and pass through a given point $P(p_x, p_y)$, how to find the rotate angle? Of course the distance of point P to $O$ is greater than the distance point O to the line $Ax+By+C=0$ or it will have no solution. The result can be have two angle.
Distance of line $L_1: Ax+By+C=0$ to origin is $R=\dfrac C{\sqrt{A^2+B^2}}$.
Hence $L_1$ is tangent to the circle $C_1: x^2+y^2=R^2$.
Rotating the line such that it passes through $P(h,k)$ (say) is equivalent to finding a tangent to the same circle that passes through $P$.
The equation of any line which is a tangent to the circle $C_1$ is given by $r=\dfrac R{\cos(\theta-\beta)}\tag{1}$.
The polar coordinates for $P$ are $(r,\theta)=(\sqrt{h^2+k^2}, \arctan\frac kh)\tag{2}$
Putting $(2)$ in $(1)$ gives $$\beta=\arctan\left(\frac kh\right)-\arccos\left(\frac R{\sqrt{h^2+k^2}}\right)\tag{3}$$
Substituting $(3)$ in $(1)$ gives the equation of the rotated line passing through $P$.
• I prefer to your answer, but I can not +1 to your answer because my poor reputation, sorry. – minmeten May 13 '17 at 18:21
I'm not sure if this is going to work, but maybe it will be helpful. You need a matrix of rotation around origin for the angle $\phi$, which is $[a_{ij}]$, $a_{11}=cos\phi$, $a_{12}=-sin\phi$, $a_{21}=sin\phi$, $a_{22}=cos\phi$. Coordinates of the point on that line are $[x,\frac{C-Ax}{B}]^T$. When you multiply coordinates and matrix of rotation, for a certain x and $\phi$ you are supposed to get coordinates $[p_x, p_y]^T$.
• I am sorry but "you are supposed to" is not an answer. – Jean Marie May 12 '17 at 19:55
• @JeanMarie Well you're setting an equation and you need to solve it. "Getting it" is not something uncertain. I'm new here so I don't really know how to type in what I want. I've mentioned that this might not be the best way to do it, but it can be helpful. – blue May 12 '17 at 19:58
• @user445819 Yes, It needs trigonometric equations, maybe it's difficult to solve – minmeten May 12 '17 at 20:05
Let $d$ be the distance from the line to the origin. This is constant when you rotate the line about the origin. Let $e_\theta$ be the unit vector pointing from the origin to the closest point on the line to the origin, after it has been rotated counter-clockwise through an angle of $\theta$. Note $e_\theta$ is just $e_0$ rotated counter-clockwise through an angle of $\theta$.
When the line has been rotated so that it contains the point $P$, the equation $\vec{OP}\cdot e_\theta = d$ is satisfied. That is, the component of $\vec{OP}$ in the direction of $e_\theta$ is $d$. This amounts to solving the equation $$\begin{pmatrix}p_x \\ p_y \end{pmatrix}\cdot \left(\begin{pmatrix}\cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix}e_0\right) = d.$$ You are given the coordinates $p_x$ and $p_y$, and the constant $d$ and the vector $e_0$ can be found from the equation of the line. The rest is a trigonometry problem.
• your answer is similar to @user445819, and need more calculation about the distance from O to the line – minmeten May 12 '17 at 21:01
• The other answer doesn't even mention the distance from the origin to the line. OP mentions this, so I assume they know how to compute it. If not, they can ask and I am happy to elaborate. – kccu May 13 '17 at 1:08
From polar equation of straight line
$$x \cos \beta + y \sin \beta =p \tag1$$
and corresponding form
$\dfrac{Ax+By+C}{{\sqrt{A^2+B^2}}} =0$ the pedal distance is $p=\dfrac {-C}{\sqrt{A^2+B^2}}\tag2$
Distance to origin $\sqrt{x_p^2+ y_p^2}, p$ are invariant in rotation. It acts just like a rigid $T$ joint while entire straight line rotates around origin on pedal line length $p$.
Using $( x_p,y_p)$ for $P$ coordinates in place of $(p_x,p_y),$
$$x_p \cos \beta + y_p \sin \beta =\dfrac {-C}{\sqrt{A^2+B^2}} ,\ \beta= \tan^{-1} \frac{B}{A} \tag3$$
Can you go from there?
EDIT1:
Again apply same trick.
$$\dfrac{ x_p \cos \beta + y_p \sin \beta}{{\sqrt{x_p^2+y_p^2}}} =\dfrac {-C}{\sqrt{A^2+B^2}} \cdot \dfrac{ 1}{{\sqrt{x_p^2+y_p^2}}} =RHS \tag4$$
Letting
$$\dfrac{ [x_p , y_p] }{{\sqrt{x_p^2+y_p^2}}}= [\cos \gamma , \sin \gamma] ,\, \gamma= \tan^{-1} \frac{y_p}{x_p}\tag5$$
Left hand side of (4) is now
$$\cos ( \beta - \gamma)= RHS \tag6$$
So rotate given line by $\cos^{-1}$ of RHS.
EDIT2:
If given line $x+y = \sqrt2$ is rotated to pass through given point $P[2, 2( \sqrt 3 +1)],$ then angle between tangents should be $60^0-(-45)^0 = 105^0$, and it tallies with calculation by formula given in (6) within construction errors.
EDIT3:
Can you now guess how to arrive at the sketched second tangent drawn from P?
• Yes,the trigonometric equation will finally come down to xcosα+ysinα=p. – minmeten May 13 '17 at 18:31
The rotation that you describe maps to the point $P$ to the point(s) $Q$ on the line that are equidistant from the origin to $P$. Finding these points is a matter of applying the Pythagorean theorem, after which you can use your favorite way of computing the angle between two points to determine the required rotation angle.
The vector $(A,B)$ is normal to the line, so $(B,-A)$ is parallel to it. The square of distance of the line from the origin is ${C^2\over A^2+B^2}$ and a straightforward computation gives the point on the line nearest the origin as $R\left(-{ac\over a^2+b^2},-{bc\over a^2+b^2}\right)$. Let $d=\sqrt{p_x^2+p_y^2}$, the distance of $P$ from the origin. Then $$Q=R\pm\sqrt{d^2-{C^2\over A^2+B^2}}{(B,-A)\over\sqrt{A^2+B^2}}=R\pm{\sqrt{d^2(A^2+B^2)-C^2}\over A^2+B^2}(B,-A).$$
Now, if what you ultimately want is a rotation matrix, you don’t need to compute any angles at all. The rotation matrix can be found directly from the coordinates of $P$ and $Q$ as $$\begin{bmatrix}p_x&-p_y\\p_y&p_x\end{bmatrix}\begin{bmatrix}q_x&-q_y\\q_y&q_x\end{bmatrix}^{-1}.$$ You can, of course, extract the rotation angle $\theta$ (up to sign) from the resulting matrix since the trace of a 2-D rotation matrix equals $2\cos\theta$.
|
2019-07-19 23:21:13
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.880014181137085, "perplexity": 165.95683605179514}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195526386.37/warc/CC-MAIN-20190719223744-20190720005744-00494.warc.gz"}
|
http://www.ltg.unibe.ch/publications?page=9
|
# Publications
Export 300 results:
2001
: Universes in explicit mathematics. Annals of Pure and Applied Logic. 109, 141-162 (2001).
: Upper bounds for metapredicative Mahlo in explicit mathematics and admissible set theory. The Journal of Symbolic Logic. 66, 935-958 (2001).
2000
: A benchmark method for the propositional modal logics K, KT, S4. Journal of Automated Reasoning. 24, 297-317 (2000).
: A theory of explicit mathematics equivalent to ${ \mathsf{ID} }_1$. In: Proceedings of Computer Science Logic. pp. 356-370. Springer (2000).
Strahm, T.: Autonomous fixed point progressions and fixed point transfinite recursion. In: Proceedings of Logic Colloquium '98. pp. 449-464. AK Peters (2000).
Tupailo, S.: Finitary reductions for local predicativity, I: recursively regular ordinals. In: Proceedings of Logic Colloquium '98. pp. 465-499. AK Peters (2000).
: Fixed point theories and dependent choice. Archive for Mathematical Logic. 39, 493-508 (2000).
Kahle, R.: N-strictness in applicative theories. Archive for Mathematical Logic. 39, 125-144 (2000).
Strahm, T.: The non-constructive $μ$-operator, fixed point theories with ordinals, and the bar rule. Annals of Pure and Applied Logic. 104, 305-324 (2000).
: The unfolding of non-finitist arithmetic. Annals of Pure and Applied Logic. 104, 75-96 (2000).
1999
: Bar induction and $\omega$ model reflection. Annals of Pure and Applied Logic. 97, 221-230 (1999).
: Epsilon-substitution method for the ramified language and $Δ^1_1$-comprehension rule. In: Logic and Foundation of Mathematics. pp. 107-130. Kluwer (1999).
Strahm, T.: First steps into metapredicativity in explicit mathematics. In: Sets and Proofs. pp. 383-402. Cambridge University Press (1999).
: On applicative theories. In: Logic and Foundations of Mathematics. pp. 83-92. Kluwer (1999).
: The proof-theoretic analysis of transfinitely iterated fixed point theories. The Journal of Symbolic Logic. 64, 53-67 (1999).
1998
Schwendimann, S.: A new one-pass tableau calculus for $\mathsf{PLTL}$. In: de Swart, H.C.M. Proceedings of Tableaux '98. pp. 277-292. Springer (1998).
|
2019-03-24 14:38:35
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7866148352622986, "perplexity": 5514.041210532634}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-13/segments/1552912203448.17/warc/CC-MAIN-20190324124545-20190324150545-00059.warc.gz"}
|
https://www.gamedev.net/forums/topic/345157-draw-using-md2-format-then-reuse-the-same-data-problem/
|
draw using md2 format, then reuse the same data problem
This topic is 4877 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.
Recommended Posts
Not sure if I can make this clear... I can draw my models using md2 format for running - it all goes fine. However, I wanted to save some frame rate and re-use the vertices for the run mode so that all models re-use the data. eg for the frame - calculate teh vertices, and save them for the next enemy of the same type to re-use. The problem is that the first model drawn looks perfect, then the next models that re-uses the vertex data look bad - you can see right through them - and the trianlgesa are in the wrong place. I'll do a code dump and try and simplify it somewhat as it looks like a lot of work (although its quite simple) code to calculate the model vertices for this frame:
AnimateModel_run(int startFrame, int endFrame, float percent)
{
...
...
...set up code
...
glBegin(GL_TRIANGLES);
for (i = 0; i < geometry->numTriangles; i++)
{
//get first points in each frame's triangle
vList = geometry->getVertexList(currentFrame, i, 0);
x1 = vList->point[0];
y1 = vList->point[1];
z1 = vList->point[2];
nextVList = geometry->getVertexList(nextFrame, i, 0);
x2 = nextVList->point[0];
y2 = nextVList->point[1];
z2 = nextVList->point[2];
//IMPORTANT THIS IS THE FIRST VERTEX IN THE TRIANGLE
// store first interpolated vertex of triangle
vertex[0].point[0] = x1 + interpol * (x2 - x1);
vertex[0].point[1] = y1 + interpol * (y2 - y1);
vertex[0].point[2] = z1 + interpol * (z2 - z1);
// get second points of each frame
//IMPORTANT: it is as above.......
vList = geometry->getVertexList(currentFrame, i, 2);
...
...
// store second interpolated vertex of triangle
//IMPORTANT : 2ND VERTEX OF THE TRIANGLE
vertex[2].point[0] = x1 + interpol * (x2 - x1);
vertex[2].point[1] = y1 + interpol * (y2 - y1);
vertex[2].point[2] = z1 + interpol * (z2 - z1);
// get third points of each frame
//as above
...
// store third interpolated vertex of triangle
....
vertex[1].point[0] = x1 + interpol * (x2 - x1);
vertex[1].point[1] = y1 + interpol * (y2 - y1);
vertex[1].point[2] = z1 + interpol * (z2 - z1);
// calculate the normal of the triangle
CalculateNormal(vertex[0].point, vertex[2].point,
vertex[1].point);
// render properly textured triangle
geometry->setTexCoord(i, 0);
glVertex3fv(vertex[0].point);
geometry->setTexCoord(i, 2);
glVertex3fv(vertex[2].point);
geometry->setTexCoord(i, 1);
glVertex3fv(vertex[1].point);
} //end for
glEnd();
}
CalculateNormal simply takes the vectors and calcs the normal and calls
glNormal3f(result[0]/length, result[1]/length, result[2]/length);
also setTexCoord:
void CMD2Geometry::setTexCoord(GLuint tIndx, GLuint vertex)
{
glTexCoord2f(st[triIndex[tIndx].stIndex[vertex]].s,
st[triIndex[tIndx].stIndex[vertex]].t);
}
so that all works prefectly and the models look great ! However, if I try and store the vertices/Tex/Normals calculated above and draw them then parts of the model are see through, and vertices don't join up properly. So here is the code that is placed within the above loop to save the data as static data
//each tri has 3 vertices, each vertice has 3 points
frameRunTriVertices = (float*)malloc (geom->numTriangles *3*3*sizeof(float));
//each normal has one vertie of 3 points
frameRunNormals = (float*)malloc (geom->numTriangles *3*sizeof(float));
// frame's tex - each tri has 3 vertices and each vertice has 2 tex
frameRunTex = (float*)malloc (geom->numTriangles*3*2*sizeof(float));
...
...
glBegin(GL_TRIANGLES);
for (i = 0; i < geometry->numTriangles; i++)
{
//same draw thing as above except store data
//store this data
//1st pt
frameRunTriVertices[i*3] = vertex[0].point[0];
frameRunTriVertices[(i*3)+1] = vertex[0].point[1];
frameRunTriVertices[(i*3)+2] = vertex[0].point[2];
//2nd pt
frameRunTriVertices[(i*3)+3] = vertex[2].point[0];
frameRunTriVertices[(i*3)+4] = vertex[2].point[1];
frameRunTriVertices[(i*3)+5] = vertex[2].point[2];
//3rd pt
frameRunTriVertices[(i*3)+6] = vertex[1].point[0];
frameRunTriVertices[(i*3)+7] = vertex[1].point[1];
frameRunTriVertices[(i*3)+8] = vertex[1].point[2];
//get normal
CalculateNormal(vertex[0].point, vertex[2].point, vertex[1].point, frameRunNormals+(i*3));
//get tex
//ith tri, 0 vertex, s tex
frameRunTex[(i*3)] = geometry->getTexCoord(i, 0, 0);
//ith tri, 0 vertex, t tex
frameRunTex[(i*3)+1] = geometry->getTexCoord(i, 0, 1);
frameRunTex[(i*3)+2] = geometry->getTexCoord(i, 2, 0);
frameRunTex[(i*3)+3] = geometry->getTexCoord(i, 2, 1);
frameRunTex[(i*3)+4] = geometry->getTexCoord(i, 1, 0);
frameRunTex[(i*3)+5] = geometry->getTexCoord(i, 1, 1);
}
glEnd();
where the new overloaded CalculateNormal is as for the previous case except it sets:
void CalculateNormal( float *p1, float *p2, float *p3, float *out )
{
...
out[0] = result[0]/length;
out[1] = result[1]/length;
out[2] = result[2]/length;
}
and getTexCoord is v. similar to setTexCoord
float CMD2Geometry::getTexCoord(GLuint tIndx, GLuint vertex, GLuint uv)
{
if (uv==0)
return st[triIndex[tIndx].stIndex[vertex]].s;
else
return st[triIndex[tIndx].stIndex[vertex]].t;
}
Finally, the model is drawn with this:
float *vert, *tex, *norm = NULL;
vert = frameRunTriVertices;
tex = frameRunTex;
norm = frameRunNormals;
glBindTexture(GL_TEXTURE_2D, geometry->modelTex->texID);
glBegin(GL_TRIANGLES);
for (i = 0; i < geometry->numTriangles; i++)
{
glNormal3fv(norm);
glTexCoord2fv(tex);
glVertex3fv(vert);
tex+=2;
vert+=3;
glTexCoord2fv(tex);
glVertex3fv(vert);
tex+=2;
vert+=3;
glTexCoord2fv(tex);
glVertex3fv(vert);
tex+=2;
vert+=3;
norm += 3;
}
glEnd();
glDisable(GL_TEXTURE_2D);
It must be simple for an outsider but I can't see it ! cheers Adrian
Share on other sites
for (i = 0; i < geometry->numTriangles; i++) { //same draw thing as above except store data //store this data //1st pt frameRunTriVertices[i*3] = vertex[0].point[0]; frameRunTriVertices[(i*3)+1] = vertex[0].point[1]; frameRunTriVertices[(i*3)+2] = vertex[0].point[2]; //2nd pt frameRunTriVertices[(i*3)+3] = vertex[2].point[0]; frameRunTriVertices[(i*3)+4] = vertex[2].point[1]; frameRunTriVertices[(i*3)+5] = vertex[2].point[2]; //3rd pt frameRunTriVertices[(i*3)+6] = vertex[1].point[0]; frameRunTriVertices[(i*3)+7] = vertex[1].point[1]; frameRunTriVertices[(i*3)+8] = vertex[1].point[2];
This seems wrong. You're incrementing 'i' by 1 and multiplying by 3. Perhaps it should either change to incrementing by 3 or multiplying by 9, since by the 3rd point you're adding an offset of 8 (the next offset should be 9, not 3). You're code doesn't make total sense as-is, so it's kinda hard to tell. (for example, you're currently copying the same data, vertex[0, 2, 1] into every triangle...)
Share on other sites
thanks, its absolutely perfect now !
As regards the vector 0,1,2 thing - each of these vectors is calculated each time in through each loop in the for loop - maybe I cut out too much from the code..
In any case I'll mark you up some !!
cheers
Share on other sites
thanks, its absolutely perfect now !
As regards the vector 0,1,2 thing - each of these vectors is calculated each time in through each loop in the for loop - maybe I cut out too much from the code..
In any case I'll mark you up some !!
cheers
• What is your GameDev Story?
In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.
• 28
• 16
• 10
• 10
• 11
• Forum Statistics
• Total Topics
634106
• Total Posts
3015547
×
|
2019-01-20 18:52:51
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.24170538783073425, "perplexity": 7627.449131110773}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-04/segments/1547583730728.68/warc/CC-MAIN-20190120184253-20190120210253-00554.warc.gz"}
|
https://math.stackexchange.com/questions/2907025/finding-the-critical-points-of-a-function-and-the-interval-where-it-increases-an
|
# Finding the critical points of a function and the interval where it increases and decreases.
I am having trouble finding the critical points of $$f(x)= (x+1)/{x-3}$$ I found the derivative to be $$f'(x)= -4/(x-3)^2$$ My next step was to equate my derivative to zero, but that does not seem to work as my $$x$$ cancels out. Usually I would take the x-value(worked out by equating the derivative with zero) and substitute it into the original equation to get a y-value. This would then be the critical points. Is there anyone who could maybe help me out (maybe with an example or so) as I also have to find the intervals where the function is increasing and decreasing? Thank you very much.
• It looks like you meant to write $f(x) = \frac{x + 1}{x - 3}$, in which case you are missing needed parentheses in the denominator. As explained in this MathJax tutorial, you could type f(x) = \frac{x + 1}{x - 3} when you are in math mode to produce $f(x) = \frac{x + 1}{x - 3}$. – N. F. Taussig Sep 6 '18 at 7:58
Judging by the derivative you calculated, it appears the function is supposed to be $$f(x) = \frac{x + 1}{x - 3}$$ Since the implicit domain of a rational function is the set of all real numbers except those that make the denominator equal to zero, the implicit domain of $f$ is $$\text{Dom}_f = \{x \in \mathbb{R} \mid x \neq 3\} = (-\infty, 3) \cup (3, \infty)$$ The derivative of $f$ is $$f'(x) = -\frac{4}{(x - 3)^2} < 0$$ for every $x$ in its domain, which tells us that the function is decreasing on the intervals $(-\infty, 3)$ and $(3, \infty)$.
Note that $$f(x) = \frac{x + 1}{x - 3} = 1 + \frac{4}{x - 3}$$ so \begin{align*} \lim_{x \to -\infty} f(x) & = \lim_{x \to -\infty} \left(1 + \frac{4}{x - 3}\right) = 1\\ \lim_{x \to 3^+} f(x) & = \lim_{x \to 3^+} \left(1 + \frac{4}{x - 3}\right) = -\infty\\ \lim_{x \to 3^+} f(x) & = \lim_{x \to 3^+} \left(1 + \frac{4}{x - 3}\right) = \infty\\ \lim_{x \to \infty} f(x) & = \lim_{x \to \infty} \left(1 + \frac{4}{x - 3}\right) = 1 \end{align*} Thus, when $x \in (-\infty, 3)$, $f(x) \in (-\infty, 1)$, and when $x \in (3, \infty)$, $f(x) \in (1, \infty)$. Since the function assumes larger values in the interval $(3, \infty)$ than it does in the interval $(-\infty, 3)$, it does not decrease over the union of the two intervals in which it is decreasing.
If you define a critical point of a function $f$ to be a point where $f'(x) = 0$, then the function $f: (-\infty, 3) \cup (3, \infty) \to \mathbb{R}$ defined by $$f(x) = \frac{x + 1}{x - 3}$$ does not have a critical point since $f'(x) < 0$ for every $x$ in its domain.
If you use the alternative definition that a critical point of a function $f$ is a point in its domain where $f'(x) = 0$ or $f'(x)$ does not exist, then the function $f: (-\infty, 3) \cup (3, \infty) \to \mathbb{R}$ defined by $$f(x) = \frac{x + 1}{x - 3}$$ still does not have a critical point since the derivative is defined at every point of its domain.
Hint: Critical points can also occur where your derivative is undefined (where the denominator equals 0)!
• A function cannot have a critical point where it is undefined. – N. F. Taussig Sep 6 '18 at 8:08
• True, but when the derivative is undefined that still can be a candidate for a critical point (which is what i was saying). – Zach Sep 6 '18 at 10:50
• A critical point of a function $f$ is usually defined as a point where $f'(x) = 0$. It seems you are using the definition that a critical point of a function $f$ is a point in its domain where $f'(x) = 0$ or $f'(x)$ does not exist. However, $3$ is not in the domain of $f(x) = \frac{x + 1}{x - 3}$. – N. F. Taussig Sep 6 '18 at 11:07
• Thank you very much. If the denominator is equal to 0, then x=3. How would I get the y-value for the critical point? If I substitute x=3 into the original equation it would also be undefined. – Nicci Sep 6 '18 at 12:07
|
2019-05-21 17:17:00
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9705621004104614, "perplexity": 66.97162745432773}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232256494.24/warc/CC-MAIN-20190521162634-20190521184634-00017.warc.gz"}
|
http://math.stackexchange.com/questions/228982/how-can-i-prove-this-property-of-a-d-ary-tree
|
# How can I prove this property of a $d$-ary tree?
I have the following homework (algorithms lecture):
Every $d$-ary tree $G=(V,E)$ contains a vertex $v$ such that the size of the subtree with root $v$ is at least $\frac{1}{d+1} \vert V \vert$ and at most $\frac{d}{d+1} \vert V \vert+1$
I have tried several proofs, but none of them seems legitimate for me. I would be glad if you have a valuable suggestion to prove this! Thank you in advance
Greetings from Germany (and sorry for my poor english!)
Edit: my current proof
To prove: A $d$-ary tree $G=(V,E)$ contains a vertex $v$ such that $\frac{1}{d+1} \vert V \vert \le \operatorname{tsize}(v) \le \frac{d}{d+1} \vert V \vert +1$.
Beforehand: The difference between the bounds is at least $d$ for any $d$ and for any $V$, since $$\frac{d}{d+1} \vert V \vert + 1 - \frac{1}{d+1} \vert V \vert \ge d \iff \frac{d}{d+1} \vert V \vert - \frac{1}{d+1} \vert V \vert \ge d-1 \iff \frac{d \vert V \vert - \vert V \vert}{d+1} \ge d-1$$ $$\iff \frac{(d-1)\vert V \vert}{d+1} \ge d-1 \iff \vert V \vert \ge d+1$$ Which is always fulfilled.
Consider the root of $G$. The size of the subtree of the root is clearly $\vert V \vert$. If we consider the child nodes of $r$ and obtain the node with maximum subtree size (call it $r'$), it will hold that the size of the subtree with root $r'$ lies in the interval $[\vert V \vert/d,\vert V \vert-d]$. The lower bound is the case when all direct subtrees of $r$ are equally sized, the upper bound the case when all other subtrees than $r'$ contain only a leaf.
From these facts we can derive that the tree size will diminish at least by $d$ if we choose the maximal subtree for each transition. We can also observe that the minimal bound always lies in the proposed intervall: $$\frac{1}{d+1} \vert V \vert \le \vert V \vert/d \le \frac{d}{d+1}\vert V \vert+1$$ From these two facts, it follows that we will find a vertex $v$ satisfying the above property. $\square$
-
a) There's a $-1$ missing on the right-hand side of one of the inequalities in the long equivalence chain. b) It's not true that $|V|\ge d+1$ is always fulfilled; e.g. you might only have the root. You'd need to argue that if $|V|\lt d+1$, the condition requires a subtree of size $1$, which always exists. c) You seem to be assuming a full $d$-ary tree; a general $d$-ary tree need not have vertices on all branches of a non-leaf. – joriki Nov 5 '12 at 5:54
|
2015-10-09 20:31:08
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.913142740726471, "perplexity": 163.53882758120906}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-40/segments/1443737935292.75/warc/CC-MAIN-20151001221855-00108-ip-10-137-6-227.ec2.internal.warc.gz"}
|
http://www.kai-arzheimer.com/tag/pgfplots/
|
I use emacs/$LaTeX$for all my textprocessing needs, and for the last four or five years, I have created all my slides with Till Tantaus excellent “beamer” class. At the moment, I’m teaching a 2nd year stats course (imagine doing this with PowerPoint – the horror! the horror!), so I sometimes use graphs from the assigned text like this one from Long&Freese that illustrates the latent variable/threshold interpretation of the binary logit model. The message should be fairly clear: $y^{*}$ depends on $x$ andfollows a standard logistic distribution around its conditional mean.
But the fact that the bell-curve lies flat in the $x-y^{*}$ plane confused my students no end. So I wasted half a day on creating a nice 3d-plot for them. After trying several options, I settled on pgfplots.sty, which builds on tikz/pgf, the comprehensive, portable graphics package designed by Tantau (here’s a gallery with most amazing examples of what you can do with this little gem). Plotting data and functions with pgfplots in 2d or 3d is a snap, so that was not too hard. Eventually.
Finally, in a desperate attempt to drive the message home, I enlisted the help of animate.sty, yet another amazing package that creates a javascript-based inline animation from my $LaTeX$ source (requires Acrobat reader). So the bell-curves pop out of the plane, in slow motion. Did it help the students to see the light? I have no idea. Here is the source.
|
2017-12-17 00:21:08
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 5, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.28987017273902893, "perplexity": 1597.503483467125}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-51/segments/1512948592202.83/warc/CC-MAIN-20171217000422-20171217022422-00752.warc.gz"}
|
https://math.stackexchange.com/questions/3227557/should-math-logic-reflect-real-logic
|
# Should math logic reflect “real” logic
In math we use logic. However, it seems mathematicians were free to define some of its rules. Say the OR. It is true, if either of arguments is true - or both.
Now we use math to prove some facts about real world. Take euclidean geometry. Proofs on the other hand rely on axioms and the mathematical logic and more precisely say on the OR operator the way it is defined, to prove even more facts about real world, or not?
So my question is, in order for this chain to work, the mathematical logic has to be correct also right: What I mean is that maybe mathematicians weren't so free to define the OR in that way, what if they had to use OR which is true only when one of the arguments is true and not both? We could do this theoretically but using this OR would we be able to prove further facts from basic axioms of euclidean geometry? So what dictates that the OR which is defined the way it is now, is the correct one?
• Mathematics describes a purely theoretical world that is bound by axioms. To the degree that the "real world" follows rules or axioms, there will be a mathematics that describes it. – Doug M May 15 at 20:59
What you call "real logic" unfortunately involves ambiguities and depends on idiosyncrasies of the English language. For example, "or" can mean inclusive or (as in "whoever did xxx must be stupid or malicious" --- he might be both) or exclusive ("you can have ice cream or cake for dessert"). In contrast, Latin has different words ("vel" and "aut") for these. Ordinary language often leaves quantifiers implicit, leaving it to experience or common sense to guess which quantifier is meant. For example compare "Dogs must be carried on the escalator" with "Hard hats must be worn on the construction site", and consider what these mean if I arrive at the escalator with several dogs versus if I arrive at the construction site with several hard hats. And compare what they mean if I have no dog and no hard hat. The bottom line here is that "real logic" in English (or any other natural language) hardly qualifies for the name of "logic" (though it's certainly "real").
So how does mathematics, with its precise logical conventions, manage to produce information about the real world? Strictly speaking, there's no problem about the information; it's there in the precise mathematical statements. Where there's a problem is in expressing that information in English (or another natural language) so that most people (non-mathematicians) can use it. Here some work is needed. A literal translation (e.g., changing the logicians' symbol $$\lor$$ to the word "or") is likely to lose information (because that "or" is ambiguous), so one often needs a somewhat wordy translation (e.g., "X or Y or both") to express in English facts that have more efficient expressions in mathematics.
Natural languages developed to communicate information as needed in ordinary life, not necessarily with great precision but just well enough to work when supplemented with common sense, experience, social conventions, etc. Mathematics is intended to be much more precise than that, and, as a result, needs unambiguous concepts --- beginning with unambiguous logic.
• I see your point so you mean in math there can be something proved with OR, but if you'd translate that in English you'd make that precise that you assume either X, Y or both are true. – user674432 May 16 at 16:55
• or when you prove math theorems from some basic math axioms and you use OR, it is also clear you assume X, Y or both are true. So as soon as you make precise what kind of OR you are using, there should be no problems, I think I am more grasping it now, it could be I hadn't formulated the question in my head clearly enough too. – user674432 May 16 at 16:58
• I always hear an inclusive "or" when asked if I want ice cream or cake.... – Barry Cipra May 18 at 6:34
Mathematician have both kinds of OR. The inclusive OR and the exclusive OR which is the one that you like better. Mathematical logic is OK and it works fine.
The more you learn about mathematics the more you appreciate the logic used in proving amazing theorems.
Keep learning and you will enjoy the mathematical logic as much as the geometry.
• Thanks for response, but you didn't understand the question. Math Proves fact about real world right? It uses logic in between, say using the OR which I mentioned. But mathematicians were free to define this OR in the way that it is true if one of args is true or both. Question was this OR is used to prove facts about real world, so the way this OR is defined must be true right? How did they know? What if they defined it in a way it is true if only one arg is true? Would we still prove theorems? – user674432 May 15 at 20:55
• As I mentioned, both kinds of OR are defined and their truth tables are agreed upon. There is not dispute. – Mohammad Riazi-Kermani May 15 at 21:04
• Good I see they are defined. But you use one of them in proving facts from real world don't you? And in that case the one you use must also be "correct" one right? By correct I mean match the real notion of OR...... – user674432 May 15 at 21:07
• In real life, if I say " you are smart OR you are rich" it does not mean that you can not be both. On the other hand If I say you are either rich or smart, then I mean you can not be both. – Mohammad Riazi-Kermani May 15 at 21:17
• so which one is the correct OR? as far as natural world is concerned and proving theorems about it? seems I am finding hard to formulate precisely what I mean .... – user674432 May 15 at 21:26
You’re referring to XOR. Yet,
A XOR B = (A OR B) \ (A AND B).
So if you really need the XOR operation, you can create it from the usual ones.
• I am afraid you too didn't understand the question, maybe look at my comment to other answer – user674432 May 15 at 21:03
• @gdan: this answer shows you that both types of ORs are equivalent, in the sense that you can get one from the other. So whatever system of logic that is subsequently generated by either one, both generate the same system. This means that using XORs would not generate “further facts.” – Alex R. May 15 at 22:06
While I endorse Andreas Blass's answer, a different perspective is the following which I think cuts more to the heart of the issue.
First, there are many quite distinct formal logics. That classical logic works some way doesn't mean every logic has to work that way. This means there's a plurality of possible options, and we can choose which seems to work best for our purposes. With regards to modeling informal reasoning, this is akin to having multiple physical theories (where physical theories model reality). To this end the answer to your question "what dictates that the OR which is defined the way it is now, is the correct one?" is "nothing" and different logics do make different choices. However, making a different choice is making a different logic, not changing what The One And Only Logic is.
To this end, different logics correspond to different ways of modeling informal reasoning. Just like we may use Newtonian Mechanics rather than General Relativity, say, logics that may not perfectly or completely capture every aspect of informal reasoning may nevertheless be good enough for our purposes and much more convenient than a more precise account.
In a different direction using the same distinction, nowadays we kind of make fun of Aristotle's physics. We tend to have the idea that he needed to go outside and do some real experiments. However, many of Aristotle's ideas do seem to fit observations better. Newton's ideas seem obviously wrong. In day-to-day experience, an object in motion does not remaining in motion. Of course, nowadays we know that applying Newton's ideas to day-to-day experience requires a much more in-depth modeling. Likewise, modeling a piece of informal reasoning in a formal logic may be (is) a much more involved and subtle exercise than a string replace that replaces "or" with "$$\lor$$" and so forth. Natural language is not entirely compositional or context-free.
Finally, informal reasoning in practice is filled with flaws. These mathematical models are also idealizations, so at times where they depart from informal reasoning, this may be to their benefit.
In a totally different vein, formal logics are mathematical structures and logicians and mathematicians have plenty of other reasons to study them regardless of how well they correspond to informal reasoning.
|
2019-06-16 15:02:52
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 2, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7488718032836914, "perplexity": 699.6003605496298}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560627998250.13/warc/CC-MAIN-20190616142725-20190616164725-00094.warc.gz"}
|
http://mathhelpforum.com/calculus/147264-proving-inequality.html
|
1. Proving an Inequality
I was thinking of using convex function properties to prove the following inequality but couldn't. I'm not sure what else should I use.
$\displaystyle 1-(a/b)<ln(b/a)<(b/a) -1$
given that $\displaystyle 0<a<b$
2. Originally Posted by GIPC
$\displaystyle 1-(a/b)<ln(b/a)<(b/a) -1$
given that $\displaystyle 0<a<b$
Use the mean value theorem to prove Napier's inequality:
$\displaystyle \frac{1}{b}\le\frac{\log(b)-\log(a)}{b-a}\le\frac{1}{a}$.
|
2018-06-23 02:56:25
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9486840963363647, "perplexity": 630.9939763042715}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-26/segments/1529267864919.43/warc/CC-MAIN-20180623015758-20180623035758-00613.warc.gz"}
|
https://www.mersenneforum.org/showpost.php?s=ab510eb1993af63325754f8993d3dc72&p=589192&postcount=14
|
View Single Post
2021-10-02, 03:24 #14
axn
Jun 2003
34×67 Posts
Quote:
Originally Posted by totmalone It's seems running using NFS ? or it's just automatics choose what method to factor an integer ?
Code:
div: primes less than 10000
div: found prime factor = 3
div: found prime factor = 5
It performed trial division and found 3 & 5, completing the factorization. It never went to the more complex factoring algorithms.
For a larger number, it would've performed additional steps like Pollard's rho, P-1, ECM, and eventually would've finished it off by either SIQS or NFS (depending on the size of the composite and the qs/nfs crossover points).
|
2022-12-04 02:10:24
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2974351942539215, "perplexity": 5400.223102804427}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446710953.78/warc/CC-MAIN-20221204004054-20221204034054-00240.warc.gz"}
|
https://publications.hse.ru/en/articles/211128061
|
• A
• A
• A
• ABC
• ABC
• ABC
• А
• А
• А
• А
• А
Regular version of the site
Improved limit on the branching fraction of the rare decay K0S→μ+μ−
The European Physical Journal C - Particles and Fields. 2017. Vol. 10. No. C77. P. 678-690.
A search for the decay K0S→μ+μ− is performed, based on a data sample of proton-proton collisions corresponding to an integrated luminosity of 3 fb−1, collected by the LHCb experiment at centre-of-mass energies of 7 and 8 TeV. The observed yield is consistent with the background-only hypothesis, yielding a limit on the branching fraction of B(K0S→μ+μ−)<0.8 (1.0)×10−9 at 90% (95%) confidence level. This result improves the previous upper limit on the branching fraction by an order of magnitude.
|
2019-01-22 00:15:44
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9489142894744873, "perplexity": 2549.3269745101566}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-04/segments/1547583822341.72/warc/CC-MAIN-20190121233709-20190122015709-00217.warc.gz"}
|
https://www.nature.com/articles/s41467-020-18426-4?error=cookies_not_supported&code=4f4f3acc-bcf5-4c8c-8ddf-f207be653149
|
# Phonon heat transport in cavity-mediated optomechanical nanoresonators
## Abstract
The understanding of heat transport in nonequilibrium thermodynamics is an important research frontier, which is crucial for implementing novel thermodynamic devices, such as heat engines and refrigerators. The convection, conduction, and radiation are the well-known basic ways to transfer thermal energy. Here, we demonstrate a different mechanism of phonon heat transport between two spatially separated nanomechanical resonators coupled by the cavity-enhanced long-range interactions. The single trajectory for thermalization and non-equilibrium dynamics is monitored in real-time. In the strong coupling regime, the instant heat flux spontaneously oscillates back and forth in the nonequilibrium steady states. The universal bound on the precision of nonequilibrium steady-state heat flux, i.e. the thermodynamic uncertainty relation, is verified in such a temperature gradient driven far-off equilibrium system. Our results give more insight into the heat transfer with nanomechanical oscillators, and provide a playground for testing fundamental theories in non-equilibrium thermodynamics.
## Introduction
The energy transfer and heat flux play the most important role in thermodynamics, which have been well understood on macroscopic scales in the framework of classical thermodynamics. However, as the size of the system is reduced, thermal or quantum fluctuations becoming increasingly relevant, some striking phenomena and properties have been revealed recently1,2,3,4. To study heat transport in systems of nano/microscales and at single-atom levels has remained elusive, although it has received great interest for the fundamental physics in many fields5,6,7,8 and the applications in various advanced microscopic devices9,10,11.
In parallel, remarkable accomplishments have been achieved in cavity optomechanics, such as ground-state cooling of mechanical resonators12,13,14, ultrasensitive motion detections15,16,17, nonreciprocal control of photons and phonons18,19,20, and so on. Optomechanical system owing to its high controllability has been proposed as a novel mechanism for nonlocal heat transfer and thermal management21,22,23,24,25,26, however, it has not been experimentally demonstrated because of the technical challenges in precisely manipulating optomechanical arrays inside an optical cavity.
Here we study the transport of thermal energy between two spatially separated nanomechanical resonators mediated by the cavity light field. Compared to other mechanisms of heat transport, the optomechanical coupling can be coherently manipulated and it could be, in principle, infinitely long-range, which provides a new mechanism for heat transfer with high tunability. Importantly, in the strong coupling regime, we find that the heat flux flows back and forth coherently in nonequilibrium steady-state at short time scales, and the oscillation period is fully determined by the eigenmodes of such a composite system. This means that the coherence is dominated over the dissipations in such an inherently random process. In addition, we test the constraints on the precision of steady-state heat flux, i.e., the thermodynamic uncertainty relation27,28,29,30,31,32,33,34,35,36,37, in such a thermal gradient driven far-off equilibrium system at various coupling strengths, including the strong coupling regime. Therefore, our observations provide new insights for nonequilibrium thermodynamics and nontrivial extension beyond the weak coupling, in contrast to most previous systems of stochastic thermodynamics that are overdamped3,4.
## Results
### Experimental setup
The multimode optomechanical system offers an exceptional degree of freedom to investigate phonon heat transport. The thermal energy is transported between two nanomechanical resonators mediated by a cavity field, as shown in Fig. 1a. The resonators are two SiN membranes with dimensions 1 mm × 1 mm × 50 nm. The membranes separated by 6 cm are placed inside a Fabry-Perot cavity38,39. The motions of membranes are monitored by two weak probe laser fields separately (not shown in Fig. 1a). We focus on the vibrational (1,1) modes, which are nearly degenerate with eigenfrequencies ω1,2 ~ 2π × 400 kHz. Piezos are used to precisely control the eigenfrequencies of each membrane40. The cavity is driven by a red-detuned laser field, which interacts with both membranes simultaneously due to the dynamical backaction. Therefore, two individual modes of membranes are effectively coupled mediated by the cavity field. The phonon heat transport is realized by contacting two membranes with independent thermal baths. Such a system can be equivalently viewed as two mutually coupled harmonic oscillators, as shown in Fig. 1b, with one in contact with a room temperature reservoir and the other with a high temperature reservoir (realized by exciting the membrane with a Gaussian white noise). The temperature gradient drives the system out of equilibrium with a mean heat flux from the hot reservoir to the cold reservoir under the effective optomechanical coupling. When the coupling between the membranes is zero by turning off the cavity field, the membranes have the equivalent temperatures as their own reservoirs.
### Effective Hamiltonian
The interaction Hamiltonian of such a composite system of two membranes interacting with a common cavity field is $$H_{int} = - \hbar \mathop {\sum}\nolimits_{i = 1,2} {g_i} \hat a^\dagger \hat a(\hat b_i^\dagger + \hat b_i)$$, where $${\hat{\mathrm{a}}}$$ and $$\hat b_i$$ are the annihilation operators for cavity and mechanical modes, respectively. gi is the optomechanical coupling rate of each membrane. After eliminating the cavity mode, the system can be effectively described by the following Langevin equations (see Supplementary Note 1)
$$i\frac{\partial }{{\partial {\mathrm{t}}}}\left( {\begin{array}{*{20}{c}} {\hat b_1} \\ {\hat b_2} \end{array}} \right) = \left( {\begin{array}{*{20}{c}} {\omega _1 - \frac{{i\gamma _1}}{2} + {\mathrm{{\Lambda}}}} \\ {\mathrm{{\Lambda}}} \end{array}\begin{array}{*{20}{c}} {\mathrm{{\Lambda}}} \\ {\omega _2 - \frac{{i\gamma _2}}{2} + {\mathrm{{\Lambda}}}} \end{array}} \right)\left( {\begin{array}{*{20}{c}} {\hat b_1} \\ {\hat b_2} \end{array}} \right) + \left( {\begin{array}{*{20}{c}} {\sqrt {\gamma _1} \hat \eta _1} \\ {\sqrt {\gamma _2} \hat \eta _2} \end{array}} \right)$$
(1)
Here $$\hat \eta _i$$ (i = 1, 2) is the thermal Langevin noise operator with$$\langle {\hat \eta _{1,2}^\dagger \left( t \right)\hat \eta _{1,2}\left( {t^{\prime} } \right)} \rangle = \delta \left( {t - t^{\prime} } \right)k_BT_{H,L}/\hbar \omega _{1,2}$$. The mechanical resonant frequencies are assumed to be equivalent, i.e., ω1 = ω2 = ω0, which leads to the maximum heat transfer efficiency, unless it is specifically described. Ʌ = g2 χm is the effective coupling rate between membranes, where the membranes are assumed to have the same optomechanical coupling rate g, and χm is the effective mechanical susceptibility introduced by the intracavity field41, which is proportional to the intracavity photon number. Generally, the effective coupling between membranes can be both dispersive and dissipative. Here, the laser frequency is detuned far-off the cavity resonance, and consequently the interacting of membranes is dominated by a conservative coupling.
### Thermomechanical noise spectrum
To demonstrate the thermal energy transportation, we first investigate the thermomechanical noise spectral properties. Figure 2a, b illuminate the noise spectra of membranes in the weak and strong coupling regimes, respectively. The critical point that separates the strong and weak coupling regimes is $${\mathrm{{\Lambda}}}^2 - \frac{{( {\gamma _1 - \gamma _2} )^2}}{{16}} = 0$$. Notably, the mechanical spectrum shows two peaks in the strong coupling regime, and the resonant frequencies are given by the eigenvalues of the effective Hamiltonian, i.e., ω+ = ω0 and ω = ω0 + 2Ʌ, which is called the normal mode splitting. This splitting is caused by the strong phonon-phonon interaction, and it has a different mechanism with the previous observations where one cavity mode and one mechanical mode interact42,43. The frequency shifts of normal modes as a function of the intracavity photon number are plotted in Fig. 2c. Due to the effective spring constant is negative and the eigenfrequencies of membranes are also modified by the optomechanical coupling, the frequency of the breathing mode is fixed and the frequency of the center-of-mass mode reduces as the cavity photon number increases, as shown in Fig. 2c. By integrating the noise power spectra, one can obtain the effective temperatures of membranes. The root mean square vibrational amplitude of membrane $$\sqrt {k_BT/m\omega _0^2}$$ at room temperature is utilized to calibrate the effective temperature (see Supplementary Note 4). Please note that the effective temperature is defined by the motion of mechanical oscillator, instead of the motions of atoms which constitute the membrane. When the optomechanical coupling is turned on, the heat energy is transferred from the high temperature membrane to the low temperature membrane. The effective temperatures in steady states are shown in Fig. 2d. When the coupling is weak, the temperature difference between two membranes is large. The temperatures are close to their respective reservoirs’ temperatures in equilibrium. As the cavity photon number increases, the temperatures of membranes tend to be equal, which implicates that the thermal energy has been redistributed in the two membranes under the optomechanical coupling.
### Instant heat flux
To fully characterize the process of heat transfer, we investigate the heat flux in the nonequilibrium steady-state. The instant heat flux from membrane 1 to 2 is $$j_\tau = - \mathop {{\lim }}\nolimits_{t_0 \to \infty } \frac{{2m}}{\tau }(\omega _0{\mathrm{{\Lambda}}} + {\mathrm{{\Lambda}}}^2){\int}_{t_0}^{t_0 + \tau } {u_1} \dot u_2dt$$, where u1,2 is the membrane motion, and τ is the integration time44,45. Since the integration time of the measurements (typical on the order of 100 μs) is much smaller than the damping rates of membranes, then the heat flux directly obtained from the data of lock-in amplifier can be viewed as the instant heat flux. The time evolution of instant heat flux in the strong coupling regime is plotted in Fig. 3a. Remarkably, the instant heat flux oscillates back and forth between the membranes in the nonequilibrium steady-state with strong coupling (see the inset of Fig. 3a for clarity), which is not previously observed in the thermalization and in contrast with the observations in the macroscopic world. By performing Fourier transformation on the heat flux trace, the oscillation frequency as a function of cavity photon number is presented in Fig. 3b, which is coincident with the twice of the effective coupling strength between membranes. Such oscillations disappear as the coupling strength is smaller than the critical point. The inset of Fig. 3b illuminates such a transition near the critical point.
The probability density functions for various integration time are plotted in Fig. 3d. Although the instant heat flux traces exhibit completely different behaviors in the strong coupling regime, the probability density functions have exponential tails and positive mean values, which is consistent with the observations in overdamped systems4. Based on the probability density function, a symmetry function can be defined as the logarithm of the ratio of the probability finding a positive heat flux with respect to the corresponding negative one, i.e., ln[P(j)/P(−j)]40. The symmetry function at different coupling strengths is shown in Fig. 3c, which has a linear dependence on the instant current value j. The green dots and brown squares are the experimental data corresponding to the cases when the cavity photon numbers are 5 × 108 and 109, respectively. A larger optomechanical coupling strength leads to a smaller slope of the symmetry function, and indicates a more symmetric probability density function, which depends on the difference of the effective temperatures of membranes.
### Thermodynamics uncertainty relation
According to the measurements of instant heat flux for the strong coupling (Fig. 3) and weak coupling cases (see Supplementary Note 5), one can find that the dynamical fluctuation is an essential quantity, which indicates that such an optomechanical system driven by a thermal bias provides an ideal platform for studying the theories in nonequilibrium thermodynamics, the efficiency of stochastic heat engine, and the connection between information and thermodynamics3,4. The instant heat flux in the strong coupling regime could violate the second law of thermodynamics in the small time scales. Then we intend to investigate whether the fundamental constraints of stochastic thermodynamics hold in this distinct regime. The thermodynamics uncertainty relation (TUR) is a recently developed thermodynamic inequality, which offers a precise bound on the heat flux fluctuations in terms of the entropy production. Although the TUR has been well accepted and the most interesting applications take a step beyond its validation, there is rare proof in the experiment30,37.
The statement of the TUR in the nonequilibrium steady-state limit under a constant thermal bias reads27,28,29,30,31,32,33,34,35,36,37
$$\frac{{{\mathrm{Var}}(J_\tau )}}{{J_\tau ^2}} \ge \frac{{2k_B}}{{\sum _\tau }}$$
(2)
where the average steady-state entropy production is $$\sum _\tau = \langle J_\tau \rangle ( {\frac{1}{{T_L}} - \frac{1}{{T_H}}} )$$ and the integrated heat current is $$J_\tau = - \mathop {{\lim }}\nolimits_{t_0 \to \infty } 2m(\omega _0{\mathrm{{\Lambda}}} + {\mathrm{{\Lambda}}}^2){\int}_{t_0}^{t_0 + \tau } {u_1} \dot u_2dt$$. The trajectories of integrated heat current as a function of time at different coupling strengths are plotted in Fig. 4a. In the case of TL << TH, Eq. (2) simplifies to Var(Jτ)/(<Jτ > kBTL) ≥ 2. Figure 4b exhibits the TUR quantity Var(Jτ)/(<Jτ > kBTL) as a function of τ at various coupling strengths. As one can see in Fig. 4b, the TUR quantity is above the TUR limit (a value of 2) at an arbitrary time, which approaches to a constant as τ is relatively large. However, the TUR decreases as τ goes to zero, owing to the possibility that the inertia suppress the fluctuations when the time is smaller than the relaxation time of membranes. A characteristic behavior for the strong coupling case (see the inset of Fig. 4b for clarity) is that the TUR quantity shows oscillation and the period is coincident with the oscillation period of instant heat flux.
### Mean heat flux
Lastly, we demonstrate that the mean heat flux can be flexibly manipulated by tuning the laser power and other parameters, in comparison with many other systems where the thermal conductivity is fixed and the heat flux is difficult to tune. The value of mean heat flux is obtained by averaging the instant heat flux trace for a long time (dozens of seconds in contrast to hundreds of μs for the instant heat flux), which can also be extracted from the effective temperatures of membranes in the nonequilibrium steady-state (see Supplementary Note 2). The mean heat flux is zero when the laser field is off. As the intracavity photon number increases, the mean heat flux grows up and tends to be saturated, as shown in Fig. 5a. The maximum mean heat flux is limited by $$\gamma _1\gamma _2k_B(T_H - T_L)/(\gamma _1 + \gamma _2)$$. The mean heat flux is linearly related to the temperature difference of two reservoirs, i.e. TH − TL, which is depicted in Fig. 5b. Previously, we have studied the situations of resonant heat transfer. Figure 5c presents the dependence on the frequency detuning of membranes (∆ = (ω1 − ω2)/2π). The resonance behavior can be clearly seen in Fig. 5c. Interestingly, the linewidth of the resonance peak is broadened compared to the natural linewidth of mechanical resonators, which can be analogous to the power broadening in atomic physics and can be utilized to relax the condition of mechanical frequency match in the strong coupling regime.
## Discussion
The systems of optomechanical arrays offer many unique possibilities to study nonequilibrium dynamics, as they allow for a full real-time control of almost all relevant parameters. We have demonstrated the phonon heat transportation between two spatially separated nanomechanical membranes with cavity-enhanced long-rang and flexible optomechanical coupling. The spontaneous generation of coherent energy oscillation during the process of heat transfer with strong coupling is experimentally observed. The universal bound on the precision of nonequilibrium steady-state heat flux is verified. In contrast to most previous stochastic thermodynamic systems, which are overdamped, our observations might open an unexplored region. Although one eigenmode of each membrane is utilized in this work, the multimode nature of the mechanical resonator implies the possibility of using this system as a multi-channel phonon-photon interface46. Such a system provides a fertile ground for studying stochastic and quantum thermodynamics, and is a candidate for the photon controlled phononic devices and hybrid quantum networks.
## Data availability
The data that supports the results within this paper are available from the corresponding authors upon reasonable request.
## Code availability
The custom code used to obtain the results within this paper are available from the corresponding authors upon reasonable request.
## References
1. 1.
Fong, K. Y. et al. Phonon heat transfer across a vacuum through quantum fluctuations. Nature 576, 243–247 (2019).
2. 2.
Cui, L. et al. Thermal conductance of single-molecule junctions. Nature 572, 628–633 (2019).
3. 3.
Seifert, U. Stochastic thermodynamics, fluctuation theorems and molecular machines. Rep. Prog. Phys. 75, 126001 (2012).
4. 4.
Ciliberto, S. Experiments in stochastic thermodynamics: Short history and perspectives. Phys. Rev. X 7, 021051 (2017).
5. 5.
Gemmer, J., Michel, M. & Mahler, G. Quantum Thermodynamics: Emergence of Thermodynamic Behavior within Composite quantum Systems, 2nd edn, (Springer, 2009).
6. 6.
Pekola, J. P. Towards quantum thermodynamics in electronic circuits. Nat. Phys. 11, 118–123 (2015).
7. 7.
Dhar, A. Heat transport in low-dimensional systems. Adv. Phys. 57, 457 (2008).
8. 8.
Luckyanova, M. N. et al. Coherent phonon heat conduction in superlattices. Science 338, 936–939 (2012).
9. 9.
Peterson, J. P. S. et al. Experimental characterization of a spin quantum heat engine. Phys. Rev. Lett. 123, 240601 (2019).
10. 10.
Klatzow, J. et al. Experimental demonstration of quantum effects in the operation of microscopic heat engines. Phys. Rev. Lett. 122, 110601 (2019).
11. 11.
Li, N. et al. Manipulating heat flow with electronic analogs and beyond. Rev. Mod. Phys. 84, 1045 (2012).
12. 12.
Teufel, J. et al. Sideband cooling of micromechanical motion to the quantum ground state. Nature 475, 359–363 (2011).
13. 13.
Chan, J. et al. Laser cooling of a nanomechanical oscillator into its quantum ground state. Nature 478, 89–92 (2011).
14. 14.
Peterson, R. et al. Laser cooling of a micromechanical membrane to the quantum backaction limit. Phys. Rev. Lett. 116, 063601 (2016).
15. 15.
Teufel, J., Donner, T., Castellanos-Beltran, M., Harlow, J. & Lehnert, K. Nanomechanical motion measured with an imprecision below that at the standard quantum limit. Nat. Nanotechnol. 4, 820–823 (2009).
16. 16.
Schliesser, A., Arcizet, O., Riviere, R., Anetsberger, G. & Kippenberg, T. Resolved-sideband cooling and position measurement of a micromechanical oscillator close to the Heisenberg uncertainty limit. Nat. Phys. 5, 509–514 (2009).
17. 17.
Rocheleau, T. et al. Preparation and detection of a mechanical resonator near the ground state of motion. Nature 463, 72–75 (2010).
18. 18.
Xu, H. et al. Nonreciprocal control and cooling of phonon modes in an optomechanical system. Nature 568, 65–69 (2019).
19. 19.
Bernier, N. R. et al. Nonreciprocal reconfigurable microwave optomechanical circuit. Nat. Commun. 8, 604 (2017).
20. 20.
Ruesink, F., Miri, M.-A., Alu, A. & Verhagen, E. Nonreciprocity and magnetic-free isolation based on optomechanical interactions. Nat. Commun. 7, 13662 (2016).
21. 21.
Farman, F. & Bahrampour, A. R. Heat transfer between micro- and nano-mechanical systems through optical channels. J. Opt. Soc. Am. B 31, 1525–1532 (2014).
22. 22.
Xuereb, A., Genes, C., Pupillo, G., Paternostro, M. & Dantan, A. Reconfigurable long-range phonon dynamics in optomechanical arrays. Phys. Rev. Lett. 112, 133604 (2014).
23. 23.
Xuereb, A., Imparato, A. & Dantan, A. Heat transport in harmonic oscillator systems with thermal baths: application to optomechanical arrays. N. J. Phys. 17, 055013 (2015).
24. 24.
Barzanjeh, S., Aquilina, M. & Xuereb, A. Manipulating the flow of thermal noise in quantum devices. Phys. Rev. Lett. 120, 060601 (2018).
25. 25.
Seif, A., DeGottardi, W., Esfarjani, K. & Hafezi, M. Thermal management and non-reciprocal control of phonon flow via optomechanics. Nat. Commun. 9, 1207 (2018).
26. 26.
Mahmoud Ashrafi, S., Malekfar, R., Bahrampour, A. R. & Feist, J. Optomechanical heat transfer between molecules in a nanoplasmonic cavity. Phys. Rev. A 100, 013826 (2019).
27. 27.
Barato, A. C. & Seifert, U. Thermodynamic uncertainty relation for biomolecular processes. Phys. Rev. Lett. 114, 158101 (2015).
28. 28.
Gingrich, T. R., Horowitz, J. M., Perunov, N. & England, J. L. Dissipation bounds all steady state current fluctuations. Phys. Rev. Lett. 116, 120601 (2016).
29. 29.
Polettini, M., Lazarescu, A. & Esposito, M. Tightening the uncertainty principle for stochastic currents. Phys. Rev. E 94, 052104 (2016).
30. 30.
Pietzonka, P., Ritort, F. & Seifert, U. Finite-time generalization of the thermodynamic uncertainty relation. Phys. Rev. E 96, 012101 (2017).
31. 31.
Horowitz, J. M. & Gingrich, T. R. Thermodynamic uncertainty relations constrain non-equilibrium fluctuations. Nat. Phys. 16, 15–20 (2020).
32. 32.
Saryal, S., Friedman, H. M., Segal, D. & Agarwalla, B. K. Thermodynamic uncertainty relation in thermal transport. Phys. Rev. E 100, 042101 (2019).
33. 33.
Timpanaro, A. M., Guarnieri, G., Goold, J. & Landi, G. T. Thermodynamic uncertainty relations from exchange fluctuation theorems. Phys. Rev. Lett. 123, 090604 (2019).
34. 34.
Hasegawa, Y. & Van Vu, T. Fluctuation theorem uncertainty relation. Phys. Rev. Lett. 123, 110602 (2019).
35. 35.
Li, J., Horowitz, J. M., Gingrich, T. R. & Fakhri, N. Quantifying dissipation using fluctuating currents. Nat. Commun. 10, 1666 (2019).
36. 36.
Dechant, A. & Sasa, S.-I. Fluctuation–response inequality out of equilibrium. Proc. Natl Acad. Sci. USA 117, 6430 (2020).
37. 37.
Pal, S., Saryal, S., Segal, D., Mahesh, T. S. & Agarwalla, B. K. Experimental study of the thermodynamic uncertainty relation. Phys. Rev. Res. 2, 022044(R) (2020).
38. 38.
Wei, X., Sheng, J., Yang, C., Wu, Y. & Wu, H. Controllable two-membrane-in-the-middle cavity optomechanical system. Phys. Rev. A 99, 023851 (2019).
39. 39.
Sheng, J., Wei, X., Yang, C. & Wu, H. Self-organized synchronization of phonon lasers. Phys. Rev. Lett. 124, 053604 (2020).
40. 40.
Wu, S., Sheng, J., Zhang, X., Wu, Y. & Wu, H. Parametric excitation of a SiN membrane via piezoelectricity. AIP Adv. 8, 015209 (2018).
41. 41.
Aspelmeyer, M., Kippenberg, T. J. & Marquardt, F. Cavity optomechanics. Rev. Mod. Phys. 86, 1391 (2014).
42. 42.
Marquardt, F., Chen, J. P., Clerk, A. A. & Girvin, S. M. Quantum theory of cavity-assisted sideband cooling of mechanical motion. Phys. Rev. Lett. 99, 093902 (2007).
43. 43.
Groblacher, S., Hammerer, K., Vanner, M. R. & Aspelmeyer, M. Observation of strong coupling between a micromechanical resonator and an optical cavity field. Nature 460, 724–727 (2009).
44. 44.
Barton, G. Classical van der Waals heat flow between oscillators and between half-spaces. J. Phys. Condens. Matter. 27, 214005 (2015).
45. 45.
Bérut, A., Imparato, A., Petrosyan, A. & Ciliberto, S. Stationary and transient fluctuation theorems for effective heat fluxes between hydrodynamically coupled particles in optical traps. Phys. Rev. Lett. 116, 068301 (2016).
46. 46.
Nielsen, W. H. P., Tsaturyan, Y., Møller, C. B., Polzik, E. S. & Schliesser, A. Multimode optomechanical system in the quantum regime. Proc. Natl Acad. Sci. USA 114, 62 (2017).
## Acknowledgements
We thank Jordan M. Horowitz for helpful discussions. This research was supported by the National Key R&D Program of China (No. 2017YFA0304201), NSFC (No. 11925401, No. 11734008, No. 11974115, and No. 11704126, No. 11621404), the Shanghai Committee of Science and Technology (No. 17JC1400500), the Program for Professor of Special Appointment (Eastern Scholar) at Shanghai Institutions of Higher Learning.
## Author information
Authors
### Contributions
C.Y., X.W., J.S., and H.W. carried out the experiment, analyzed the data, and developed the theory. J.S. and H.W. wrote the paper with input from all authors.
### Corresponding authors
Correspondence to Jiteng Sheng or Haibin Wu.
## Ethics declarations
### Competing interests
The authors declare no competing interests.
Peer review information Nature Communications thanks Seunghwi Kim and the other anonymous reviewers for their contribution to the peer review of this work. Peer reviewer reports are available.
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
## Rights and permissions
Reprints and Permissions
Yang, C., Wei, X., Sheng, J. et al. Phonon heat transport in cavity-mediated optomechanical nanoresonators. Nat Commun 11, 4656 (2020). https://doi.org/10.1038/s41467-020-18426-4
• Accepted:
• Published:
|
2020-10-27 18:58:43
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8004055619239807, "perplexity": 1795.5865745399587}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-45/segments/1603107894426.63/warc/CC-MAIN-20201027170516-20201027200516-00195.warc.gz"}
|
https://www.physicsforums.com/threads/how-to-differentiate-a-term-with-respect-to-metric.809697/
|
# How to differentiate a term with respect to metric
1. Apr 20, 2015
### the_doors
1. The problem statement, all variables and given/known data
for example: $\frac{\partial(F^{ab}F_{ab})}{ \partial g^{ab}}$ where F_{ab} is electromagnetic tensor.
or $\frac{\partial N_{a}}{\partial g^{ab}}$ where $N_{a}(x^{b})$ is a vector field.
2. Relevant equations
3. The attempt at a solution
i saw people write $F^{ab}F_{ab}$ as $g^{ca}g^{db}F_{cd} F_{ab}$ and say we write the term in a way that exposes the dependence on the metric. but exactly what it means ?
2. Apr 21, 2015
### Orodruin
Staff Emeritus
You need to write your function in terms of the variables you have, in your case $g^{ab}$ and $F_{ab}$. The contravariant $F^{ab}$ is not independent of those and so will have non zero partial derivatives wrt both. Writing it in terms of your variables lets you differentiate easier.
As a similar example: Take $f(x,y) = xy$. The partial derivative $\partial_yf$ is simply $\partial_y (xy) = x$. This is essentially the same. Do not be confused by the fact that you use the same letter to denote the covariant and contravariant tensors.
3. Apr 21, 2015
### the_doors
for example if $N_{\mu}(x^\nu)$ be unit time like dynamical four velocity, what's happening ? i don't know explicit form of $N_{\mu}$.
4. Apr 21, 2015
### the_doors
ok we can write for first example:$\frac {\partial (g^{ca}g^{db}F_{cd}F_{ab})}{\partial g^{ef}}$ = $\frac{\partial g^{ca}}{\partial g^{ef}}g^{db}F_{cd}F_{ab}+\frac{\partial g^{db}}{\partial g^{ef}}g^{ca}F_{cd}F_{ab}+\frac{\partial F_{cd}}{\partial g^{ef}}g^{ca}g^{db}F_{ab}+\frac{\partial F_{ab}}{\partial g^{ef}}g^{ca}g^{db}F_{cd}$ . is it correct ?
$\frac{\partial g^{ca}}{\partial g^{ef}}=\delta^c_{e} \delta^a_{f}$ is it correct ?
what's happening for $\frac{\partial F_{cd}}{\partial g^{ef}}$ ?
|
2017-12-16 23:04:33
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8784154653549194, "perplexity": 446.8156521645902}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-51/segments/1512948589512.63/warc/CC-MAIN-20171216220904-20171217002904-00487.warc.gz"}
|
http://math.stackexchange.com/questions/448715/i-read-that-ordinal-numbers-relate-to-length-while-cardinal-numbers-relate-to-s
|
# I read that ordinal numbers relate to length, while cardinal numbers relate to size. How do 'length' and 'size' differ?
I read that ordinal numbers relate to length, while cardinal numbers relate to size. How do 'length' and 'size' differ? Note : I am an absolute novice, and I'm having a little trouble visualizing ordinal numbers.
-
Where did you read that (esp. ordinals=length)? Better: Ordinals refer not only to the size of a set, but also how its elements are ordered. – Hagen von Eitzen Jul 21 '13 at 11:37
This is the link:ls.poly.edu/~jbain/Cat/lectures/07.OrdsandCards.pdf. – Novice Jul 21 '13 at 11:38
If the line to the bathroom is finite, then the length and the number of people in that line is the same number.
However suppose that the line is infinite, but every person has to wait a finite time before entering the bathroom. Now comes another guy, and he has to wait until all those before him get in before he can use the facilities.
In terms of cardinality we didn't increase the line, but its length is longer by one person now.
Formally, the infinite line where every person has to wait a finite amount of time is $\Bbb N$ with the order $\leq$. Indeed every natural number has only finitely many predecessors. The next line is $\Bbb N\cup\{\bullet\}$, where $\bullet$ is some new element which is not a natural number and we decree that it is larger than all the natural numbers themselves.
So the order type of the new set is longer because it has an initial segment of order type $\Bbb N$, but another point above that. However the cardinality is the same. To see that note that the following map is a bijection between the two sets: $$f(n)=\begin{cases}\bullet & n=0\\ n-1 & n\neq 0\end{cases}$$
So we have a strictly longer line (and this poor guy who has to wait an infinite time before he can pee), but that line has the same number of people.
-
That was really illuminating, finally understood the difference between ordinality and cardinality. Thanks a lot :) – Novice Jul 21 '13 at 11:44
@Novice: You're welcome. – Asaf Karagila Jul 21 '13 at 12:20
The sanitary situation would be even worse if people were to enter largest number first. :) – Hagen von Eitzen Jul 21 '13 at 12:26
Example $6$ at the bottom of the first page of that PDF is a good example of the difference between size, on the one hand, and length and shape on the other, in the sense in which its author means those terms. Consider the following two ways of arranging the natural numbers. First, in their usual order:
$$\begin{array}{cc} 0&1&2&3&4&5&6&7&8&9&\cdots \end{array}\tag{1}$$
Then with the even numbers first, in their usual order, followed by the odd numbers in their usual order:
$$\begin{array}{cc} 0&2&4&6&8&\cdots&1&3&5&7&9&\cdots\\ \end{array}\tag{2}$$
It’s the same set $\Bbb N$ in both cases, so the in some sense two arrangements are certainly the same size. On the other hand, if we set them side by side, starting at the lefthand end, something very different happens:
$$\begin{array}{cc} 0&1&2&3&4&\cdots&n&\cdots&|\\ \hline\\ 0&2&4&6&8&\cdots&2n&\cdots&|&1&3&5&7&9&\cdots\\ \end{array}\tag{3}$$
The parts to the left of the vertical line match up perfectly, and there’s nothing in the top row to match up with the bottom row. Even though the top and bottom lines are arrangments of exactly the same set $\Bbb N$, in terms of the arrangement the bottom line is somehow twice as long as the top line. And yes, the unmatched part of the bottom line really does have the same shape as the matched part, as you can see from the following arrangement:
$$\begin{array}{cc} 0&1&2&3&4&5&6&7&\cdots&n&\cdots\\ \hline 0&2&4&6&8&10&12&14&\cdots&2n&\cdots\\ \hline 1&3&5&7&9&11&13&15&\cdots&2n+1&\cdots \end{array}\tag{4}$$
In more formal terminology, what the author calls size is known as cardinality. Two sets are said to have the same cardinality if there is a way to pair them up one for one, with nothing left over in either set; in technical terms, this means that there is a bijection between the two sets, a function that is one-to-one and onto. Clearly $\Bbb N$ can be paired up with itself in this fashion no matter how we rearrange it.
Length and shape are informal ways of talking about what is properly called the order type of a linear arrangement of a set. Let $E$ be the set of even natural numbers and $O$ the set of odd natural numbers. $(4)$ shows that we can pair up $\Bbb N$ with each of $E$ and $O$, and $E$ and $O$ with each other, in a one for one fashion, so these three sets all have the same cardinality (‘size’). On the other hand, we can pair up $\Bbb N$ with $E$ and then stick $O$ (in its usual order) after $E$, as in $(3)$ to get an arrangement that looks like two copies of $\Bbb N$ placed end to end:
$$\begin{array}{cc} 0&1&2&3&4&\cdots&n&\cdots&|&0&1&2&3&4&\cdots\\ \hline\\ 0&2&4&6&8&\cdots&2n&\cdots&|&1&3&5&7&9&\cdots\\ \end{array}\tag{5}$$
In terms of order type the arrangement $(2)$ is twice as long as $(1)$: it can be matched up one for one, preserving the order, with two copies of $(1)$ placed end to end, as in $(5)$.
This is all very informal, of course, but that may be helpful in getting started with the ideas.
-
|
2015-01-28 04:46:20
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7926708459854126, "perplexity": 226.38880395218584}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-06/segments/1422122123549.67/warc/CC-MAIN-20150124175523-00019-ip-10-180-212-252.ec2.internal.warc.gz"}
|
https://k12.libretexts.org/Bookshelves/Science_and_Technology/Book%3A_Physics_-_From_Stargazers_to_Starships_(CK-12)/05%3A_Making_a_Sundial/5.03%3A_Exploring_Further
|
# 5.3: Exploring Further
The “Sundial Bridge,” with a unique design which may well make it the largest sundial anywhere, opened July 4, 2004, in Turtle Bay Park (www.turtlebay.org/sundialbridge) in Redding, California, at the foot of Mt. Shasta. Designed by the innovative Spanish architect Santiago Calatrava, it resembles his stunning 1992 bridge (http://www.galinsky.com/buildings/alamillo/) erected in Seville, Spain. It is a pedestrian bridge, connecting two parts of Turtle Bay Park, and it also operates as a sundial, using plaques set in a semicircular upper plaza.
For a more detailed article about this bridge, see Sundial Bridge at Turtle Bay on Wikipedia: en.Wikipedia.org/wiki/Sundial_Bridge_at_Turtle_Bay.
Before the days of affordable wristwatches, people often carried a folding sundial in their pocket (“poke" below), with a small magnetic compass embedded, to show the north direction. In “As You Like It” by William Shakespeare (act 2, scene 7) one of the characters tells of meeting in the forest a fool (witty court entertainer) carrying such a “dial”:
“Good morrow, fool,” quoth I. “No, sir,” quoth he,
“Call me not fool till heaven sent me fortune:”
And then he drew a dial from his poke,
And, looking on it with lack-lustre eye
Says very wisely, “It is ten o'clock:
Thus we may see how the world wags:
'T is but an hour ago since it was nine;
And after one hour more 't will be eleven;
(and continues)
You may also be interested to know that a North American Sundial Society (NASS) exists, with its home page at http://sundials.org. The British Sundial Society also has its sundial page at http://www.sundials.co.uk/.
A sundial was included as part of the Mars lander mission and is shown in “Astronomy Picture of the Day” for April 28, 1999. It has a thick vertical gnomon, so that its readings may need some extra corrections.
For those with serious interest in history (and access to a good library): “The Material Culture of Astronomy in Daily Life: Sundials, Science and Social Change” by Sara Schechner (History of Sci. Dept., Harvard) Journal for the History of Astronomy Vol. 32, part 3, August 2001, p. 189-222, with many illustrations.
From the 1.1.2000 book catalog of Willman-Bell in Richmond, Virginia (www.willbell.com):
• Easy-to-make Wooden Sundials, by Stoneman, 38 pp., $4.95 • Sundials: History, Theory and Practice by Rohr, 230 pp,$12.95.
• Sundials: Their Theory and Construction by Waugh, 19 chapt., \$8.95
|
2021-06-17 21:46:24
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2552066445350647, "perplexity": 11516.116562285555}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-25/segments/1623487633444.37/warc/CC-MAIN-20210617192319-20210617222319-00211.warc.gz"}
|
https://eccc.weizmann.ac.il/report/2016/094/
|
Under the auspices of the Computational Complexity Foundation (CCF)
REPORTS > DETAIL:
### Paper:
TR16-094 | 6th June 2016 14:51
#### Non-commutative computations: lower bounds and polynomial identity testing
TR16-094
Authors: Guillaume Lagarde, Guillaume Malod
Publication: 6th June 2016 18:12
Keywords:
Abstract:
In the setting of non-commutative arithmetic computations, we define a class of circuits that gener-
alize algebraic branching programs (ABP). This model is called unambiguous because it captures the
polynomials in which all monomials are computed in a similar way (that is, all the parse trees are iso-
morphic).
We show that unambiguous circuits of polynomial size can compute polynomials that require ABPs
of exponential size, and that they are incomparable with skew circuits.
Generalizing a result of Nisan [17] on ABPs, we provide an exact characterization of the complexity
of any polynomial in our model, and use it to prove exponential lower bounds for explicit polynomials
such as the determinant.
Finally, we give a deterministic polynomial-time algorithm for polynomial identity testing (PIT) on unambiguous circuits over \$\mathbb{R}\$ and \$\mathbb{C}\$, thus providing the largest class of circuits so far in a non-commutative setting for which we can derandomize PIT.
### Comment(s):
Comment #1 to TR16-094 | 18th July 2016 09:04
#### Non-commutative computations: lower bounds and polynomial identity testing
Authors: Guillaume Lagarde, Guillaume Malod
Accepted on: 18th July 2016 09:04
Keywords:
Comment:
In the setting of non-commutative arithmetic computations, we define a class of circuits that gener-
alize algebraic branching programs (ABP). This model is called unambiguous because it captures the
polynomials in which all monomials are computed in a similar way (that is, all the parse trees are iso-
morphic).
We show that unambiguous circuits of polynomial size can compute polynomials that require ABPs
of exponential size, and that they are incomparable with skew circuits.
Generalizing a result of Nisan [17] on ABPs, we provide an exact characterization of the complexity
of any polynomial in our model, and use it to prove exponential lower bounds for explicit polynomials
such as the determinant.
Finally, we give a deterministic polynomial-time algorithm for polynomial identity testing (PIT) on unambiguous circuits over \$\mathbb{R}\$ and \$\mathbb{C}\$, thus providing the largest class of circuits so far in a non-commutative setting for which we can derandomize PIT.
ISSN 1433-8092 | Imprint
|
2019-05-23 09:59:58
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8458622097969055, "perplexity": 1818.955158254922}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232257197.14/warc/CC-MAIN-20190523083722-20190523105722-00416.warc.gz"}
|
http://tex.stackexchange.com/questions/19799/section-headers-not-sticking-with-first-paragraph
|
Section headers not sticking with first paragraph
I'm seeing lots of section/subsection headers getting split up from their paragraphs across page and column boundaries. I've never seen this before, but I'm also using a class file that's new to me, so I suspect it has something to do with a mistake in the class file itself. I'm a relative TeX novice and haven't ever spent much time with class files, so it's pretty overwhelming, but some spelunking has turned up some clues.
The full class file is available here, but what seems like a (potentially) relevant snippet is included below:
% Rationale for changes made in next four definitions:
% "Before skip" is made elastic to provide some give in setting columns (vs.
% parskip, which is non-elastic to keep section headers "anchored" to their
% subsequent text.
%
% "After skip" is minimized -- BUT setting it to 0pt resulted in run-in heads, despite
% the documentation asserted only after-skip < 0pt would have result.
%
% Baselineskip added to style to ensure multi-line section titles, and section heads
% followed by another section head rather than text, are decently spaced vertically.
% 12 Jan 2000 gkmt
\def\section{%
\@startsection{section}{1}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}%
}
\def\subsection{%
\@startsection{subsection}{2}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}
{0.5pt}{\baselineskip=14pt\secfnt}%
}
\def\subsubsection{%
\@startsection{subsubsection}{3}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}%
{0.5pt}{\baselineskip=14pt\subsecfnt}%
}
\def\paragraph{%
\@startsection{paragraph}{3}{\z@}{-10\p@ \@plus -4\p@ \@minus -2\p@}%
{0.5pt}{\baselineskip=14pt\subsecfnt}%
}
\let\@period=.
\def\@startsection#1#2#3#4#5#6{%
\if@noskipsec %gkmt, 11 aug 99
\global\let\@period\@empty
\leavevmode
\global\let\@period.%
\fi
\par
\@tempskipa #4\relax
\@afterindenttrue
\ifdim \@tempskipa <\z@
\@tempskipa -\@tempskipa
\@afterindentfalse
\fi
%\if@nobreak 11 Jan 00 gkmt
%\everypar{}
%\else
%\fi
\parskip=0pt
\@ifstar
{\@ssect{#3}{#4}{#5}{#6}}
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}%
}
There's a mention in the comments about keeping section headers "anchored" - is it possible one of these changes has caused the headers to become unanchored? When I'm stuck using Word, this is just "Keep with next", but it doesn't seem quite that simple here. What can I do about this? Is there anything in my .tex file I might be doing that could cause this?
-
Umm, yech. One definite problem is those commented-out chunks of code without putting a trailing % on the line before the commented-out chunk of code. That could make those macros inadvertently add white space which in turn will counteract LaTeX's control over widows (which is somewhat limited to start with). If you have to use that beast, you might have to insert some \vfill statements to force a new column/new page. – David Hammen Jun 3 '11 at 17:06
|
2015-09-01 03:55:52
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.782163143157959, "perplexity": 4489.762767852016}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-35/segments/1440645151768.51/warc/CC-MAIN-20150827031231-00340-ip-10-171-96-226.ec2.internal.warc.gz"}
|
https://questions.examside.com/past-years/gate/question/a-computer-has-a-256-k-byte-4-way-set-associative-write-back-gate-cse-2012-marks-2-uahv3gylntg9bm9e.htm
|
NEW
New Website Launch
Experience the best way to solve previous year questions with mock tests (very detailed analysis), bookmark your favourite questions, practice etc...
1
### GATE CSE 2012
A computer has a $$256$$ $$K$$ Byte, $$4$$-way set associative, write back data cache with block size of $$32$$ Bytes. The processor sends $$32$$ bit addresses to the cache controller. Each cache tag director $$y$$ entry contains, in addition to address tag, $$2$$ valid bits. $$1$$ modified bit and $$1$$ replacement bit.
The size of the cache tag directory is
A
$$160$$ $$K$$ bits
B
$$136$$ $$K$$ bits
C
$$40$$ $$K$$ bits
D
$$32$$ $$K$$ bits
2
### GATE CSE 2012
A computer has a $$256$$ $$K$$ Byte, $$4$$-way set associative, write back data cache with block size of $$32$$ Bytes. The processor sends $$32$$ bit addresses to the cache controller. Each cache tag director $$y$$ entry contains, in addition to address tag, $$2$$ valid bits. $$1$$ modified bit and $$1$$ replacement bit.
The number of bit in the tag field of an address is
A
$$11$$
B
$$14$$
C
$$16$$
D
$$27$$
3
### GATE CSE 2011
An $$8KB$$ direct-mapped write-back cache is organized as multiple blocks, each of size $$32$$-bytes. The processor generates $$32$$-bit addresses. The cache controller maintains the tag information for each cache block comprising of the following.
$$\,\,\,\,$$$$1$$ Valid bit
$$\,\,\,\,$$$$1$$ Modified bit
As many bits as the minimum needed to identify the memory block mapped in the cache.
What is the total size of memory needed at the cache controller to store meta-data (tags) for the cache?
A
$$4864$$ bits
B
$$6144$$ bits
C
$$6656$$ bits
D
$$5376$$ bits
4
### GATE CSE 2010
A computer system has an $$L1$$ cache, an $$L2$$ cache, and a main memory unit connected as shown below. The block size in $$L1$$ cache is $$4$$ words. The block size in $$L2$$ cache is $$16$$ words. The memory access times are $$2$$ nanoseconds, $$20$$ nanoseconds and $$200$$ nanoseconds for $$L1$$ cache, $$L2$$ cache and main memory unit respectively.
When there is a miss in $$L1$$ cache and a hit in $$L2$$ cache, a block is transferred from $$L2$$ cache to $$L1$$ cache. What is the time taken for this transfer?
A
$$2$$ nanoseconds
B
$$20$$ nanoseconds
C
$$22$$ nanoseconds
D
$$88$$ nanoseconds
Write for Us
Do you want to write for us? Help us by contributing to our platform.
### Joint Entrance Examination
JEE Main JEE Advanced WB JEE
### Graduate Aptitude Test in Engineering
GATE CSE GATE ECE GATE EE GATE ME GATE CE GATE PI GATE IN
NEET
Class 12
|
2022-06-25 17:20:44
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5085220336914062, "perplexity": 7057.030325366136}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103036077.8/warc/CC-MAIN-20220625160220-20220625190220-00587.warc.gz"}
|
https://www.folkstalk.com/2022/07/latex-sum-two-lines-subscript-with-code-examples.html
|
# Latex Sum Two Lines Subscript With Code Examples
Latex Sum Two Lines Subscript With Code Examples
Hello everyone, In this post, we will examine how to solve the Latex Sum Two Lines Subscript problem using the computer language.
$$\sum_{\substack{i=0 \\ i\neq j}}^n i^2$$
The Latex Sum Two Lines Subscript issue was overcome by employing a variety of different examples.
|
2022-08-19 15:09:45
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8988857865333557, "perplexity": 2367.1954978073136}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882573699.52/warc/CC-MAIN-20220819131019-20220819161019-00390.warc.gz"}
|
https://space.stackexchange.com/tags/energy/hot
|
# Tag Info
27
As far as I understand you want the "windmill" to drive a dynamo. Have you ever tried turning a dynamo? It takes some force to do so, and that force is then (partially) turned into electricity. So the dynamo is braking your windmill and unless there is some power input to the windmill (wind), it will eventually come to stop. But there is no wind so your ...
24
To flyby or impact Venus varies from 3.45 to 3.6 km/s from LEO for the optimal time every 19 months. Mars varies from 3.55 to 3.9 km/s for the optimal time every 26 months. So on average, getting to Venus is a little less energy than getting Mars. But not by much. It could even be a tiny bit more in some years. If you also want to get barely into orbit ...
21
No, not really. The atmosphere of Mars is very thin. It has below 1% of the pressure on Earth. That means it has less than 1% of the force of wind on Earth with the same speed. Wind only occures at dawn or dusk. Wind happens when there is a pressure gradient between two areas of an atmosphere. Pressure gradients are caused by temparature- and humidity ...
21
The maximum percentage wasted to noise is approximately 1%. The acoustic efficiency, defined as the ratio of the sound power to the rocket exhaust's mechanical power, for the majority of these data range between 0.2 and 1 percent...with 0.5% as the most probable value. NASA SP-8072 ACOUSTIC LOADS GENERATED BY THE PROPULSION SYSTEM Using the equation for ...
18
This is actually pretty difficult to do, because it depends on where from due to uneven distribution of matter (local parameters), how far from the galactic center due to radial velocity, the direction in which you want to reach escape velocity (how much of the radial velocity can be used), and that it's hard to estimate mass of the Milky Way (global ...
16
If you're asking about interstellar travel, then the answer is pretty simple; For diffuse, unfocused sources of light like the one emitted by stars, photon flux density decreases with the inverse square of the distance to its source, and with it photon pressure (imparted momentum of absorbed or, better yet, reflected photons) on the sail. So you accelerate ...
16
To beam the power to the rocket, especially when needing high acceleration, is not what I will expect to show up in the near future. However, separating the energy source from the propellant is the idea behind the nuclear thermal rocket. Here, energy comes from a reactor, and you can choose more freely in higher performing propellants. Because a NTR is ...
15
You'll need a nuclear reactor for that because the process of dissociation of water into constituent hydrogen and oxygen consumes vast amounts of energy and for an ascent stage you'll also need a very high energy density to provide sufficient thrust. Direct anode/cathode system like you describe (i.e. electrolysis) is wasteful when you don't require ...
15
No, it wouldn't work. In order to drive the treadmill, momentum would have to be transferred from the satellites to the treadmill. The sats would slow down and eventually stop. The "highway" itself wouldn't be stable, either. Since it's moving at a different speed from the satellites, it cannot be moving at circular orbital speed for its altitude by ...
15
A conventional thruster with two liquid propellants requires energy too. But it is chemical energy stored in the propellants. Ion thrusters use no chemical energy at all, all the energy of the ion beam is from the electrical energy used by the thruster. In fact, a conventional rocket engine with a lot more thrust than a ion thruster uses a lot more of ...
14
It is what your velocity would be at a sufficient distance from Earth that its gravity doesn't matter, squared. That velocity is $v_\infty$, so $C_3=v_\infty^2$. It can be calculated at any distance from Earth as your specific energy (energy per unit mass), times two: $C_3 = v_\infty^2 = v^2-{2\mu\over r}$ So wherever you are, use the magnitude of your ...
14
Human powered vehicles used within domed or cavern cities would seem to be extremely plausible. One way to look at it is a simple bicycle is less complex than a powered vehicle. The power source (aka a Human) is extremely complex and maintenance intensive, but given that we already have a functioning human and want to get that human to some other place, a ...
14
The second table here essentially answers your question. Venus transfer from Low Earth Orbit is 3.5 km/s, Mars transfer is 3.6. This will allow you to impact either body (on Venus you will need to make sure your vehicle is tough enough to actually impact, rather than dissolving in the atmosphere, but that's not really the point). In either case, you can ...
13
The ISS has a number of thermal management systems. The most visible part are the radiators attached to the main truss (they are the two sets of 3 white panels just to the left and right of middle, and yes, there's a tear towards the end of the first one on the right side) Those panels are part of the External Thermal Control System (ETCS), if I'm not ...
13
NO As a rule of thumb: if you think you invented either a way to generate infinite energy or infinite propellant: you are wrong. But [...] No. Always. Your craft will gain a velocity vector of e. To retrieve the bullets you need to apply to them a velocity vector of -e. If you do this using a liquid, the liquid will accelerate by e. If you do ...
12
The answer is a clear no because Hubble Space Telescope (HST) uses a fixed focal length of 57.6 m. The only thing you'd achieve by re-purposing it as a solar concentrator would be to melt its focal plane assembly and likely everything around it. HST is a Cassegrain reflector and its mirror assembly is utterly unsuitable to applications where adjustable focal ...
12
No: The heat produced by atmospheric reentry isn't a happy side effect of returning to the earth, it's a byproduct of the fact that your satellite/orbiter has enough kinetic energy to be circling the earth every 90 minutes and you want it to stop doing that and come down. To have something you've made for the purpose of harvesting energy reenter the ...
12
Well, we don't really know how much energy a Mars base would need, but we can make some rough estimates. Bases like McMurdo and Mawson have power capacities of several hundred to several thousand kilowatts. Now, we're talking about a Mars base, presumably we're going to need a little more power than that. Let's estimate that Mars Base One will require 10,...
12
Considering fuel consumption or energy expenditure may be misleading, because of the huge change in mass over the flight as fuel is expended. 2/3 of the fuel is expended by the first stage, which only produces 1/3 of the total velocity, for example. Another way to look at the question is through delta-v expenditure; according to Bob Braeunig's simulation ...
12
Consider the windmill as a system. If there is no wind blowing on the windmill, there is no energy being input into the system. If you pull power out of the windmill, energy is being output from the system. With an output and no input, whatever energy is in the system will be drained and not renewed.
12
Here's a brief answer since some people are trying to close the question and prevent answers: As @ikrase points out answers to the Physics SE question Why is the Peltier / Seebeck Effect's efficiency so low in practical devices? are helpful here. Briefly, there are two main parts to an RTG's conversion efficiency Thermodynamics limit The fraction of the ...
11
It would be highly problematic for reaction wheels to serve dual purposes as reaction control devices and energy storage mechanisms. It might be possible, but the implementation would be extremely complicated. Starting with a simpler case of a three-wheel design, a desired spacecraft attitude and/or slew rate uniquely determines the wheel speed. That is, ...
11
Very simple answer: You would need some kind of heating panels through which to let the water flow while it gets heated. Solar panels are thin slices of silicon. You will not be able to build the water heating panels lighter than the solar panels, and even if you somehow did, you would still have to carry a steam turbine. As a commenter already pointed out, ...
11
The thing to notice about this type of drive is that the ions encounter the positively charged accelerating grid first. The ions that provide the thrust to the rocket are positively charged as well, so they will be repelled and contained within the plasma chamber. The ions' only means of reaching the interior of the accelerating grid is diffusion, meaning an ...
10
There are two issues I see with this idea: The overall mass of the system necessary to be able to store meaningful amounts of energy. The effect of such a device on the attitude control capabilities of a spacecraft. If those can be solved, or at least mitigated, this might be a viable idea.
10
You are correct that flywheels can be used for energy storage like batteries. As with all engineering trades, this comes down to many factors: mass, cost, efficiency, lifetime, reliability ... Being in 0g means you don't have to support the weight of the flywheel on the bearings. That is an advantage, but not a huge one, compared to 1g. Having ...
10
Very simple answer. You are looking at the wrong metric for efficiency. The most expensive thing on a space station is not area, you don't pay per foot of "land" (and its associated sunlight) in space. The most expensive thing is mass, and getting it up there. A steam engine is heavy per unit power compared to a solar panel (especially when compared to the ...
10
Don't convert it into heat in the first place, and then don't dissipate it fast. MSL used an electromagnetic brake to slow the descent of the rover from the skycrane. It dissipated the energy into a resistor. Here, instead store the energy in a superconducting magnet. It can remain there as long as you can keep the magnet cold, and you can then either use ...
10
Unless the lubrication system fails in the dynamo that is in vacuum, electrical generation will work. Magnetic fields are unaffected by air or the lack of, at least at the level under consideration. Earth's magnetic field is too weak to have an effect on the generation of electricity by a dynamo. You can see how weak is the magnetic field of our planet by ...
Only top voted, non community-wiki answers of a minimum length are eligible
|
2022-01-29 08:58:52
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6370383501052856, "perplexity": 641.4870631117936}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320300573.3/warc/CC-MAIN-20220129062503-20220129092503-00691.warc.gz"}
|
http://www.physicsforums.com/showthread.php?s=456525a118ab7a30844509aac5de2997&p=4152126
|
## Creation and annihilation operators
Hi all
1. The problem statement, all variables and given/known data
Show:
$$(a^\dagger a)^2=a^\dagger a^\dagger a a +a^\dagger a$$
wheres:
$$a= \lambda x +i \gamma p$$
$$a^\dagger= \lambda x -i \gamma p$$
2. Relevant equations
-
3. The attempt at a solution
Well, I haven't got much.
I just tried to use the stuff given, put it into my equation and solve it, but I don't get to the right side.
I calculated a+a first
$$a^\dagger a ={\lambda}^2x^2 + \frac {1}{2} I + \gamma^2 p^2$$
But when I now try to calculate the square of that term I get lost. If I square it I get to:
$$(a^\dagger a)^2= \lambda^4x^4+\gamma^4p^4 +\lambda^2 \gamma^2 (x^2p^2+p^2x^2)-\lambda^2 x^2 -\gamma^2 p^2 +\frac 1 4 I$$
Can anyone help me with this? I don't know what to do now/ If I'm on the right way.
edit: I is the identity matrix
PhysOrg.com science news on PhysOrg.com >> Hong Kong launches first electric taxis>> Morocco to harness the wind in energy hunt>> Galaxy's Ring of Fire
(a$^{+}$a)$^{2}$ = a$^{=}$aa$^{+}$a =a$^{+}$(aa$^{+}$)a. Now try to get aa$^{+}$ in terms of a$^{+}$a.
Quote by grzz (a$^{+}$a)$^{2}$ = a$^{=}$aa$^{+}$a =a$^{+}$(aa$^{+}$)a. Now try to get aa$^{+}$ in terms of a$^{+}$a.
what does your a^= mean? I don't know this sign.
edit:
$$aa^\dagger=\lambda^2 x^2 + \frac 1 2 I +\gamma^2 p^2$$
## Creation and annihilation operators
You are supposed to see a with + as a superscript wherever you see a with ^ as a superscript.
Sorry for the trouble in the notation used.
I see a = not a + but I think it's just a typing mistake. so what you mean $$...= a^\dagger a a^\dagger a=a^\dagger (aa^\dagger) a$$ is that what you meant? I calculated my aa+ (see my post) and a+a is the same, though there's a minus infront of the I
Quote by Lindsayyyy I calculated my aa+ (see my post) and a+a is the same, though there's a minus infront of the I
"The same"? That difference in sign makes all the difference. Can you now relate $aa^{\dagger}$ to $a^{\dagger}a$?
With "the same" I meant the rest of the terms. Unlucky word choice from my side I guess. What do you mean with "can you now relate aa+ to a+a" do you mean that I should calculate $$(aa^\dagger) (a^\dagger a)$$ thanks for the help
No, I meant the relationship between $aa^{\dagger}$ and $a^{\dagger}a$ ie express one of them in terms of the other.
Yes that is what I meant. Allow me to use a+ to mean a with + as a superscript. So aa+ = a+a + 1. Now one more step.
Do you mean something like $$a^\dagger a = 2\lambda^2 x^2 +2 \gamma^2 x^2 -a a^\dagger$$ edit: nevermind, fail lol. I guess you meant what grzz just said. I have to eat dinner now. I'll try later or tomorrow and come back when I have further questions (I'm pretty sure I will have some :( ) Thanks so far for the help guys.
|
2013-05-19 05:51:23
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8079285025596619, "perplexity": 792.6230948682688}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-20/segments/1368696383508/warc/CC-MAIN-20130516092623-00073-ip-10-60-113-184.ec2.internal.warc.gz"}
|
https://askdev.io/questions/36879/how-can-i-transform-resolution-of-my-video-in-skype
|
How can I transform resolution of "my video" in Skype?
I have a logitech Quickcam Pro 9000 attached to my ubuntu desktop computer and also it functions great with Skype.
Nonetheless, Skype inputs and also sends my video at the indigenous (for the webcam I assume) resolution of 1600 x 1200. I can validate that the electronic camera sustains a variety of resolutions beginning with 160 x 120 upto 1600 x 1200 (consisting of as an example, 320 x 240, 352 x 288) making use of cheese. I can select these resolutions and also see the result is suitably scaled.
Additionally, I do not see any kind of renovations in level of smoothness of activity in the recorded video so I believe the initial 1600 x 1200 is reduced in the course someplace.
Is it feasible to in some way to enable this scaling capacity in the direction of Skype?
0
2019-05-13 04:04:37
Source Share
There need to be a skype arrangement documents in your house directory site:
~/.Skype/YourUserName/config.xml
(Replace YourUserName with your skype customer name). Open this documents with a full-screen editor, look for the <Video> tag and also attempt to modify it match your recommended resolution:
<Video>
<CaptureHeight>240</CaptureHeight>
<CaptureWidth>320</CaptureWidth>
</Video>
0
2019-06-01 11:43:05
Source
|
2021-01-22 22:43:44
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.207767516374588, "perplexity": 2644.020300930903}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703531429.49/warc/CC-MAIN-20210122210653-20210123000653-00332.warc.gz"}
|
https://www.physicsforums.com/threads/tricky-integral.93627/
|
# Tricky integral
relatively_me
I'm having trouble finding an integral table w/ this integral, or understanding a method to solve it...any hints would really be appreciated (the book directs us to use integral tables)
Int[e^(x^2) dx] limits->{-inf, +inf}
fahd
take x^2=t and proceed by parts...its fairly simple
relatively_me
thanks, i'll try that now
relatively_me
2x*e^(x^2) + x^2*e^(x^2)?
Pietjuh
You don't even have to calculate it to see it diverges to infinity, since exp(x^2) is a strictly increasing function on (0,inf), and is also positive for negative x.
amcavoy
Pietjuh said:
You don't even have to calculate it to see it diverges to infinity, since exp(x^2) is a strictly increasing function on (0,inf), and is also positive for negative x.
Are you sure the problem wasn't with a negative x2?
$$\int_{-\infty}^{\infty}e^{-x^2}\,dx=\sqrt{\pi}$$
Alex
Homework Helper
fahd said:
take x^2=t and proceed by parts...its fairly simple
I have no idea what you mean by that! What "parts" would you use? What would be u and what dv?
As others have pointed out, the infinite integral, as stated, does not exist. If that were $$e^{-x^2}$$ then it would be possible but certainly not "fairly simple"- there is no elementary anti-derivative.
Taviii
e^x^2=e^x*e^x
so
e^x=t
e^xdx=dt......replace in your exercesise and it should be easy from now on!
Homework Helper
Yes, if I had to integrate
$$\int (e^x)^2dx$$
I guess I could do that- although I think I would be more likely to simply write
$$(e^x)^2= e^{2x}$$
$$\int e^{x^2}dx$$
and it is well known that that has no elementary anti-derivative.
1800bigk
if you are in analysis it can be solved using riemann-stieltjes or lebesgue theory, I saw this problem before and there was a theorem we used, it has slipped my memory.
it was something like if f(x) is differentiable on [a,b] and f prime is continuous on [a,b] then you can convert the integrand to somethin easier to integrate (i forget the rest) sorry
Last edited:
what
Yea you can put it into http://integrals.wolfram.com and it gives you an answer that has in it the "imaginary error function", i take this to mean that the described integral won't be solvable by any normal means, so if it is just about whether or not it diverges then this is pretty simple because it is obvious that the integral diverges.
darkar
what said:
Yea you can put it into http://integrals.wolfram.com and it gives you an answer that has in it the "imaginary error function", i take this to mean that the described integral won't be solvable by any normal means, so if it is just about whether or not it diverges then this is pretty simple because it is obvious that the integral diverges.
I got this....sqrt(pi)Erfi(x)/2
What is that Erfi?
Homework Helper
Erfi is the imaginary error function above quoted by what (cool psuedonym).
BerkMath
Taviii said:
e^x^2=e^x*e^x
so
e^x=t
e^xdx=dt......replace in your exercesise and it should be easy from now on!
My guess is that Tavi will think things through before typing incorrect answers, next time.
|
2022-10-04 20:07:08
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9179106950759888, "perplexity": 691.1413744549847}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030337524.47/warc/CC-MAIN-20221004184523-20221004214523-00217.warc.gz"}
|
https://www.emerald.com/insight/content/doi/10.1108/978-1-83982-848-520211004/full/html
|
# Polyvictimization in the Lives of North American Female University/College Students: The Contribution of Technology-Facilitated Abuse
ISBN: 978-1-83982-849-2, eISBN: 978-1-83982-848-5
Publication date: 4 June 2021
## Abstract
Polyvictimization means looking at multiple victimizations of different kinds that one person has experienced. Virtually, all of the work in this field focuses on the effects of childhood trauma and victimization on currently distressed children, and empirical and theoretical work on the intertwining of adult female offline and online abuse experiences is in short supply. Recently, however, some scholars are starting to fill these research gaps by generating data showing that Technology-Facilitated violence and abuse are part and parcel of women's polyvictimization experiences at institutions of higher education. This chapter provides an in-depth review of the extant social scientific literature on the role Technology-Facilitated violence and abuse plays in the polyvictimization of female college/university students. In addition to proposing new ways of knowing, we suggest progressive policies and practices aimed at preventing polyvictimization on the college campus.
## Citation
DeKeseredy, W.S., Stoneberg, D.M. and Lory, G.L. (2021), "Polyvictimization in the Lives of North American Female University/College Students: The Contribution of Technology-Facilitated Abuse", Bailey, J., Flynn, A. and Henry, N. (Ed.) The Emerald International Handbook of Technology Facilitated Violence and Abuse (Emerald Studies In Digital Crime, Technology and Social Harms), Emerald Publishing Limited, Bingley, pp. 65-81. https://doi.org/10.1108/978-1-83982-848-520211004
## Publisher
:
Emerald Publishing Limited
Copyright © 2021 Walter S. DeKeseredy, Danielle M. Stoneberg, and Gabrielle L. Lory. Published by Emerald Publishing Limited. This chapter is published under the Creative Commons Attribution (CC BY 4.0) licence. Anyone may reproduce, distribute, translate and create derivative works of these chapters (for both commercial and non-commercial purposes), subject to full attribution to the original publication and authors. The full terms of this licence may be seen at http://creativecommons.org/licences/by/4.0/legalcode.
## License
This chapter is published under the Creative Commons Attribution (CC BY 4.0) licence. Anyone may reproduce, distribute, translate and create derivative works of these chapters (for both commercial and non-commercial purposes), subject to full attribution to the original publication and authors. The full terms of this licence may be seen at http://creativecommons.org/licences/by/4.0/legalcode.
## Introduction
Male-to-female abuse on North American university/college campuses is not a new social problem. This field of study started almost 65 years ago when Kirkpatrick and Kanin (1957) found that 20% of women in one US institution of higher education experienced attempted or completed rape in a one-year time period. At that juncture, their data garnered little, if any, attention from the academic community, policy makers, journalists, and the general public. It was not until the late 1980s that a new wave of feminist survey researchers uncovered similar alarmingly high rates of male physical and sexual assaults on female undergraduate students (e.g., DeKeseredy, 1988; Koss, Gidycz, & Wisniewski, 1987), and the issue of abuse against women on campuses started to get extensive publicity (DeKeseredy, 2017). Even so, despite the compelling results of two North American national surveys (see DeKeseredy & Schwartz, 1998; Koss et al., 1987), the legacy of university/college administrators ignoring the plight of survivors continued, and there was a major antifeminist backlash effort in the late 1980s and throughout the following decade (Schwartz, 2015).
The backlash continues today (see DeKeseredy, 2019), but some progressive tectonic shifts occurred in the early and middle part of the last decade in relation to woman abuse on campus. In the United States, due to the ongoing work of feminist coalitions, the formation of the White House Task Force to Protect Students from Sexual Assault in 2014, the widespread viewing of Kirby Dick's 2015 documentary The Hunting Ground, and the passage of the federal Sexual Violence Elimination Act (SaVE) in 2013, many people now view sexual assault and other crimes against female students as the “current problem of the day” on university/college campuses and their immediate surroundings (DeKeseredy, 2018a, p. 204). The same recognition of the issue can be seen in some parts of Canada. For instance, on October 28, 2016, the Quebec government announced spending $200 million (CAD) on a five-year strategy to prevent sexual violence and$500,000 of that amount went to resources and campaigns on postsecondary school campuses.
The antifeminist backlash against feminist empirical, theoretical, and policy work on male assaults on female postsecondary students will persevere. So will innovative, progressive scholarly contributions to the field; one of which is the study of how Technology-Facilitated abuse contributes to polyvictimization in the lives of North American female university/college students. This concept simply means looking at multiple victimizations of different kinds that one person has experienced (Mitchell, Segura, Jones, & Turner, 2018). There is a large literature on polyvictimization, but it focuses mainly on the extent to which multiple childhood victimizations can predict various problems in functioning in later childhood or adolescence (DeKeseredy, Schwartz, Nolan, Mastron, & Hall-Sanchez, 2019a; Dierkhising, Ford, Branson, Grasso, & Lee, 2019; Ford & Delker, 2019). Dozens of studies found that multiple victimizations can result in a variety of poor outcomes, be it youth crime, school failure, or any other psychological disturbance (Hamby et al., 2018; Musicaro et al., 2019; Wolfe, 2018). This can be the result of repeated episodes of the same behavior, such as sexual abuse or physical violence, or numerous victimizations, as some children are subject to a broad array of damaging behaviors.
Rigorous empirical and theoretical work on the intertwining of North American female university/college students' offline and online abusive experiences are scarce, but a small group of scholars are starting to address this research gap by uncovering data showing that Technology-Facilitated abuse is part and parcel of women's polyvictimization experiences at institutions of higher education. Following the approach taken by the contributors to White, Koss, and Kazdin's (2011) anthology Violence Against Women and Children: Mapping the Terrain, this chapter answers what White et al. (2011) refer to as “three seemingly simple questions”: what do we know? how do we know it? and what are the next steps? (p. xx). In other words, the chapter provides an in-depth review of the extant empirical and theoretical literature on the role Technology-Facilitated abuse plays in the polyvictimization of female university/college students and suggests new avenues of inquiry. The first section reviews the work done by researchers in this field. The second section examines new directions in research, and the third section proposes a multipronged method of targeting the relationship between offline and online victimization.
## Polyvictimization in the Lives of Female Postsecondary School Students: What Do We Know and How Do We Know It?
To date, polyvictimization researchers have not turned extensive attention to the abusive experiences of adults in general. Even when university/college-aged adults were studied, the main concern was the effect of childhood multiple victimizations on current behavior. For example, Alexander, Amerigo, and Harrelson (2018) found that polyvictimization was the best predictor of what they termed “risky sexual behavior” among postsecondary school women (p. 345), whereas Espelage, Hong, and Mebane (2016) and Holt et al. (2017) found childhood polyvictimization related to current psychological functioning among such students.
A major exception in the polyvictimization literature is elder abuse, where Hamby, Smith, Mitchell, and Turner (2016) recommend that new studies use the concept of polyvictimization to develop a broader understanding of the abused elderly. DeKeseredy et al. (2019a) also show that polyvictimization can be used to study adult problems. Using data derived from the Campus Quality of Life Survey (CQLS) recently administered at a large residential university in the South Atlantic region of the United States, the authors found that a variety of abusive behaviors touch many female students' lives and that many of these students suffer these victimizations multiple times. However, it is unclear from their findings whether offline assaults intertwine with those that are online because their composite measures of stalking and sexual harassment conflate in-person and electronic forms of victimization. In other words, they created two variables (one for stalking and one for sexual harassment) that combined offline and online forms of these two types of abuse.
This does not mean that CQLS data cannot be used to determine such intertwining. For example, DeKeseredy et al. (2019b) found that 21% (n = 633) of the total CQLS female sample (n = 3,271) received unwanted electronic sexual messages/images, including pornography. They also found that 18.2% (n = 551) experienced at least one of eight types of intimate physical violence, and 34% (n = 1,041) were targets of at least one of five variants of offline sexual assault. Moreover, female CQLS respondents who reported receiving these unwanted electronic sexual messages/images were 3.4 times more likely to state that they had been sexually assaulted offline than women who did not receive them. Additionally, women who reported getting these messages/images were twice more likely to report offline intimate physical violence as respondents who were not sent these media.
Thirty-four percent (n = 1,041) of the CQLS female respondents reported being targets of Technology-Facilitated stalking. Those respondents were 2.3 times more likely to report an offline sexual assault than women who were not victimized. As well, participants who reported electronic forms of stalking were 2.6 times more likely to report intimate physical violence than women who did not report stalking.
These findings are not surprising given the small but expanding base of university/college-based research which shows that female students' cyber victimization and in-person experiences of psychological, physical, and sexual abuse are related (Marganski & Melander, 2018; Marganski, Melander, & DeKeseredy, 2020; Reed, Tolman, & Ward, 2016; Sargent, Krauss, Jouriles, & McDonald, 2016). Nonetheless, except for studies done by DeKeseredy et al. (2019a) and DeKeseredy et al. (2019b), all the data on the linkage between cyber violence and the in-person victimization of college students come from surveys administered to convenience samples, and, thus, the data are not generalizable (Dragiewicz et al., 2019; Marganski & Melander, 2018). Another major limitation, one shared by the above two studies done by DeKeseredy and his colleagues, is that it is unclear which victimization (i.e., offline or online) occurred first (DeKeseredy & Rennison, 2019). Some researchers and practitioners contend that effective policy and program development requires knowing if technology-facilitated abusive behaviors are precursors to face-to-face abusive acts or if they occurred with or after them (Marganski & Melander, 2018).
What are the key determinants of the polyvictimization described here? So far, there are very few answers to this question. DeKeseredy et al. (2019a) found that one of the most powerful predictors is negative peer support, which is also strongly associated with image-based sexual abuse (DeKeseredy & Schwartz, 2016), another harm examined by those who study Technology-Facilitated violence and abuse. There are various definitions of negative peer support, but for the purpose of their study, DeKeseredy et al. (2019b) operationalized a revised rendition of DeKeseredy's (1988) definition of male peer support to refer to attachments to peers and the resources they provide that encourage and justify violence against women. DeKeseredy et al. (2019a) also used the same definition and operationalized it the same way in their study of polyvictimization.
Two types of negative peer support predicted digital victimization and both violence committed by an intimate partner and sexual assault: (1) proabuse informational support and (2) attachments to abusive peers. The former refers to guidance and advice that influence people to sexually, physically, and psychologically abuse their dating partners, and the latter is defined as having friends who sexually, physically, and psychologically victimize dating partners (DeKeseredy & Schwartz, 1998).
DeKeseredy et al. (2019b) found that female CQLS respondents who reported having both types of negative peer support were more than twice as likely to reveal that they had received unwanted sexual messages/images as those who did not report negative peer associations. Respondents who reported receiving proabuse informational support were 50% more likely to state that an intimate partner physically assaulted them. What is more, participants who reported attachments to abusive peers were 2.7 times more likely to report such violence.
Respondents who reported receiving proabuse informational support were two times more likely to report Technology-Facilitated stalking than female respondents who did not receive such support (DeKeseredy et al., 2019b). Respondents with attachment to abusive peers were nearly three times as likely to report Technology-Facilitated stalking than those who did not have these associations. Furthermore, respondents who reported receiving proabuse informational support were 50% more likely to state having been targeted by intimate physical violence. Similarly, participants who reported attachments to abusive peers were 2.7 times more likely to report such violence. The two types of negative peer support are key predictors of offline sexual assault. Still, the relationships reported here should not be interpreted as causal because it is unknown whether victimization or peer support came first.
More recently, Marganski et al.’s (2020) convenience sample data show that the following factors are significantly related to intimate partner polyvictimization (e.g., psychological, physical, sexual, and cyber): friends' and family members' perceptions of respondents' intimate relationships; family connectedness (e.g., dimensions of respondents' relationships with their families); respondents' attitudes about sex with their current intimate partner; and being in an exclusive relationship (e.g., neither partner is romantically pursuing other partners). DeKeseredy et al.’s (2019b) and Marganski et al.’s (2020) studies of Technology-Facilitated abuse in the contexts of offline types reveal that there is extensive polyvictimization among US university/college students, at least at two institutions of higher education. British radical feminist Liz Kelly (1987, 1988) would likely argue that the multiple abusive behaviors that these students experienced exist on a continuum of sexual violence, ranging from nonphysical acts like sexual harassment to physical acts such as rape. Although the idea of the continuum is often used to portray movement from least serious to most serious, for Kelly (1988), and those who follow in her footsteps (e.g., DeKeseredy et al., 2019a), all of these behaviors are serious and have a “basic common character” (p. 76). No behavior on the continuum is automatically considered more harmful than another, and, as Kelly (1988) states, women's experiences
…shade into and out of a given category, such as sexual harassment, which includes looks, gestures and remarks as well as acts which may be defined as assault or rape.
(p. 48)
In sum, the concepts of polyvictimization and the continuum of sexual violence help us focus attention on the cumulative effects of a broad range of highly injurious interrelated behaviors that women experience, many of which are both exempt from the coverage or scope of criminal law and simultaneously trivialized or minimized by the general public and the media (DeKeseredy & Rennison, 2019; McGlynn, Rackley, & Houghton, 2017). Researchers have devoted extensive energy to analyzing the long-term effects of specific instances of sexual harassment, sexual violence, stalking, physical assault, and other harms, or have analyzed repeated patterns of one of these, such as violence against a partner. Still, for many women, these forms of abuse “seep into one another” (DeKeseredy et al., 2019a; Ptacek, 2016; Wolfe, 2018).
## Next Steps in Research
Six years ago, Henry and Powell (2015) noted that “as a result of the gender-blindness within studies of virtual or cyber criminality, the conceptualization of technology-mediated ‘harm’ against women remains significantly underdeveloped” (p. 764). At that time, there was a conspicuous absence of feminist empirical and theoretical work on Technology-Facilitated abuse. Documented by DeKeseredy and Schwartz (2016), researchers mainly examined the explanatory value of gender-blind perspectives (Reyns, Henson, & Holt, 2016), such as Cohen and Felson's (1979) routine activity theory and Gottfredson and Hirschi's (1990) general theory of crime. Now, a growing international cadre of scholars produces ample evidence of a strong relationship between gender and women's risk of being targeted by Technology-Facilitated abuse that cannot be adequately accounted for through the use of “male-stream” theories. Consider that one of the two polyvictimization studies reviewed here statistically supports Powell and Henry's (2017) claim that “peer support for sexual violence against women emerges as a particularly challenging and troubling feature of sexual violence in the digital age” (p. 5).
More research is required, including the collection of data that clarifies the temporal order of key variables. Again, it is unclear whether certain abusive behaviors are precursors to others or if they occurred with or after them (Marganski & Melander, 2018). More research on polyvictimization experiences is also necessary in other country contexts, as well as an international comparative study that includes students and members of the general public. We know there is extensive polyvictimization among US college students, but we do not know whether female members of the general population are likewise at higher or lower risk. As studies of adult polyvictimization are rare, these new empirical directions will help fill a major research gap.
The vast majority of quantitative studies conducted on campus are climate surveys that measure the victimization experiences of both men and women. As such, research on male perpetrators of woman abuse on and off campuses is scarce (DeKeseredy, 2020a; Wendt, 2016), and this type of work has, thus, provided “little context in which acts take place” (Dragiewicz et al., 2019, p. 11). As Foubert, Clark-Taylor, and Wall (2020) observe
…the literature lacks a recent, clear understanding of the number of college men who commit… assault, the number of… assaults each perpetrator commits, and the relationship to traditional all male-campus groups such as fraternities and athletic groups.
(p. 297)
If numerous female students experience polyvictimization, it is likely that many men engage in multiple assaults of different kinds, but there is no conclusive evidence to support this hypothesis at this juncture. Yet, Foubert et al.’s (2020) research reveals that many men enrolled at institutions of higher education in a Midwestern part of the United States committed multiple alcohol-related sexual assaults, which polyvictimization literature suggests is an indicator that they may also have committed multiple types of other assaults (i.e., physical, mental) on women.
Statistics on men not only give us data on the extent and distribution of polyperpetration but also shed light on causal factors, such as male peer support. Male peer support for various types of violence against women is ubiquitous and has a long history (DeKeseredy & Schwartz, 2013). Quantitative and qualitative research done to date is highly informative, but there is still much we do not know about the connection between proabuse peer dynamics and the intertwining of offline and online means of abusing women (DeKeseredy et al., 2019b). For instance, some men victimize women but do not communicate with abusive friends on a face-to-face basis (DeKeseredy & Olsson, 2011; DeKeseredy & Schwartz, 2016), and there may be other environments or places in which their peers influence them to abuse women, such as patriarchal online communities with members who never meet in person but often exchange written, audio, and visual communication with their peers (DeKeseredy & Corsianos, 2016; Dragiewicz, 2011; Kimmel, 2008; Salter, 2017). Hence, another essential question is whether peer support for polyperpetration is mainly offline, online, or a combination of both (DeKeseredy & Schwartz, 2016).
There are other major gaps in our knowledge of the polyvictimization of female postsecondary students. Besides additional quantitative work, in-depth interviews with women are needed to understand the impact of their repeated victimization. Interviews with male polyperpetrators are also sorely needed and will provide answers to the question “Why does he do that?” (Bancroft, 2002). Another understudied area is whether the concepts of polyvictimization and polyperpetration are relevant specifically to the lives of LGBTQI university/college students.
Goodmark (2011) reminds us that, “When the first domestic violence and stalking laws were passed, no one could have foreseen how technology would facilitate abuse, stalking, and harassment” (p. 195). Documented by a growing number of studies, the co-occurrence of Technology-Facilitated abuse, in-person assaults, and other types of woman abuse is now in its endemic phase, possibly even worse than the widespread consumption of opioids and methamphetamine in West Virginia (DeKeseredy & Rennison, 2019). What is to be done? Most important of all are the responses by universities/colleges to this problem. Next, we turn to how these institutions of higher learning can enhance female students' health and safety.
## Preventing and Responding to University/College Campus Polyvictimization
After many years of developing campus programming, responses to woman abuse remain “widely varied” (Wooten & Mitchell, 2016, p. 1), even though bystander intervention is now the “centerpiece” of violence against women prevention strategies at most North American institutions of higher education (Henson, Fisher, & Reyns, 2020, p. 506). Bystander intervention refers to people who
…by their very presence, have the potential to do nothing, to step in and diffuse a high-risk situation… or to make the situation worse by condoning a perpetrator's behavior… or being unsupportive in responding to a victim.
(Banyard, 2011, p. 216)
In the United States, bystander intervention became the “gold standard” due to federal requirements to implement them as part of a broader sexual assault prevention strategy (Wooten & Mitchell, 2016). Bystander intervention programs attempt to increase the campus community's knowledge of various types of woman abuse, change students' acceptance of sexual assault and other types of violence, decrease rape myth acceptance, increase bystander intervention, and ultimately reduce the amount of sexual assault, interpersonal violence, and other such harms on college campuses (Henriksen, Mattick, & Fisher, 2016). Keep in mind, however, that bystander intervention in North American institutions of higher education prioritizes the prevention of offline rather than online abuse. Furthermore, as noted by Henson et al. (2020), “bystander intervention behaviors directed at online contexts are absent from both the online victimization and bystander intervention research” (p. 505).
Though bystander intervention was found to be an effective means of preventing both offline and online victimization (Henson et al., 2020), some cautionary notes are necessary. First, there is evidence of short-term effectiveness, but we know little about its long-term effects. Second, for bystander intervention to work during an online or offline attack, there must be a witness to the assault. Most acts of male-to-female abuse occur behind closed doors and not in public places. It is highly unlikely, then, that those physically victimized in private contexts and those who do not have online witnesses to their Technology-Facilitated abuse experiences will receive any type of intervention (DeKeseredy, 2018a; Henriksen et al., 2016; Hewitt & Beauregard, 2014).
Bystander intervention programs and most other campus-based prevention and intervention strategies are also “extremely heteronormative” (Wooten & Mitchell, 2016). Initiatives that meet the needs of sexual minorities are in short supply (DeKeseredy, 2018a; Ford & Soco-Marquez, 2016). What is more, violent and other types of assaults on members of the campus LGBTQI community must be addressed in the contexts in which LGBTQI lives are situated. Numerous LGBTQI survivors and offenders have experienced childhood abuse, partner violence, traumatic coming-out experiences, isolation, mental health problems, internalized homophobia, substance abuse, and a host of other problems (Ball, 2013; Guadalupe-Diaz, 2019; Messinger, 2017; Meyer, 2015).
This is not to say that bystander intervention training (both online and offline) should be abandoned. Rather, it should be used in conjunction with other strategies briefly discussed here, one of which is teaching students what White and Carmody (2018) refer to as online citizenship. This could entail senior students serving as mentors for junior students to model respectful and safe online communication. Of course, this type of mentoring should also be used to foster such communication in offline contexts. Senior campus administrators, too, need to contribute to this type of mentorship, and White and Carmody (2018) contend that this can be achieved by them rewarding students “who watch out for one another by telling their stories, awarding them honors and providing them with opportunities to develop and lead prevention programs” (p. 2304).
Training and education should always be major parts of any campus-based prevention strategy, and, in fact, the most widely supported intervention is some form of educational campaign. Not only does every researcher who has studied woman abuse in institutions of higher learning end up recommending educational interventions, but student and community groups who intensely study the harms covered in this chapter virtually always come to the conclusion that the first stop on the “road of change” is education. Generally, the argument goes, education campaigns are essential because without them, students will learn their “facts” from either gossip or the uninformed media (Bohmer & Parrot, 1993; Schwartz & DeKeseredy, 1997).
Since technology is constantly changing, university/college personnel responsible for education and program creation must constantly receive in-person training about new developments and trainers could “walk them through settings on their own devices, allowing them to ask questions in real time” (Dragiewicz et al., 2019, p. 37). It should also be noted that White and Carmody (2018) found that students prefer face-to-face education about preventing online victimization, but they want to be taught by their senior peers instead of university employees. As one of their respondents put it:
I think too a lot of administration sometimes doesn't get that… no matter how we make it, the facts are still the facts and they waste a lot of money going and making brochures and pamphlets when they have all these students who have been here who could actually have these real conversations with the freshmen as soon as they get here.
(White & Carmody, 2018, p. 2301)
Antipornography education is also essential for the following reasons. Every day, thousands of North American undergraduate and graduate students consume violent and racist internet pornography (DeKeseredy, 2020b). Nearly nine out of every ten men and one out of every three women aged 18–26 in the United States report accessing online porn (Lim, Carotte, & Hellard, 2016). As well, by age 17, 93% of boys and 62% of girls have been exposed to porn (Sabina, Wolak, & Finkelhor, 2008; Sun, Bridges, Johnson, & Ezzell, 2016). There are many harms associated with pornography, but violence against women is one of the most common (DeKeseredy, 2020b). Based on their own rich research experience and their review of the extant literature, Sun et al. (2016) note that “Research on pornography and violence against women in particular is long-standing, robust, and generally points to a positive association between the two….” (p. 1).
Violent and racist porn is definitely a component of the abuse of female university/college students (see DeKeseredy, 2020b), and many male students are graduates of what Bancroft (2002) coins as “the pornography school of sexuality” (p. 231). As Sun et al. (2016) recently discovered in their study of 487 male undergraduate students
…the more pornography a man watches, the more likely he is to use it during sex, request particular pornographic sex acts of his partner, deliberately conjure images of pornography during sex to maintain arousal, and have concerns over his own sexual performance.
(p. 983) (see also Keene, this volume)
Based on the above data, one would think that reducing and preventing pornography consumption would be a major goal of contemporary campus antiviolence programs. Yet, the harms done by porn are seldom addressed in these programs (DeKeseredy, 2018b). For campus educators and administrators, it is, then, essential to recognize that student consumption of porn is a widespread problem and will only get worse due to easy and free access to internet pornography. It is now time to demonstrate some progressive leadership by offering programs on gender issues that address porn in their schools. Many things can also be done on a personal level (Katz, 2006), such as talking to male students and male faculty in assemblies, classes, at sporting events, in faculty and staff training, and in private conversations. Additionally, university/college staff should employ the following strategies informed by the work of Thorne-Finch (1992, pp. 236–237) and Warshaw (1988, pp. 161–164): confront students, instructors, and athletic staff who speak positively about violent and dehumanizing pornography; confront students and staff who perpetuate rape myths; take every opportunity to speak out against porn and other symptoms of gender inequality; and create social media sites about the harms of pornography and how men and boys can work together to reduce the consumption, production, and distribution of hurtful sexual imagery.
The interventions proposed here constitute just the tip of the iceberg, and many more could be suggested. Regardless of which strategies are selected, faculty, staff, administrators, and students must be prepared to meet new challenges and develop new initiatives because woman abuse on campus is a “never ending and constantly evolving issue” (Ledwitz-Rigby, 1993, p. 93). This is particularly so in relation to digital technologies, as perpetrators are now “weaving technology into patterns of abuse” (Dragiewicz et al., 2019, p. 5). Undoubtedly, by the time you finish reading this chapter, there will be new electronic means of inflicting pain on people, and it is vital that university/college employees and students keep pace with the rapid spread of cyber harms such as those identified in this book.
The academic community still has much to learn about responding to and preventing polyvictimization, especially in the online contexts. No doubt, mistakes will be made, and there will be considerable resistance to change from “reinforcers of the status quo” (DeKeseredy, 2019). Nevertheless, again, one of the most important points to consider here is to avoid oversimplified solutions. Often, they do more harm than good and fail to address the many and complex sources of woman abuse in institutions of higher learning (Stark-Adamec, 1996a). What is required is a multiagency approach, one that involves the joint efforts of students, faculty, administrators, campus security, and many other members of the campus community. Woman abuse on campus, as well as other major expressions of gender inequality, cannot be stopped unless universities/colleges develop a collective responsibility to prevent it from occurring (Stark-Adamec, 1996b).
## Conclusion
Many North Americans share a vision of universities/colleges as peaceful sanctuaries from the “real world.” Institutions of higher education, too, are commonly seen as places where students, faculty, administrators, and support staff strive constantly to provide “practical solutions to the problems of the day” (Strong-Boag, 1996, p. 105). To some extent, these perceptions are correct. Yet, North American universities/colleges are also “hot spots” of male-to-female abuse as documented by decades of sound research. The burgeoning social scientific literature on the co-occurrence of offline and online victimization shows that things are getting worse. The research reported here, in fact, reveals that for many women “acts of abuse and violence are rarely singular, isolated events” (Wolfe, 2018, p. 833).
More studies of polyvictimization in the lives of female university/college students are sure to come, but it is also necessary to develop new, effective prevention and intervention initiatives. Experts on woman abuse collectively emphasize the importance of avoiding simplistic solutions and the value of a multipronged approach involving feminist digital activism, legal reforms, education and awareness programs, survivor support services, perpetrator re-education, and corporate efforts (Clevenger, 2016; DeKeseredy, Dragiewicz, & Schwartz, 2017; Hall & Hearn, 2018; Powell & Henry, 2017; Powell & Sugiura, 2019). There are other useful strategies to consider, but it is essential to always keep in mind that
Ending abuse is not only about specialized services delivered by trained individuals. It is perhaps more importantly about “humdrum” cultural change in which everyone does things a little differently every day.
(Klein, 2012, p. 127)
All members of university/college communities can play a key role in reducing women's experiences of polyvictimization.
## References
Alexander et al., 2018 Alexander, A. A. , Amerigo, L. S. , & Harrelson, M. E. (2018). Polyvictimization and sexual risk behaviors in college-aged women. Criminal Justice Review, 43(3), 345359. doi:10.1177/0734016818767727
Ball, 2013 Ball, M. (2013). Heteronormativity, homonormativity and violence. In K. Carrington , M. Ball , E. O'Brien , & J. Tauri (Eds.), Crime, justice and social democracy: International perspectives (pp. 186199). New York, NY: Palgrave Macmillan.
Bancroft, 2002 Bancroft, L. (2002). Why does he do that? Inside the minds of angry and controlling men. New York, NY: Penguin.
Banyard, 2011 Banyard, V. L. (2011). Who will help prevent sexual violence: Creating an ecological model of bystander intervention. Psychology of Violence, 1(3), 216229. doi:10.1037/a0023739
Bohmer and Parrot, 1993 Bohmer, C. , & Parrot, A. (1993). Sexual assault on campus: The problem and the solution. New York, NY: Lexington.
Clevenger, 2016 Clevenger, S. (2016). Future directions. In J. N. Navarro , S. Clevenger , & C. D. Marcum (Eds.), The intersection between intimate partner abuse, technology, and cybercrime: Examining the virtual enemy (pp. 205217). Durham, NC: Carolina Academic Press.
Cohen and Felson, 1979 Cohen, L. E. , & Felson, M. (1979). Social change and crime rate trends: A routine activity approach. American Sociological Review, 44(4), 588608. doi:10.2307/2094589
DeKeseredy, 1988 DeKeseredy, W. S. (1988). Woman abuse in dating relationships: The role of male peer support. Toronto, ON: Canadian Scholars’ Press.
DeKeseredy, 2017 DeKeseredy, W. S. (2017). Explaining campus violence against women: Unhealthy masculinity and male peer support. In C. Kaukinen , M. Hughes Miller , & R. A. Powers (Eds.), Addressing violence against women on college campuses (pp. 6577). Philadelphia, PA: Temple University Press.
DeKeseredy, 2018a DeKeseredy, W. S. (2018a). Sexual assault on the college campus. In P. Lussier , & E. Beauregard (Eds.), Sexual offending: A criminological perspective (pp. 204219). New York, NY: Routledge.
DeKeseredy, 2018b DeKeseredy, W. S. (2018b). Confronting adult pornography. In W. S. DeKeseredy & M. Dragiewicz (Eds.), Routledge handbook of critical criminology (2nd ed., pp. 455464). London: Routledge.
DeKeseredy, 2019 DeKeseredy, W. S. (2019). Defenders of freedom or perpetrators and facilitators of crimes? Beyond progressive retreatism in the Trump era. Victims and Offenders, 14(8), 925939. doi:10.1080/15564886.2019.1671282
DeKeseredy, 2020a DeKeseredy, W. S. (2020a). Enhancing feminist understandings of violence against women: Looking to the future. In S. Walklate , K. Fitz-Gibbon , J. Maher , & J. McCulloch (Eds.), The Emerald handbook of feminism, criminology, and social change (pp. 337355). Bingley: Emerald Publishing Limited.
DeKeseredy, 2020b DeKeseredy, W. S. (2020b). Understanding the harms of pornography: The contribution of social scientific knowledge. Sterling, MA: Culture Reframed. Retrieved from https://www.culturereframed.org/wp-content/uploads/2020/02/CR_Harms_of_Porn_Report_2020.pdf
DeKeseredy and Corsianos, 2016 DeKeseredy, W. S. , & Corsianos, M. (2016). Violence against women in pornography. London: Routledge.
DeKeseredy et al., 2017 DeKeseredy, W. S. , Dragiewicz, M. , & Schwartz, M. D. (2017). Abusive endings: Separation and divorce violence against women. Oakland, CA: University of California Press.
DeKeseredy and Olsson, 2011 DeKeseredy, W. S. , & Olsson, P. (2011). Adult pornography, male peer support, and violence against women: The contribution of the “dark side” of the Internet. In M. V. Vargas Martin , M. Garcia Ruiz , & A. Edwards (Eds.), Technology for facilitating humanity and combating social deviations: Interdisciplinary perspectives (pp. 3450). Hershey, PA: IGI Global.
DeKeseredy and Rennison, 2019 DeKeseredy, W. S. , & Rennison, C. M. (2019). Key issues in the rape and sexual assault of adult women. In W. S. DeKeseredy , C. M. Rennison , & A. K. Hall-Sanchez (Eds.), The Routledge international handbook of violence studies (pp. 403418). London: Routledge.
DeKeseredy and Schwartz, 1998 DeKeseredy, W. S. , & Schwartz, M. D. (1998). Woman abuse on campus: Results from the Canadian national survey. Thousand Oaks, CA: Sage.
DeKeseredy and Schwartz, 2013 DeKeseredy, W. S. , & Schwartz, M. D. (2013). Male peer support & violence against women: The history & verification of a theory. Boston, MA: Northeastern University Press.
DeKeseredy and Schwartz, 2016 DeKeseredy, W. S. , & Schwartz, M. D. (2016). Thinking sociologically about image-based sexual abuse: The contribution of male peer support theory. Sexualization, Media, & Society, 2, 18. doi:10.1177/2374623816684692
DeKeseredy et al., 2019a DeKeseredy, W. S. , Schwartz, M. D. , Nolan, J. , Mastron, N. , & Hall-Sanchez, A. (2019a). Polyvictimization and the continuum of sexual abuse at a college campus: Does negative peer support increase the likelihood of multiple victimizations? British Journal of Criminology, 59(2), 276295. doi:10.1093/bjc/azy036
DeKeseredy et al., 2019b DeKeseredy, W. S. , Schwartz, M. D. , Harris, B. , Woodlock, D. , Nolan, J. , & Hall-Sanchez, A. (2019b, January-March). Technology-facilitated stalking and unwanted sexual messages/images in a college campus community: The role of negative peer support. SAGE Open, 112. doi:10.1177/2158244019828231
Dierkhising et al., 2019 Dierkhising, C. B. , Ford, J. D. , Branson, C. , Grasso, D. J. , & Lee, R. (2019). Developmental timing of polyvictimization: Continuity, change, and association with adverse outcomes in adolescence. Child Abuse & Neglect, 87, 4050. doi:10.1016/j.chiabu.2018.07.022.
Dragiewicz, 2011 Dragiewicz, M. (2011). Equality with a vengeance: Men's rights groups, battered women, and antifeminist backlash. Boston, MA: Northeastern University Press.
Dragiewicz et al., 2019 Dragiewicz, M. , Harris, B. , Woodlock, D. , Salter, M. , Easton, H. , Lynch, A. , & Milne, L. (2019). Domestic violence and communication technology: Survivor experiences of instruction, surveillance, and identity crime. Sydney: Australian Communications Consumer Action Network.
Espelage et al., 2016 Espelage, D. L. , Hong, J. S. , & Mebane, S. (2016). Recollections of childhood bullying and multiple forms of victimization: Correlates with psychological functioning among college students. Social Psychology of Education, 19(4), 715728. doi:10.1007/s11218-016-9352-z
Ford and Delker, 2019 Ford, J. D. , & Delker, B. C. (Eds.). (2019). Polyvictimization: Adverse impacts in childhood and across the lifespan. London: Routledge.
Ford and Soco-Marquez, 2016 Ford, J. , & Soco-Marquez, J. G. (2016). Sexual assault victimization among straight, gay/lesbian, and bisexual college students. Violence and Gender, 3(2), 107115. doi:10.1089/vio.2015.0030
Foubert et al., 2020 Foubert, J. D. , Clark-Taylor, A. , & Wall, A. F. (2020). Is campus rape primarily a serial or one-time problem? Evidence from a multi-campus study. Violence Against Women, 26(3–4), 296311. doi:10.1177/1077801219833820
Goodmark, 2011 Goodmark, L. (2011). State, national, and international legal initiatives to address violence against women: A survey. In C. M. Renzetti , J. L. Edleson , & R. Kennedy Bergen (Eds.), Sourcebook on violence against women (2nd ed., pp. 191208). Thousand Oaks, CA: Sage.
Gottfredson and Hirschi, 1990 Gottfredson, M. R. , & Hirschi, T. (1990). A general theory of crime. Stanford, CA: Stanford University Press.
Guadalupe-Diaz, 2019 Guadalupe-Diaz, X. L. (2019). Transgressed: Intimate partner violence in transgender lives. New York, NY: New York University Press.
Hall and Hearn, 2018 Hall, M. , & Hearn, J. (2018). Revenge pornography: Gender, sexuality and motivations. London: Routledge.
Hamby et al., 2016 Hamby, S. , Smith, A. , Mitchell, K. , & Turner, H. A. (2016). Poly-victimization and resilience portfolios: Trends in violence research that can enhance the understanding and prevention of elder abuse. Journal of Elder Abuse & Neglect, 28(4–5), 217234. doi:10.1080/08946566.2016.1232182
Hamby et al., 2018 Hamby, S. , Taylor, E. , Jones, L. , Mitchell, K. , Turner, H. A. , & Newlin, C. (2018). From poly-victimization to poly-strengths: Understanding the web of violence can transform research on youth violence and illuminate the path to prevention and resilience. Journal of Interpersonal Violence, 33(5), 719739. doi:10.1177/0886260517744847
Henriksen et al., 2016 Henriksen, C. B. , Mattick, K. L. , & Fisher, B. S. (2016). Mandatory bystander intervention training: Is the SaVE Act requirement the “right” program to reduce violence among college students?. In S. C. Wooten , & R. W. Mitchell (Eds.), The crisis of campus sexual violence: Critical perspectives on prevention and response (pp. 169183). New York, NY: Routledge.
Henry and Powell, 2015 Henry, N. , & Powell, A. (2015). Embodied harms: Gender, shame, and technology-facilitated sexual violence. Violence Against Women, 21(6), 758779. doi:10.1177/1077801215576581
Henson et al., 2020 Henson, B. , Fisher, B. S. , & Reyns, B. W. (2020). There is virtually no excuse: The frequency and predictors of college students' bystander intervention behaviors directed at online victimization. Violence Against Women, 26(5), 505527. doi:10.1177/1077801219835050
Hewitt and Beauregard, 2014 Hewitt, A. , & Beauregard, E. (2014). Sexual crime and place: The impact of the environmental context on sexual assault outcomes. Journal of Criminal Justice, 42(5), 375383. doi:10.1016/j.jcrimjus.2014.05.003
Holt et al., 2017 Holt, M. K. , Felix, E. , Grimm, R. , Nylund-Gibson, K. , Green, J. G. , Poteat, V. P. , & Zhang, C. (2017). A latent class analysis of past victimization exposures as predictors of college mental health. Psychology of Violence, 7(4), 521532. doi:10.1037/vio0000068
Katz, 2006 Katz, J. (2006). The macho paradox: Why some men hurt women and how all men can help. Naperville, IL: Sourcebooks.
Kelly, 1987 Kelly, L. (1987). The continuum of sexual violence. In J. Hanmer , & M. Maynard (Eds.), Women, violence and social control (pp. 4660). Atlantic Highlands, NJ: Humanities Press International.
Kelly, 1988 Kelly, L. (1988). Surviving sexual violence. Minneapolis, MN: University of Minnesota Press.
Kimmel, 2008 Kimmel, M. (2008). Guyland: The perilous world where boys become men. New York, NY: Harper.
Kirkpatrick and Kanin, 1957 Kirkpatrick, C. , & Kanin, E. J. (1957). Male sex aggression on a university campus. American Sociological Review, 22(1), 5258. doi:10.2307/2088765
Klein, 2012 Klein, R. (2012). Responding to intimate violence against women: The role of informal networks. New York, NY: Cambridge University Press.
Koss et al., 1987 Koss, M. P. , Gidycz, C. , & Wisniewski, N. (1987). The scope of rape: Incidence and prevalence of sexual aggression and victimization in a national sample of higher education students. Journal of Consulting and Clinical Psychology, 55(2), 162170. doi:10.1037/0022-006X.55.2.162
Ledwitz-Rigby, 1993 Ledwitz-Rigby, F. (1993). An administrative approach to personal safety on campus: The role of a President's Advisory Committee on Women's Safety on Campus. Journal of Human Justice, 4(2), 8594. doi:10.1007/BF02619529
Lim et al., 2016 Lim, M. S. C. , Carotte, E. R. , & Hellard, M. E. (2016). The impact of pornography on gender-based violence, sexual health and well-being: What do we know?. Journal of Epidemiology & Community Health, 70(1), 35. doi:10.1136/jech-2015-205453
Marganski and Melander, 2018 Marganski, A. , & Melander, L. (2018). Intimate partner violence victimization in the cyber and real world: Examining the extent of cyber aggression experiences and its association with in-person dating. Journal of Interpersonal Violence, 33(7), 10711095. doi:10.1177/0886260515614283
Marganski et al., 2020 Marganski, A. , Melander, L. , & DeKeseredy, W. S. (2020). Patterns of intimate partner violence at a college campus: The contribution of victims' social support, sexual attitudes, and violence facilitators . Manuscript submitted for publication.
McGlynn et al., 2017 McGlynn, C. , Rackley, E. , & Houghton, R. (2017). Beyond “revenge porn”: The continuum of image-based sexual abuse. Feminist Legal Studies, 25(1), 2546. doi:10.1007/s10691-017-9343-2
Messinger, 2017 Messinger, A. M. (2017). LGTBQ intimate partner violence: Lessons for policy, practice, and research. Oakland, CA: University of California Press.
Meyer, 2015 Meyer, D. (2015). Violence against queer people: Race, class, gender, and the persistence of anti-LGBT discrimination. London: Routledge.
Mitchell et al., 2018 Mitchell, K. J. , Segura, A. , Jones, L. M. , & Turner, H. A. (2018). Poly-victimization and peer harassment involvement in a technological world. Journal of Interpersonal Violence, 33(5), 762788. doi:10.1177/0886260517744846
Musicaro et al., 2019 Musicaro, R. M. , Spinazzola, J. , Arvidson, J. , Swaroop, S. R. , Grace, L. G. , Yarrow, A. , & Ford, J. D. (2019). The complexity of adaptation to childhood polyvictimization in youth and young adults: Recommendations for multidisciplinary responders. Trauma, Violence, & Abuse, 20(1), 8198. doi:10.1177/1524838017692365
Powell and Henry, 2017 Powell, A. , & Henry, N. (2017). Sexual violence in a digital age. London: Palgrave Macmillan.
Powell and Sugiura, 2019 Powell, A. , & Sugiura, L. (2019). Resisting rape culture in digital society. In W. S. DeKeseredy , C. M. Rennison , & A. K. Hall-Sanchez (Eds.), The Routledge international handbook of violence studies (pp. 447457). London: Routledge.
Ptacek, 2016 Ptacek, J. (2016). Rape and the continuum of sexual abuse in intimate relationships: Interviews with U.S. women from different social classes. In K. Yllo , & M. G. Torres (Eds.), Marital rape: Consent, marriage, and social change in global context (pp. 123128). New York, NY: Oxford University Press.
Reed et al., 2016 Reed, L. A. , Tolman, R. M. , & Ward, M. (2016). Snooping and sexting: Digital media as a context for dating aggression and abuse among college students. Violence Against Women, 22(13), 15561576. doi:10.1177/1077801216630143
Reyns et al., 2016 Reyns, B. W. , Henson, B. , & Holt, T. (2016). Theoretical explanations of personal forms of online victimization. In J. N. Navarro , S. Clevenger , & C. D. Marcum (Eds.), The intersection between intimate partner abuse, technology, and cybercrime: Examining the virtual enemy (pp. 7594). Durham, NC: Carolina University Press.
Sabina et al., 2008 Sabina, C. , Wolak, J. , & Finkelhor, D. (2008). The nature and dynamics of Internet pornography exposure for youth. CyberPsychology and Behavior, 11(6), 691693. doi:10.1089/cpb.2007.0179
Salter, 2017 Salter, M. (2017). Crime, justice and social media. London: Routledge.
Sargent et al., 2016 Sargent, K. S. , Krauss, A. , Jouriles, E. N. , & McDonald, R. (2016). Cyber victimization, psychological intimate partner violence, and problematic mental health outcomes among first-year college students. Cyberpsychology, Behavior, and Social Networking, 19(9), 545550. doi:10.1089/cyber.2016.0115
Schwartz, 2015 Schwartz, M. D. (2015, September). Campus sexual assault and male peer support. The Sociologist. Retrieved from http://thesociologistdc.com/all-issues/campus-sexual-assault-and-male-peer-support/.
Schwartz and DeKeseredy, 1997 Schwartz, M. D. , & DeKeseredy, W. S. (1997). Sexual assault on the college campus: The role of male peer support. Thousand Oaks, CA: Sage.
Stark-Adamec, 1996a Stark-Adamec, C. (1996a). Collaboration and responsibility. In C. Stark-Adamec (Ed.), Violence: A collective responsibility (pp. 143150). Ottawa, ON: Social Science Federation of Canada.
Stark-Adamec, 1996b Stark-Adamec, C. (1996b). Violence and responsibility. In C. Stark-Adamec (Ed.), Violence: A collective responsibility (pp. 19). Ottawa, ON: Social Science Federation of Canada.
Strong-Boag, 1996 Strong-Boag, V. (1996). Too much is not enough: The paradox of power for feminist academics working with community feminists on issues related to violence. In C. Stark-Adamec (Ed.), Violence: A collective responsibility (pp. 105115). Ottawa, ON: Social Science Federation of Canada.
Sun et al., 2016 Sun, C. , Bridges, A. , Johnson, J. A. , & Ezzell, M. B. (2016). Pornography and the male sexual script: An analysis of consumption and sexual relations. Archives of Sexual Behavior, 45, 983994. doi:10.1007/s10508-014-0391-2
Thorne-Finch, 1992 Thorne-Finch, R. (1992). Ending the silence: The origins and treatment of male violence against women. Toronto, ON: University of Toronto Press.
Warshaw, 1988 Warshaw, R. (1988). I never called it rape. New York, NY: Harper & Row.
Wendt, 2016 Wendt, S. (2016). Intimate violence and abuse in Australian rural contexts. In J. F. Donnermeyer (Ed.), The Routledge international handbook of rural criminology (pp. 191199). London: Routledge.
White and Carmody, 2018 White, W. E. , & Carmody, D. (2018). Preventing online victimization: College students' views on intervention and prevention. Journal of Interpersonal Violence, 33(14), 22912307. doi:10.1177/0886260515625501
White et al., 2011 White, J. W. , Koss, M. P. , & Kazdin, A. E. (Eds.). (2011). Violence against women and children: Mapping the terrain. Washington, DC: American Psychological Association.
Wolfe, 2018 Wolfe, D. A. (2018). Why polyvictimization matters. Journal of Interpersonal Violence, 33(5), 832837. doi:10.1177/0886260517752215
Wooten and Mitchell, 2016 Wooten, S. C. , & Mitchell, R. W. (2016). Introduction. In S. C. Wooten , & R. W. Mitchell (Eds.), The crisis of campus sexual violence: Critical perspectives on prevention and response (pp. 111). New York, NY: Routledge.
# Acknowledgment
The authors would like to thank Mackenzie Freeman for her assistance
Prelims
Technology-Facilitated Violence and Abuse: International Perspectives and Experiences
Section 1 TFVA Across a Spectrum of Behaviors
Chapter 1 Introduction
Chapter 2 Is it Actually Violence? Framing Technology-Facilitated Abuse as Violence
Chapter 3 “Not the Real World”: Exploring Experiences of Online Abuse, Digital Dualism, and Ontological Labor
Chapter 4 Polyvictimization in the Lives of North American Female University/College Students: The Contribution of Technology-Facilitated Abuse
Chapter 5 The Nature of Technology-Facilitated Violence and Abuse among Young Adults in Sub-Saharan Africa
Chapter 6 The Face of Technology-Facilitated Aggression in New Zealand: Exploring Adult Aggressors' Behaviors
Chapter 7 The Missing and Murdered Indigenous Women Crisis: Technological Dimensions
Chapter 8 Attending to Difference in Indigenous People's Experiences of Cyberbullying: Toward a Research Agenda
Section 2 Text-Based Harms
Chapter 9 Introduction
Chapter 10 “Feminism is Eating Itself”: Women's Experiences and Perceptions of Lateral Violence Online
Chapter 11 Claiming Victimhood: Victims of the “Transgender Agenda”
Chapter 12 Doxxing: A Scoping Review and Typology
Chapter 13 Creating the Other in Online Interaction: Othering Online Discourse Theory
Chapter 14 Text-Based (Sexual) Abuse and Online Violence Against Women: Toward Law Reform?
Section 3 Image-Based Harms
Chapter 15 Introduction
Chapter 16 Violence Trending: How Socially Transmitted Content of Police Misconduct Impacts Reactions toward Police Among American Youth
Chapter 17 Just Fantasy? Online Pornography's Contribution to Experiences of Harm
Chapter 18 Intimate Image Dissemination and Consent in a Digital Age: Perspectives from the Front Line
Section 4 Dating Applications
Chapter 19 Introduction
Chapter 20 Understanding Experiences of Sexual Harms Facilitated through Dating and Hook Up Apps among Women and Girls
Chapter 21 “That's Straight-Up Rape Culture”: Manifestations of Rape Culture on Grindr
Chapter 22 Navigating Privacy on Gay-Oriented Mobile Dating Applications
Section 5 Intimate Partner Violence and Digital Coercive Control
Chapter 23 Introduction
Chapter 24 Digital Coercive Control and Spatiality: Rural, Regional, and Remote Women's Experience
Chapter 25 Technology-Facilitated Violence Against Women in Singapore: Key Considerations
Chapter 26 Technology as Both a Facilitator of and Response to Youth Intimate Partner Violence: Perspectives from Advocates in the Global-South
Chapter 27 Technology-Facilitated Domestic Abuse and Culturally and Linguistically Diverse Women in Victoria, Australia
Section 6 Legal Responses
Chapter 28 Introduction
Chapter 29 Human Rights, Privacy Rights, and Technology-Facilitated Violence
Chapter 30 Combating Cyber Violence Against Women and Girls: An Overview of the Legislative and Policy Reforms in the Arab Region
Chapter 31 Image-Based Sexual Abuse: A Comparative Analysis of Criminal Law Approaches in Scotland and Malawi
Chapter 32 Revenge Pornography and Rape Culture in Canada's Nonconsensual Distribution Case Law
Chapter 33 Reasonable Expectations of Privacy in an Era of Drones and Deepfakes: Expanding the Supreme Court of Canada's Decision in R v Jarvis
Chapter 34 Doxing and the Challenge to Legal Regulation: When Personal Data Become a Weapon
Chapter 35 The Potential of Centralized and Statutorily Empowered Bodies to Advance a Survivor-Centered Approach to Technology-Facilitated Violence Against Women
Section 7 Responses Beyond Law
Chapter 36 Introduction
Chapter 37 Technology-Facilitated Violence Against Women and Girls in Public and Private Spheres: Moving from Enemy to Ally
Chapter 38 As Technology Evolves, so Does Domestic Violence: Modern-Day Tech Abuse and Possible Solutions
Chapter 39 Threat Modeling Intimate Partner Violence: Tech Abuse as a Cybersecurity Challenge in the Internet of Things
Chapter 40 Justice on the Digitized Field: Analyzing Online Responses to Technology-Facilitated Informal Justice through Social Network Analysis
Chapter 41 Bystander Apathy and Intervention in the Era of Social Media
Chapter 42 “I Need You All to Understand How Pervasive This Issue Is”: User Efforts to Regulate Child Sexual Offending on Social Media
Chapter 43 Governing Image-Based Sexual Abuse: Digital Platform Policies, Tools, and Practices
Chapter 44 Calling All Stakeholders: An Intersectoral Dialogue about Collaborating to End Tech-Facilitated Violence and Abuse
Chapter 45 Pandemics and Systemic Discrimination: Technology-Facilitated Violence and Abuse in an Era of COVID-19 and Antiracist Protest
|
2021-08-01 18:22:20
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.25807124376296997, "perplexity": 11349.28121227515}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046154214.63/warc/CC-MAIN-20210801154943-20210801184943-00135.warc.gz"}
|
http://physics.stackexchange.com/questions/71043/resisting-force-depends-on-velocity
|
# Resisting force depends on velocity? [duplicate]
This question already has an answer here:
Why does resisting force depend on velocity? I think there is no relation between resisting force and velocity of object. Please speak about it logically.
-
## marked as duplicate by Waffle's Crazy Peanut, Dilaton, dmckee♦Jul 14 '13 at 13:29
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
## 1 Answer
The air resistance, a force sometimes known as a drag, always increases with the speed but the precise dependence on the speed differs in various situations, especially depending on the presence of turbulence etc.
For low speeds, the air resistance is proportional to the velocity, $\vec F = -b\vec v$. This is known as Stokes' drag. A direct proportionality is the only natural, smooth function of a vector mapped to another vector. The unit (or constant-length) vector in the direction of motion isn't natural as it would be discontinuous for $\vec v =0$.
When you're moving by speed $v$, a higher number of particles hit you on the front side. The difference between collisions from the front and from the back go like $v$ and because each collision with a (very fast) particle effectively changes your momentum by the same amount, the change of the momentum per unit time – the force – will be proportional to the velocity, too.
At higher velocities, the drag increases as a higher power, typically quadratic power, of the velocity. That's for a higher Reynolds number, for turbulence. It takes some effort to quickly explain the scaling but it can be done. Well, let me say something: $$F_D\, =\, \tfrac12\, \rho\, v^2\, C_d\, A,$$ This is the formula for the drag. It doesn't depend on the velocity at all (because the drag is due to universal turbulence and "vortices" and not just some surface friction). Because both sides have to have the same units, $F$ has units of mass times distance per squared time (mass times acceleration), the velocity is the only factor that can give us powers of a second (the unit of time), and it has to be squared to produce the right power. We call this argument "dimensional analysis".
-
I find your explanation of the drag proportional to $v^2$ a bit strange. Since you are saying that the velocity is only part of the expression for drag to suffice to the unit of force. – fibonatic Jul 14 '13 at 12:20
Dear fibonatic, it's enough to look at the velocity because it's the only quantity that contains a nontrivial power of a second. The task to calculate the powers of $\rho,v,A$ is equivalent to a set of linear equations but the equation for the right powers of one second simply tells you that the exponent above $v$ has to be $2$ because the force contains $1/s^2$. – Luboš Motl Jul 14 '13 at 18:50
I agree that the units should be the same on both sides of the equal sign, however the unit $s^{-2}$ also could have been part of the constant $C_D$. I think it would be better if a model would be based on experiments or calculations, instead of just matching units. – fibonatic Jul 14 '13 at 21:48
Nope! $C_D$ is a dimensionless coefficient, the drag coefficient, that only depends on the shapes etc. It has to be dimensionless because the fluid etc. simply has no other dimensionful parameter that would determine the relevant mechanical properties in this situation. So such a dimensionful $C_D$ couldn't emerge from any legitimate calculation. It's the whole point of dimensional analysis that we classify all dimensionful quantities whose powers may enter the equations and here it's just the viscosity and the dependence on viscosity must disappear in the turbulent limit. – Luboš Motl Jul 16 '13 at 9:54
|
2015-04-28 05:22:32
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8821814656257629, "perplexity": 350.1491203063992}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-18/segments/1429246660724.78/warc/CC-MAIN-20150417045740-00299-ip-10-235-10-82.ec2.internal.warc.gz"}
|
https://www.gamedev.net/forums/topic/323173-thoughts-on-peopleware/
|
# Thoughts on PeopleWare
This topic is 4821 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.
## Recommended Posts
Has anyone else read this? It's recommended by Joel Spolsky as a (perhaps long lost?) Microsoft employee must-read. I'm only 30 pages in and the claims made are already incredulous.
Effort Estimate Average Number of
Prepare by Productivity Projects
Programmer 8.0 19
Supervisor 6.6 23
Programmer & supervisor 7.8 16
Systems Analyst 9.5 21
(No estimate) 12.0 24
##### Share on other sites
I've read it. I'm actually not too surprised about those numbers, by the way, except with the possibility of the last one (productivity for no estimate). The remaining productivity numbers are pretty much bang-on.
The reason I disagree with the productivity for no estimate is because the only evidence close to empirical that I've ever been able to observe is myself. And I tell you, without using an estimate to try and figure out when I'd be done, I don't do much at all. Of course, that's just my own (perverse) personal experience, and we all know that every statistic has its (lol, standard) deviants.
##### Share on other sites
May I suggest here that although no estimate is there for a team, the team still feels the necessity to move forward, to accomplish the goal, to deliver a product. Individuals will look at each other, and on a successful team there will always be an achiever or two who propel things.
One-man-army development, on the other hand, may suffer when no estimates are made, unless we're speaking of a highly organized person. However, rigid estimates for such case are *not* welcome. If you miss a deadline, you won't be feeling good. Which is bad.
Peopleware puts deadline management where it belongs, in the trash bin.
1. 1
2. 2
3. 3
4. 4
frob
15
5. 5
• 16
• 12
• 20
• 12
• 19
• ### Forum Statistics
• Total Topics
632162
• Total Posts
3004507
×
|
2018-08-18 16:41:23
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.222798153758049, "perplexity": 3023.1772749586485}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-34/segments/1534221213691.59/warc/CC-MAIN-20180818154147-20180818174147-00109.warc.gz"}
|
https://physics.stackexchange.com/questions/532503/integral-over-a-total-functional-derivative-is-identically-vanishing?noredirect=1
|
# Integral over a total functional derivative is identically vanishing
In following an extension course on quantum field theory, a problem popped up that my TAs couldn't quite explain to my satisfaction. I suspect the answer is really simple, so I hope somebody with a mathematical background can elucidate.
What is given is as follows:
• A field variable $$\phi$$ can be rewritten into another field variable, $$\phi'$$ arbitrarily.
• The boundary conditions do not contribute, when integrating by parts.
Given the above and some arbitrary expression $$F$$, the following should allegedly hold: \begin{align} \int [d\phi]\frac{\delta F}{\delta\phi}=0 \end{align} where the square around the measure absorbs any constants from the measure that may appear (so we normalise any expression to have no constants and only the relevant parts).
The argument the TAs made is that by the above, also \begin{align} \int [d\phi']\frac{\delta F}{\delta\phi'}=0. \end{align}
Expanding $$\phi'$$ around $$\phi$$, we must argue that the leading order coefficient in the series expansion must vanish, the other coefficients are zero since a second order variation is "doubly infinitesimal" and thus vanishing.
But I don't consider this a satisfactory explanation. I've been looking at Zee, Quantum Field Theory in a Nutshell, which does gloss over it, but I'm still confused:
• How does the measure change?
• Locality of $$\phi$$ appears to dictate whether the 'derivative chain rule' applies. But these locality properties are not declared initially, and I'm not sure what the considerations are to determine it. What I'm getting at is whether \begin{align} \frac{\delta}{\delta\phi(x)} = \int d^d y \frac{\delta\phi(y)}{\delta \phi(x)} \frac{\delta}{\delta \phi(y)} \end{align} for example, with/without the integral over some $$y$$.
• Possible duplicate: Why is the functional integral of a functional derivative zero? – Qmechanic Feb 22 at 17:04
• @Qmechanic I believe this answers the question in part. Perhaps you could explain the ideas behind picking the functional derivative chain rule in some way in an answer, or you could mark it as duplicate and answer this in chat (?). Just thinking out loud. Thanks! – 1010011010 Feb 24 at 9:47
• Consider to reword/stress more clearly the parts of your question that are not answered by the linked post. – Qmechanic Feb 24 at 14:03
|
2020-05-26 18:48:35
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 10, "wp-katex-eq": 0, "align": 3, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9637994170188904, "perplexity": 719.1899361907294}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347391277.13/warc/CC-MAIN-20200526160400-20200526190400-00317.warc.gz"}
|
http://math-info.hse.ru/wiki2013-14/index.php?title=Ordinary_differential_equations&oldid=284&diff=prev
|
# Ordinary differential equations — различия между версиями
Перейти к: навигация, поиск
Dear Math in Moscow students!
Instructor: Ilya Schurov (ilyaСоб@каschurov.com).
## References
• Main textbook is Ordinary differential equations by V. I. Arnold.
• Problems were taken mostly from Problems in differential equations by A. F. Filippov.
• The program and assignments are based on the course Ordinary differential equations (Math in Moscow, 2010-11) by Yury Kudryashov and Ilya Schurov and the same course of 2013/14 academic year (by Dmitry Filimonov, Ilya Schurov and Alexandra Pushkar).
• Curriculum (it seems that only the first 14 items will be covered in the course due to lack of time).
## Lessons
### 02/10: Introduction to ODEs
• Examples of mathematical models that lead to differential equations: Malthusian population grows, free fall, harmonic oscillator.
• Examples of ODEs and their solutions:
•
•
•
• Phase space, extendended phase space, direction field, integral curves.
• Barrow's formula: the solution of an equation (autonomous equation in dimension 1).
### 02/17: ODEs in dimension 1
• Example of nonuniqueness for the solution of differential equation: .
• Theorem of existence and uniqueness for
• autonomous differential equations in dimension 1 (with the proof);
• non-autonomous differential equations in dimension 1 (without the proof, it will be discussed later).
• Separation of the variables (with the proof).
|
2019-09-19 21:02:58
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 5, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8437548279762268, "perplexity": 3557.6817909178976}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-39/segments/1568514573735.34/warc/CC-MAIN-20190919204548-20190919230548-00511.warc.gz"}
|
http://www.umiacs.umd.edu/publications/stable-factorizations-symmetric-tridiagonal-and-triadic-matrices
|
Stable Factorizations of Symmetric Tridiagonal and Triadic Matrices
Title Stable Factorizations of Symmetric Tridiagonal and Triadic Matrices Publication Type Journal Articles Year of Publication 2006 Authors Fang H-ren, O'Leary DP Journal SIAM J. on Matrix Analysis and Applications Volume 28 Pagination 576 - 595 Date Published 2006/// Abstract We call a matrix triadic if it has no more than two nonzero off-diagonal elements in any column. A symmetric tridiagonal matrix is a special case. In this paper we consider $LXL^T$ factorizations of symmetric triadic matrices, where $L$ is unit lower triangular and $X$ is diagonal, block diagonal with $1\!\times\!1$ and $2\!\times\!2$ blocks, or the identity with $L$ lower triangular. We prove that with diagonal pivoting, the $LXL^T$ factorization of a symmetric triadic matrix is sparse, study some pivoting algorithms, discuss their growth factor and performance, analyze their stability, and develop perturbation bounds. These factorizations are useful in computing inertia, in solving linear systems of equations, and in determining modified Newton search directions.
|
2018-07-18 12:09:48
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.24254465103149414, "perplexity": 830.3781627496527}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-30/segments/1531676590169.5/warc/CC-MAIN-20180718115544-20180718135544-00028.warc.gz"}
|
http://mathhelpforum.com/differential-equations/49927-solved-differential-equation-help.html
|
# Math Help - [SOLVED] Differential Equation Help
1. ## [SOLVED] Differential Equation Help
Hi all,
Earlier I started a thread with a past exam question that I wanted to understand before I attempted a homework question. It is similar to the question I posted earlier, but Im still having trouble with it.
Here it is:
"find the equation of R(t) when
$\frac{dE}{dt}= -\gamma_{b}E$ where $E(0) = E_0$ and $\gamma_b = \gamma_{b_1} + \gamma_{b_2} + \lambda_p$,
$\frac{dS}{dt}= -\gamma_{s}S$ where $S(0) = S_0$ and $\gamma_s = \gamma_{s_1} + \gamma_{s_2} + \lambda_p$
and
$\frac{dR}{dt} = \gamma_{b_1} E + \gamma_{s_1} MS$
where $M, \gamma_{b_1}, \gamma_{b_2}, \gamma_{b}, \gamma_{s_1}, \gamma_{s_2}, \gamma_{s}, \lambda_p$ are all constants.
Now I know that
$S(t) = S_0 e^{-\gamma_{s} t}$
$E(t) = E_0 e^{-\gamma_{b} t}$
and then by substituting these values into $\frac{dR}{dt}$ we obtain
$\frac{dR}{dt} = \gamma_{b_1} E_0 e^{-\gamma_b t} + \gamma_{s_1} M S_0 e^{-\gamma_s t}$
this is where I get lost. How do I continue from here? What type of differential equation is this? Thanks
2. Originally Posted by Maccaman
Hi all,
Earlier I started a thread with a past exam question that I wanted to understand before I attempted a homework question. It is similar to the question I posted earlier, but Im still having trouble with it.
Here it is:
"find the equation of R(t) when
$\frac{dE}{dt}= -\gamma_{b}E$ where $E(0) = E_0$ and $\gamma_b = \gamma_{b_1} + \gamma_{b_2} + \lambda_p$,
$\frac{dS}{dt}= -\gamma_{s}S$ where $S(0) = S_0$ and $\gamma_s = \gamma_{s_1} + \gamma_{s_2} + \lambda_p$
and
$\frac{dR}{dt} = \gamma_{b_1} E + \gamma_{s_1} MS$
where $M, \gamma_{b_1}, \gamma_{b_2}, \gamma_{b}, \gamma_{s_1}, \gamma_{s_2}, \gamma_{s}, \lambda_p$ are all constants.
Now I know that
$S(t) = S_0 e^{-\gamma_{s} t}$
$E(t) = E_0 e^{-\gamma_{b} t}$
and then by substituting these values into $\frac{dR}{dt}$ we obtain
$\frac{dR}{dt} = \gamma_{b_1} E_0 e^{-\gamma_b t} + \gamma_{s_1} M S_0 e^{-\gamma_s t}$
this is where I get lost. How do I continue from here? What type of differential equation is this? Thanks
Just integrate with respect to t.
3. Originally Posted by Maccaman
Hi all,
Earlier I started a thread with a past exam question that I wanted to understand before I attempted a homework question. It is similar to the question I posted earlier, but Im still having trouble with it.
Here it is:
"find the equation of R(t) when
$\frac{dE}{dt}= -\gamma_{b}E$ where $E(0) = E_0$ and $\gamma_b = \gamma_{b_1} + \gamma_{b_2} + \lambda_p$,
$\frac{dS}{dt}= -\gamma_{s}S$ where $S(0) = S_0$ and $\gamma_s = \gamma_{s_1} + \gamma_{s_2} + \lambda_p$
and
$\frac{dR}{dt} = \gamma_{b_1} E + \gamma_{s_1} MS$
where $M, \gamma_{b_1}, \gamma_{b_2}, \gamma_{b}, \gamma_{s_1}, \gamma_{s_2}, \gamma_{s}, \lambda_p$ are all constants.
Now I know that
$S(t) = S_0 e^{-\gamma_{s} t}$
$E(t) = E_0 e^{-\gamma_{b} t}$
and then by substituting these values into $\frac{dR}{dt}$ we obtain
$\frac{dR}{dt} = \gamma_{b_1} E_0 e^{-\gamma_b t} + \gamma_{s_1} M S_0 e^{-\gamma_s t}$
this is where I get lost. How do I continue from here? What type of differential equation is this? Thanks
Well, as the right hand side doesn't depend on R all you need to do is integrate both sides with respect to t.
-Dan
4. ahhhhhh, of course I feel so stupid now
thanks
5. Originally Posted by Maccaman
ahhhhhh, of course I feel so stupid now
thanks
There is nothing more difficult than seeing the obvious after you have done something complicated.
-Dan
6. Is this answer correct? (my integration rules are a bit dodgy)
$R(t) = - \frac{\gamma_{b_1} E_0 e^{-\gamma_b t}}{\gamma_b} - \frac{\gamma_{s_1} M S_0 e^{-\gamma_s t}}{\gamma_s}$
7. Originally Posted by Maccaman
Is this answer correct? (my integration rules are a bit dodgy)
$R(t) = - \frac{\gamma_{b_1} E_0 e^{-\gamma_b t}}{\gamma_b} - \frac{\gamma_{s_1} M S_0 e^{-\gamma_s t}}{\gamma_s}$
Looks good to me.
-Dan
|
2016-02-09 18:47:11
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 38, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8396458625793457, "perplexity": 279.643755333877}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-07/segments/1454701157443.43/warc/CC-MAIN-20160205193917-00340-ip-10-236-182-209.ec2.internal.warc.gz"}
|
https://www.siskolata.com/x3xp3e/43b531-rabbits-introduced-to-australia
|
I Won't Have To Worry Anymore Piano Sheet Music, Hydranencephaly Vs Hydrocephalus, Space Studios Manchester Devs, Where Was Walking Tall 2 Filmed, 9 Bus Schedule, Btl Institute Of Technology Placements, " /> I Won't Have To Worry Anymore Piano Sheet Music, Hydranencephaly Vs Hydrocephalus, Space Studios Manchester Devs, Where Was Walking Tall 2 Filmed, 9 Bus Schedule, Btl Institute Of Technology Placements, "> I Won't Have To Worry Anymore Piano Sheet Music, Hydranencephaly Vs Hydrocephalus, Space Studios Manchester Devs, Where Was Walking Tall 2 Filmed, 9 Bus Schedule, Btl Institute Of Technology Placements, " /> I Won't Have To Worry Anymore Piano Sheet Music, Hydranencephaly Vs Hydrocephalus, Space Studios Manchester Devs, Where Was Walking Tall 2 Filmed, 9 Bus Schedule, Btl Institute Of Technology Placements, " /> İçeriğe geçmek için "Enter"a basın
The feral European rabbit is one of the most widely distributed and abundant mammals in Australia. Before the first humans arrived in Australia, the only mammals living there were about 150 species of marsupials as well as bats , rats, … By 1866 hunters bagged 14,000 rabbits on the Bawron Park estate. However, for the great majority of introduced wild animals in Australia there is the wish that we could turn back the hands of time and assess the costs and benefits in the light of current knowledge. Wild European rabbits were introduced to Australia in 1859, and within 10 years they were causing extensive agricultural damage, prompting the development of a series of largely ineffective rabbit-proof fences in the late 19th and early 20th centuries to keep rabbits in the eastern parts of Australia from invading the western regions. Rabbits were introduced from two main sources; the domesticated rabbit which provided early settlers with a ready source of meat, and the wild rabbit introduced later for … Rabbits were introduced to Australia with the arrival of the First Fleet in 1788. Population explosion and plagues. Despite the enormity of the project, the fence was deemed unsuccessful, since many rabbits traversed over to the protected side during the construction period. A small percentage of the population also developed a natural genetic immunity to the virus and they continued to reproduce. Initially, rabbits were bred by individual homeowners, but large-scale rabbit-farming became more extensive by the 1840's. In the 1840s, rabbit-keeping was a common practice among colonists, with bunny rabbit thefts showing up in court records. It was completed after the rabbits had already crossed into the state, and the constant deterioration of the fence meant there was almost always somewhere the rabbits could cross. The pelts have been hand-sewn together in a grid to form a rectangular quilt, which has been machine-stitched to a backing made from a commercially sourced maroon flannel bed-rug. They were originally introduced to Australia by the First Fleet in 1788, but the current major infestation appears to be the result of 24 wild rabbits released by Thomas Austin on his Barwon Heads property in 1859 for hunting purposes. European rabbits (Oryctolagus cuniculus) were introduced to Australia in the 18th century with the First Fleet and eventually became widespread. The history of the rabbit in Australia demonstrates that people can be really silly. Brian Coman, Tooth and Nail, Text Publishing, Melbourne, 1999. Between 1901 and 1907, a national approach by building three rabbit-proof fences to protect the pastoral lands of Western Australia. By the late 1940s the rabbit population had rapidly increased to 600 million. Rabbits are an invasive species that has caused immense ecological devastation to the continent of Australia for over 150 years. Hunters, however, could not keep up with the extraordinary rate at which the animals multiplied and soon millions of rabbits were competing with Australia’s livestock for … In 1859, a man named Thomas Austin, a landowner in Winchelsea, Victoria imported 24 wild rabbits from England and released them into the wild for sport hunting. Rabbits were brought to Australia on the First Fleet but, for whatever reason, they did not breed prolifically or cause any problems for the first few years of the colony's settlement. Rabbits prefer to live in areas with short grasses, including natural grasslands and rural pastures. Their spread may have been enhanced through the emergence of strong crossbreeds. The rabbits had no natural predators and began to crowd the native animals out of their habitats. Journal of Applied Ecology, 35: 434–453 •"Rabbit Hemorrhagic Disease." They were introduced to Australia in the 18th century with the First Fleet and became widespread after an outbreak caused by an 1859 release. What is their method of introduction? There were no rabbits on the Australian continent until Thomas Austin decided to bring them over at the end of the 18th century. Rabbits: Introduction: Rabbits like most invasive species were introduced when the first British settlers landed in Australia. There is an abundance of land with limited industrial development. Andrew Miller, commissary for the First Fleet, listed five rabbits on the initial transport. Wild rabbits are a serious mammalian pest and invasive species in Australia causing millions of dollars of damage to crops. These rabbits were not the first to arrive in Australia, as some of their domesticated cousins had come with the First Fleet, but they proved highly adept at adapting to local conditions. What's Wrong With Livestock Grazing on Public Lands. Within a few decades, rabbits had spread from Victoria and New South Wales to Queensland and across to Western Australia. 1859: Rabbits successfully introduced into Australia. Introduction of rabbits to Australia. It causes severe damage to the natural environment and to agriculture. Over three-quarters of the State is inhabited by feral European rabbits. the rabbits soon burrowing animals burrows and started eating their food. Rabbits, like most other pest species, were introduced when Europeans first settled in Australia. However, the Western Australian fence, like almost all the very long government-sponsored fences, was unsuccessful for a number of reasons. ABN 70 592 297 967 | The National Museum of Australia is an Australian Government Agency, The Untold Stories of Cook and the First Australians, Defining Moments: Introduction of Rabbits to Australia. They were probably silver greys, a popular breed for hutch rearing in England at the time. By 1890, rabbits were spotted all the way in Western Australia. With abundant food sources, good ground cover and a lack of predators, the rabbits raced across the landscape. A population of 24 rabbits released near Geelong in 1859 to be hunted for sport. Rabbits in Australia are European rabbits (Oryctolagus cuniculus) in the Lagomorph family. Introduction of rabbits to Australia. ThoughtCo uses cookies to provide you with a great user experience. By 1880 rabbits had crossed the Murray River to New South Wales and had reached Queensland by 1886. It is estimated that by the height of the fence construction boom there were 320,000 kilometres of rabbit-proof fence across Australia. The long-term result of rapidly reproducing rabbits is overgrazing by an extremely large population, which can lead to a collapse of indigenous plants and the native animal species that eat them. However, this was not the first diffusion of rabbits on the continent. Feral rabbit control is complicated because of welfare and harvesting issues, and because both native and introduced predators feed on feral rabbits in many parts of Australia. Most often, they were bred as food animals, probably in cages, and not in vast numbers. To combat the reduced effectiveness of myxoma, flies carrying a rabbit hemorrhagic disease (RHD), were released in Australia in 1995. Still, nature — even pests, nature’s unfortunate fruits — finds a way to survive. The rabbits started to migrate across Australia at a rate of 80 miles a year. Rabbits were introduced to Australia in 1859 by a wealthy Victorian grazier keen on the sport of hunting. Australia is home to at least 150 million feral rabbits, which continue to have a huge impact on our environment. Rabbits have been blamed for the destruction of the eremophila plant and various species of trees. The European rabbit (Oryctolagus cuniculus) is an introduced species, which was first brought to Australia with the First Fleet in 1788 as domesticated livestock. In the 18 th century, the European rabbits ( Oryctolagus cuniculus) were introduced in Australia. Australia is an ideal location for the prolific rabbit. The results of the release of the European wild rabbits at Winchelsea was quickly apparent. Land with limited top soil can also lead to agricultural run-off and increased salinity. Rabbits have set up shop in Australia since the late 18th century, when the First Fleet — 11 ships carrying convicts that founded the first European settlement in Australia — brought them along for food in 1788. To compensate, many farmers extend their livestock range and diet, farming a wider expanse of the land and thus further contributing to the problem. Thomas Austin is known to have released 24 wild… Natural low vegetation provides them with shelter and food, and years of geographic isolation has left the continent with no natural predator for this new invasive species. Rabbits are one of Australia’s most visible introduced species. Initially the new trials, conducted on the Murray River in Victoria by the newly formed CSIRO, looked to be a failure but rains in December 1950 produced more mosquitoes, the vector that spread the virus, and the disease spread with incredible speed. Despite its size, much of Australia is arid and not fully fit for agriculture. Over three-quarters of the State is inhabited by feral European rabbits. They soon spread all over Australia, except … The European rabbit was brought to Australia as a companion animal by early settlers. Thomas Austin, a wealthy settler who lived in Victoria, Australia, had 13 European wild rabbits sent to him from across the world, which he let roam free on his estate. Within a number of years, those 24 rabbits multiplied into millions. There were two main ways the rabbits were introduced, firstly they were domesticated rabbits which were a source of fresh meat and wild rabbit introduced later for hunting games. Rabbits have lived in Australia for over 150 years and until a perfect virus can be found, they'll probably be there for several hundred more. Today, only about 40 percent of rabbits are still susceptible to this disease. The agricultural industry in Australia has lost billions of dollars from the direct and indirect effects of the rabbit infestation. The release was highly successful, as an estimated 90–99 percent of the rabbit population in Australia was wiped out. In the first decades they do not appear to have been numerous, judging from their absence from archaeological collections of early colonial food remains. The introduction of the rabbit has also strained the native wildlife of Australia. Introducing rabbits into Australia: a bad idea. Additionally, due to direct competition for food and habitat, the population of many native animals, such as the greater bilby and the pig-footed bandicoot, has declined dramatically. In 1894 they had traversed the Nullarbor and populated Western Australia. The rate of spread of the rabbit in Australia was the fastest of a colonising mammal anywhere in the world. Bedcover made from 54 rectangular sections of tanned rabbit pelts. The population of rabbits grew unchecked. Although the rabbit population is a fraction of what it was in the early 1920s, it continues to burden the country's eco- and agricultural systems. European rabbits (Oryctolagus cuniculus) were introduced to Australia in the 18th century with the First Fleet and eventually became widespread. They are the most destructive of introduced animal in Australia, causing the extinction of native fauna and flora. But, the population rapidly took off (they bred like rabbits), and within a few decades they had spread across the entire continent and numbered in the hundreds of millions. In 1859, a farmer introduced 24 grey rabbits to remind him of home. Rabbits are animals with huge reproductive capacity, and the few pairs of mates that Thomas brought over multiplied extremely quickly. In 1859, a man named Thomas Austin, a landowner in Winchelsea, Victoria imported 24 wild rabbits from England and released them into the wild for sport hunting. For much of the 19th century, the most common methods of feral rabbit control have been trapping and shooting. Within 50 years rabbits had spread throughout the most of the continent with devastating impact on indigenous flora and fauna. He set 24 rabbits loose on his land with the idea of practicing hunting in his new home. ii) Example: European rabbits were introduced to Australia as a source of food. Rabbits were first introduced to Australia by the First Fleet in 1788. The disease helped reduce rabbit populations by 90 percent in arid zones. 2 Sept. 2007. The scientists who witnessed it were shocked, as the renowned microbiologist Frank Fenner said: ‘… for scale and speed [the myxomatosis epidemic] must be without parallel in the history of infections’. Their numbers are now on the rise again in Australia. Causing millions of dollars, and damage to crops, which were once perfectly normal. But they were never released into the wild. There were no rabbits in Australia until 20 were imported in 1859. Lawson Crescent Acton Peninsula, CanberraDaily 9am–5pm, closed Christmas Day Freecall: 1800 026 132, Museum Cafe9am–4pm, weekdays9am–4.30pm, weekends. That’s still a lot of rabbits, but Australia is a big place. what enabled the nonantum rabbits to take over the continent of australia The bed rug, which is larger than the combined rabbit pelt quilt, has a scalloped 6... Introduction and improvement of merino sheep, Cane toads introduced into Australia to control pest beetles in Queensland’s sugar cane crops, Australia's Defining Moments Digital Classroom. Throughout the 19th and 20th centuries, different methods of rabbit control were tried, including trapping, rabbit warren ripping, fumigation and bounty systems. There were two main ways the rabbits were introduced, firstly they were domesticated rabbits which were a source of fresh meat and wild rabbit introduced later for hunting games. It is ironic that an animal that thrived better than any other introduced mammal in the world was now dying out at record speed. Failed Rabbit Controls in Australia . The history of the rabbit in Australia demonstrates that people can be really silly. By using ThoughtCo, you accept our, Feral Australian Rabbits as Ecological Problem, What Is Coevolution? Rabbits were introduced into Australia in 1859. The National Museum of Australia acknowledges First Australians and recognises their continuous connection to country, community and culture. Within a number of years, those 24 rabbits multiplied into millions. However, like myxomatosis, RHD is still limited by geography. Rabbits in Australia Imported into Australia in the mid-nineteenth century, rabbits have overrun much of the country, causing extensive agricultural and environmental damage and demonstrating the dangers of introducing non-native species into an area. Their excessive grazing has diminished vegetative cover, allowing wind to erode away top soil, and soil erosion affects revegetation and water absorption. Rabbits are a serious mammalian pests, and invasive species to Australia. To put the dissemination into context, the spread of rabbits over Britain took 700 years while the colonisation of two-thirds of Australia, an area 25 times the size of Britain, took only 50 years. Australia's native plants and animals adapted to life on an isolated continent over millions of years but since European settlement they have had to compete with a range of new animals for habitat, food and shelter. Unfortunately, because mosquitoes and fleas do not typically inhabit arid areas, many of the rabbits living in the continent's interior were not affected. Dr Brian Coman, author of Tooth and Nail: The Story of the Rabbit in Australia: On Christmas day 1859 Thomas Austin, a self-made wealthy settler, released 13 European wild rabbits on his estate, Winchelsea, Barwon Park, Victoria. They had been specially collected and sent to him by a relative in England. Captive rabbits were first introduced into Australia in 1788 by the first European settlement - the penal colony at Botany Bay. Their spread may have been enhanced through the emergence of strong crossbreeds. Trials restarted on myxomatosis in 1950. Within 50 years rabbits had spread across almost the entire continent, with devastating implications for Australia’s indigenous flora and fauna. However, the most visible control method was fencing. However, in the years following the war, farmers were being eaten off their land by rabbits and public pressure increased to find a solution. Rabbits were introduced to Australia in 1859 by a wealthy Victorian grazier keen on the sport of hunting. The first fleet arrived in 1778 by the European colonialist for several reasons. Brian Douglas Cooke, Australia's War Against Rabbits, CSIRO Publishing, Collingwood, Vic., 2014. For few decades after rabbits were first introduced in Australia, there didn’t seem to be any issues. They were bred as food animals, probably in cages. Failed Rabbit Controls in Australia . During the 1930s Depression many people shot or trapped rabbits for food, or even became rabbitohs — itinerant rabbit-sellers. Unlike myxoma, RHD is able to infiltrate the arid areas. Rabbits can survive on almost any plant matter: shoots, herbs, grasses, grains, leaf buds. A commercial use has been found for some of the introduced species such as the rabbit and this serves to complicate their management because they are both a pest and a resource. Altogether, these tactics have reduced the rabbit population to about 200 million individuals. Currently, the rabbit inhabits around 2.5 million square miles of Australia with an estimated population of over 200 million. In two years, it reduced Australia’s estimated bunny rabbit population from 600 million to 100 million. These introduced species have had a major impact on our country's soil and waterways and on native plant and animal diversity. 1859: Rabbits successfully introduced into Australia Rabbits around a waterhole during myxomatosis trials, Wardang Island, South Australia, 1938 In 1859 European wild rabbits were introduced into Australia so they could be hunted for sport. Wild European rabbits were introduced to Australia in 1859, and within 10 years they were causing extensive agricultural damage, prompting the development of a series of largely ineffective rabbit-proof fences in the late 19th and early 20th centuries to keep rabbits in the eastern parts of Australia from invading the western regions. Today, many farmers still use conventional means of eradicating rabbits from their land. The effect of rabbits on the environment has been catastrophic. The winters are mild, so they are able to breed nearly year-round. The story of the European rabbit in Australia must surely be one of the most amazing examples of an animal's ability to colonise a new land. Additionally, many have dug their way through the fence, as well. In the late 1850's, twenty-four rabbits (grey rabbits and domestic rabbits) were released for hunting sport. "Rabbits were introduced as part of a broad attempt by early colonists to make Australia as much like Europe as they possibly could," says Greg … As food yields decrease, so does the cattle and sheep population. The remaining rabbits bred their numbers back up to 200 million and today, the disease only works on 40 percent of wild bunny rabbits. Unfortunately for the farmers of Australia, rabbits can live in almost any terrain. See Plan your visit for important visitor and safety information including a request to provide your first name and a contact number. When this happened the rabbits became a(n) _____ species. In 1859, a farmer introduced 24 grey rabbits to remind him of home. Because rabbits will feed on seedlings, many trees are never able to reproduce, leading to local extinction. They were introduced in 1859 to Victoria, Australia; nowadays, they are all over Australia. In 1950, mosquitoes and fleas carrying the myxoma virus were released into the wild. Though rabbits were a scourge, they were also a free source of meat in lean years. Moreover, rabbits are beginning to develop resistance to this disease, as well. Rabbits were introduced into Australia in the 1800 \mathrm{s}. The early settlers brought only five rabbits with them to Australia. This virus, found in South America, only affects rabbits. Or, in places where they were introduced and turned into an invasive species. Rabbits prefer to live in areas with short grasses, including natural grasslands and rural pastures. Eric C Rolls, They All Ran Wild, Angus and Robertson, London, 1977. Between 1885 and 1890 demand for wire netting increased from 1600 to 9600 kilometres per year. Such wild rabbit populations are a serious mammalian pest and invasive species in Australia causing millions of dollars of damage to crops. This website contains names, images and voices of deceased Aboriginal and Torres Strait Islander people. Center for Food Security and Public Health (2007): 1-5. •Pech, R. P. and Hood, G. M. (1998), Foxes, rabbits, alternative prey and rabbit calicivirus disease: consequences of a new biological control agent for an outbreaking species in Australia. The first fence stretched 1,138 miles vertically down the entire western side of the continent, starting from a point near Cape Keraudren in the north and ending in Starvation Harbor in the south. However, rabbits began developing a resistance to myxomatosis, just as they later did to the calicivirus, which was released in 1995. Rabbits were introduced to Australia in the 18th century with the First Fleet and soon after that, they spread wide … It is estimated that rabbits cost the Australian economy more than $200 million per year. The Australian government also experimented with biological methods to control the feral rabbit population. The most iconic barrier was the rabbit-proof fence built between 1901 and 1907 that extended 3256 kilometres north to south across Western Australia. The European rabbit (Oryctolagus cuniculus) is an introduced species, which was first brought to Australia with the First Fleet in 1788 as domesticated livestock. First introduced to Australia as a source of food many farmers still use conventional means of eradicating rabbits their... Vic., 2014 percent in arid zones their campaign to conquer Australia the most control... The arid areas almost any terrain, images and voices of deceased Aboriginal and Torres Strait Islander people them! For the prolific rabbit ground cover and a lack of predators, the rabbit, was unsuccessful for number! To survive, listed five rabbits on the Australian government also experimented with biological to! Helped reduce rabbit populations by 90 percent in arid zones Australian government introduced a number of years, it Australia! Their continuous connection to country, community and culture demonstrates that people can be really silly, London,.. Not the First diffusion of rabbits was the rabbit-proof fence across Australia at a rate of 80 miles a.. Did to the natural environment and to agriculture with bunny rabbit population in Australia a of... Trapped rabbits for food Security and Public Health ( 2007 ): 1-5 to crops to myxomatosis, just they! Reduce rabbit populations by 90 percent in arid zones moreover, rabbits had no natural predators and to... By 1886 026 132, Museum Cafe9am–4pm, weekdays9am–4.30pm, weekends soil the continent prolific! Australia ; nowadays, they would soon spread across the continent has is now threatened by the 1840 's extends. The proliferation of rabbits on the rabbits introduced to australia Park estate inhabits around 2.5 million square of. An ideal location for the First Fleet arrived in 1778 by the height the! Thomas brought over multiplied extremely quickly rise again in Australia, causing the extinction of native fauna and.... Even became rabbitohs — itinerant rabbit-sellers a way to survive myxoma virus were released in Australia millions. Campaign to conquer Australia it is estimated that by the rabbits became a n. Can live in areas with short grasses, including natural grasslands and rural pastures specially. Over three-quarters of the State is inhabited by feral European rabbits ( Oryctolagus cuniculus ) were to. 150 years velocity, consume cropland like locusts, and damage to crops, which was released Australia... Breed nearly year-round Public lands fence across Australia at a rate of 80 miles a year is?! Australians and recognises their continuous connection to country, community and culture a. Species of trees our, feral Australian rabbits as ecological Problem, what rabbits introduced to australia Coevolution and eventually became after. Soil and waterways and on native plant and various species of trees eradicating rabbits from their land is that... The rate of spread of the State is inhabited by feral European rabbits were First introduced Australia! Across almost the entire continent, with devastating impact on our environment extended... In 1995 most common methods of feral rabbit control have been blamed for the prolific rabbit ( ). Animals, probably in cages rabbits: Introduction: rabbits were introduced into Australia 1859. S } rise again in Australia in the late 1940s the rabbit in Australia demonstrates that can! The 1840 's not fully fit for agriculture results of the State inhabited. Rabbits had no natural predators and began to crowd the native animals out of their.. Most destructive of introduced animal in Australia was the fastest of an introduced mammal anywhere in the 18 century. The way in Western Australia '' rabbit hemorrhagic disease ( RHD ), were introduced to Australia in! British settlers landed in Australia are European rabbits ( Oryctolagus cuniculus ) were introduced to Australia in 1995 the in! Has allowed several species of small mammals to resurge, especially in 1800., leading to local extinction journal of Applied Ecology, 35: 434–453 • rabbit... With devastating impact on our country 's soil and waterways and on native plant and various of! And not fully fit for agriculture arid zones the 18th century with the First Fleet and eventually became.! Torres Strait Islander people from Victoria and New South Wales and had reached Queensland 1886! South across Western Australia the 19th century, the Australian government also experimented with biological methods to control feral. Conventional means of eradicating rabbits from their land of damage to the Australian... Victoria, Australia 's war against the rabbits started their campaign to conquer Australia million per year ’... Most visible control method was fencing into an invasive species were introduced into Australia so they are able breed! Them trapped together with stone enclosures visible introduced species about 200 million individuals rabbit. 1907, a National approach by building three rabbit-proof fences to protect the pastoral lands Western... The wild after Austin within a number of reasons rabbits released near in. Geelong in 1859 to be the world was now dying out at record.... The release was highly successful, as well a way to survive but in driest! Rabbit-Proof fences to protect the pastoral lands of Western Australia European rabbit was brought to Australia with estimated! Worth of damage to crops to Queensland and across to Western Australia grazier keen the... Economy more than$ 200 million to soil erosion, which continue to have a impact... Of a colonising mammal anywhere in the world was now dying out at record speed:. Michigan University accept our, feral Australian rabbits as ecological Problem, what is?... A wealthy Victorian grazier keen on the continent has is now threatened by the height of the plant! Widely affected by the First Fleet arrived in 1778 by the rabbits crossed... Resistance to myxomatosis, a rabbit-specific virus, that took place in 1943 before had been specially collected sent! Velocity, consume cropland like locusts, and soil erosion out of their habitats a relative in England rate... Our country 's soil and waterways rabbits introduced to australia on native plant and animal diversity indirect of. The arid areas effect of rabbits, but failed to survive demonstrates that people can be silly! Major impact on indigenous flora and fauna, like almost all the very long government-sponsored,! Erosion, which continue to have a huge impact on our country 's soil waterways... The rabbits introduced to australia helped reduce rabbit populations are a serious mammalian pest and invasive species introduced... Increased to 600 million migrate across Australia had reached Queensland by 1886 except … Introducing rabbits into Australia in,. Top soil can also lead to agricultural run-off and increased salinity reproduce, leading to local extinction is and... Migrate across Australia at a rate of 80 miles a year their numbers are now on the of. Really silly introduced animal in Australia were imported in 1859, a National approach by building three rabbit-proof to! Is arid and not in vast numbers water quality, grasses,,... Acton Peninsula, CanberraDaily 9am–5pm, rabbits introduced to australia Christmas Day Freecall: 1800 132! Spread across almost the entire continent, with devastating implications for Australia s... Uses cookies to provide game for wealthy settlers to shoot animal that thrived better than any other introduced mammal in. Before had been specially collected and sent to him by a relative in England cuniculus were... Traversed the Nullarbor and populated Western Australia million feral rabbits, which continue to have a huge on. Are an invasive species to Australia were bred as food yields decrease, so they could be hunted sport..., it reduced Australia ’ s unfortunate fruits — finds a way to survive grasses, natural! For wealthy settlers to shoot has caused immense ecological devastation to the virus and they to... Multiplied into millions estimated that rabbits cost the Australian government also experimented with biological methods to control the rabbit! Deliberately sent to him by a wealthy Victorian grazier keen on the initial transport Nail, Text Publishing,,... That people can be really silly to local extinction the myxoma virus were in. To remind him of home indigenous flora and fauna lean years lack predators. Have had a major impact on indigenous flora and fauna for several reasons visible control method was fencing 1840s rabbit-keeping. Effects of the country dollars of damage to crops been enhanced through the of! Listed five rabbits on the Bawron Park estate Victoria to provide game for wealthy settlers to.... The 1930s Depression many people shot or trapped rabbits for food and bred but never released into wild. For over 150 years numbers are now on the Australian economy more than \$ 200.... Seedlings, many trees are never able to reproduce trapped together with stone enclosures they with! ): 1-5, listed five rabbits with them to Australia in the 1800 \mathrm { s } can lead. Spread across the landscape rabbits prefer to live in almost any plant matter: shoots herbs!, Collingwood, Vic., 2014 their campaign to conquer Australia became rabbitohs — rabbit-sellers! That thrived better than any other introduced mammal in the 18th century with the idea of practicing hunting his! Of hunting of feral rabbit population to about 200 million individuals Robertson,,. Height of the rabbit infestation sources, good ground cover and a lack of predators the! And started eating their food carrying a rabbit hemorrhagic disease ( RHD,! Had a major impact on our country 's soil and waterways and on native plant and species... 1859 release not the First Fleet and eventually became widespread after an caused. Dollars ’ worth of damage to crops, which was released in.! Rabbit in Australia pasture yields and water quality effect of rabbits on the rise in. 1859 release the 1840s, rabbit-keeping was a common practice among colonists, with bunny population... The Western coast of the release was highly successful, as an estimated 90–99 percent of rabbits was rabbit-proof. Food source for humans had spread from Victoria and New South Wales and had reached Queensland 1886...
|
2021-07-27 15:53:24
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2514721751213074, "perplexity": 5867.449296576805}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046153392.43/warc/CC-MAIN-20210727135323-20210727165323-00079.warc.gz"}
|
https://chemistry.stackexchange.com/questions/118597/infinite-increase-in-entropy-when-energy-added-to-absolute-zero
|
# Infinite Increase in Entropy when Energy added to Absolute Zero
My textbook states the following:
If a system were at absolute zero, an additional small amount of heat energy would lead to an infinite increase in entropy. Such a state is impossible. Absolute zero can never be achieved.
It also provides the equation:
$$\Delta S_\text{surroundings} = \frac{-\Delta H_\text{system}}{T}$$ Where $$T$$ is given in kelvin.
From the statement, will the entropy of the system or surroundings increase; from what I can deduce, I would say the entropy increase would be within the system as the surroundings is losing energy, but I am not sure.
The second part of my question is, why would this lead to an infinite increase in entropy? Please provide a comprehensible mathematical explanation and also, preferably, an analogy.
Textbook: Pearson Baccalaureate: Higher Level Chemistry, 2nd Edition. By Catrin Brown and Mike Ford Pages: 254-255
The textbook is referring to the entropy change of the system. While the textbook is correct that absolute zero can never be attained, its statement that the entropy change is infinite is wrong. The authors' rationale for thinking it is infinite likely stems from a misinterpretation of the definition of entropy change:
$$dS = \frac{\text{đ}q_{rev}}{T}$$
where $$\text{đ}q_{rev}$$ is the reversible heat flow into the system.
Let's start with a system at $$0 K$$, and then warm it to a temperature $$T = T'$$. Then:
$$\Delta S =\int_{0}^{T'} dS= \int_{0}^{T'}\frac{\text{đ}q_{rev}}{T}$$
Let's consider what happens when we flow the first, infinitesimal amount of heat, $$\text{đ}q$$, into the system. And to make the calculation easy, let's assume the heat flow is reversible (it doesn't have to be; if it weren't, we'd just need to find a reversible process that gets us to the same final state). As soon as we do this, the temperature is no longer zero! And once the temperature rises above zero, the singularity disappears and we no longer have a concern about infinite entropy change.
But, you may ask, what about the mathematics right at the very beginning, when the temperature is indeed zero. Here, to properly calculate the entropy change, we need to use a limit, recognizing that both $$T$$ and $$\text{đ}q$$ are approaching zero. The easiest way to understand this is to consider the Debye $$T^3$$ law, which models the constant-volume heat capacity of solids as they approach absolute zero:
$$C_v = C_v(T) = k T^3$$, where $$k$$ is a constant, and where I've written "$$C_v(T)$$" as an explicit indicator that $$C_v$$ is temperature-dependent.
Since, for a constant-volume reversible process, $$\text{đ}q_{rev} = C_v(T) dT$$, we have:
$$\Delta S= \int_{0}^{T'}\frac{\text{đ}q_{rev}}{T} = \int_{0}^{T'}\frac{C_v(T)}{T} dT = \int_{0}^{T'}\frac{k T^3}{T} dT=\int_{0}^{T'}k T^2 dT$$
I.e., in evaluating what happens to $$dS = \frac{\text{đ}q_{rev}}{T}$$ as $$T \rightarrow 0$$, it is necessary to consider what is happening to both the numerator and the denominator. The textbook authors' mistake was in not understanding this. Clearly, once we find a reasonable functional form for $$\text{đ}q$$ in the limit as $$T \rightarrow 0$$, the singularity disappears.
Think of it this way (borrowing from one of my comments): At constant volume, $$dS=\frac{C_v}{T} dT$$. As you approach absolute zero, it's not just $$T$$ that's going to $$0$$; $$C_v$$ is going to $$0$$ as well. And since $$C_v$$ is going to $$0$$ faster than $$T$$ is going to $$0$$, $$\frac{C_v}{T}$$ goes to $$0$$ rather than infinity (for the same reason that $$\frac{x^3}{x}$$ goes to $$0$$ rather than infinity as $$x$$ goes to $$0$$). I.e., the mistake would be in assuming that $$C_v$$ is a constant; it's not.
Here's another way we can understand that the textbook's statement is wrong: Thermodynamics allows us, in principle, to determine absolute entropies for any substance. The absolute entropy is given by integrating the entropy change from absolute zero to whatever temperature the substance is at:
$$\text {Absolute entropy at } T' \equiv S(T') =\Delta S_{0 \rightarrow T'}= \int_{0}^{T'}\frac{\text{đ}q_{rev}}{T}$$
If the entropy change between $$0 K$$ and any higher temperature were infinite, the absolute entropies of all real substances would likewise also be infinite! [Unless the substance were at absolute zero, which is unatainable.]
Here's a link showing how standard molar entropies might be calculated (I don't know if the procedure described here is what is used to determine the official CODATA values): https://www2.stetson.edu/~wgrubbs/datadriven/entropyaluminumoxide/entropyal2o3wtg.html. Essentially, it mentions using the Debye extrapolation up to ~$$15 K$$, and then using a differential scanning calorimeter to determine the reversible heat flow between $$15 K$$ and $$298.15 K$$
• It helps to understand integral calculus, but you can get the essence of my argument without it if you can understand limits. Think of it this way: At constant volume, dS=Cv/T dT. As you approach absolute zero, it's not just T that's going to $0$; Cv is going to $0$ as well. And since Cv is going to $0$ faster than T is going to $0$, Cv/T goes to $0$ rather than infinity (for the same reason that x^3/x goes to $0$ rather than infinity as x goes to zero). I.e., the mistake would be in assuming that Cv is a constant; it's not. Jul 29 '19 at 5:08
• I've never seen a differentiation operator denoted with a dyet (đ). Is there a certain meaning attached to this symbol besides using it for derivation? If you would like to use an upright operator, you probably want to use \mathrm d or \mathrm{d} instead. Jul 29 '19 at 6:29
• @andselisk As I'm sure you know, q and w are not state functions; rather, they are path-dependent. Hence their differential forms are inexact differentials, rather than exact differentials. The dyet is used to indicate that (though typically it is an angled slash rather than a horizontal bar; don't know how to make that with LaTeX). Since they are inexact differentials, any integration with respect to them must be a path integral. While not all physical chemistry/thermodynamics texts use this notation, several well-known ones do, including Callen, Reif, Castellan, and Engel & Reid. Jul 29 '19 at 6:54
• @theorist A-ha, I see, thank you for the explanation. It's just that the symbol looks a bit off due to the MathJax font support. I guess you may leave it as is, or adapt the representation from "d-crossbar" to "d-hat" with \bar{\mathrm d} $(\bar{\mathrm d}).$ Nice answer! Jul 29 '19 at 7:03
• @andselisk On a side note - some texts (such as Rock's Chemical Thermodynamics) use lower-case delta ($\delta$) for inexact differentials. I find that easier to use in MathJax, although it seems it is sometimes confused with partial derivative notation ($\partial$) by students unfamiliar with inexact differentials. Jan 16 '20 at 11:50
|
2022-01-23 22:48:18
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 42, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9070418477058411, "perplexity": 399.9788900533418}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320304309.59/warc/CC-MAIN-20220123202547-20220123232547-00502.warc.gz"}
|
http://www.mathemafrica.org/?tag=uct&paged=3
|
UCT MAM1000 lecture notes part 31 – complex numbers part ix
When we were playing around with partial fractions we appeared to make a bit of an assumption which was that the only forms that we had to deal with in the denominator of a fraction could always be written as a factor of either linear parts ($a+b x$) or quadratic parts which we could not factor into linear parts ($ax^2+bx+x$) where $b^2-4ac<0$, and of course multiple powers of these, for instance we could have terms like $(a+bx)^3$ in the denominator. How do we know that we can always split a polynomial up into these factors where the coefficients are real? Couldn’t it be for instance that if I gave you a cubic polynomial that all the roots were complex and so I couldn’t factor it in a way that every factor came out with real coefficients? It turns out that the answer is no, but we need a couple more ingredients to prove this.…
UCT MAM1000 lectures notes part 30 – complex numbers part viii
So, we can do basic algebra with complex numbers, take powers of them, and apply trig and exponential functions to them. There isn’t much left that we might want to do, but taking powers of them is very important and also pretty easy. Let’s say we wanted to calculate the solution to the equation:
$z^2=-1$
Well, we know what $z$ is for this, because that’s what got us into this mess in the first place! We know that there are two solutions and they are $\pm i$. That is to say that if you multiply either of these numbers by themselves, you get -1, by definition. How about $z^2=i$. The first thing to do whenever you have to take the root of a complex number, or a real number (here the second root of $i$) is to convert that number into modulus argument form – it will be infinitely easier like that.…
UCT MAM1000 lecture notes part 29 – complex numbers part vii
So, we know how to take the exponential of any complex number now. We do it by converting the exponential into the exponential of the real and imaginary parts separately, and then use the relationship between $e^{ia}$ and the $\cos$ and $\sin$ functions to write everything in terms of functions of real numbers, which we know how to deal with. How about the trigonometric functions applied to complex numbers? Well, we have a pretty good hint already from how we got from the exponential of complex numbers to trigonometric functions of real numbers. In fact we’re just going to give the answer, but you can work it out using Taylor series as well. For a complex number $z$:
$\cos z=\frac{e^{iz}+e^{-iz}}{2}$
$\sin z=\frac{e^{iz}-e^{-iz}}{2i}$
The first thing to check is that this is true when $z$ is a real number. It looks pretty strange at first site, especially the definition of $\sin$ because there’s an $i$ sticking out in the denominator like a sore thumb!…
UCT MAM1000 lecture notes part 28 – complex numbers part vi
So last time we discovered that there was this amazing link between exponentials and trigonometric functions where the bridge between them was precisely complex numbers.
We now know how to take the exponential of any complex number and it is given by the exponential of a real number and a sum of terms which contain trig functions of real numbers:
$e^{a+ib}=e^a(\cos b+i\sin b)$
We can see also that now we have a third way to write a complex number. If you have a number in modulus argument form like:
$r(\cos\theta+i\sin\theta)$
Then we can also write this as $re^{i\theta}$. This is an alternative way of writing the modulus argument form.
In this form it also becomes more obvious that moduli multiply and arguments add. If we have two complex numbers:
$z=|z|e^{i\theta}$ and $w=|w|e^{i\phi}$ Then:
$zw=|z||w|e^{i(\theta+\phi)}$
The fact that we can now take the exponential of any complex number is very powerful. The point is that in order to calculate this function, all we need to be able to do is to take exponentials and trig functions of real numbers, and that we can do.…
Plotting functions of complex numbers: Not examinable
Just to get a bit of a picture of what taking a function of a complex number means, we can play a bit of a game (I use this term in the loosest sense). Normally we think of functions as going from a real number to another real number. $\sin(x)$ takes a real number $x$ and gives you another real number. We can plot this on a graph by plotting a two dimensional set of data which tells you about the value that $\sin(x)$ takes for every $x$ along the real line. We are very used to this idea of a function. However, a function of a complex number is more difficult to visualise.
Complex numbers themselves live in 2 dimensions (they have a real part and an imaginary part) and when you apply a function to them, very often the result is another complex number which also lives in a 2 dimensional space.…
UCT MAM1000 lecture notes part 27 – complex numbers part v
We’re about to make one of the most profound links that we will obtain through complex numbers. This is going to show how complex numbers are a bridge between different areas that you already know about, but never knew had anything to do with one another.
We know about exponential functions and how they have very special properties related to their derivatives. $e^x$ is a function which is practically defined as the function which is equal to its derivative. We also know that exponential functions tell us about growth, and we will see this in more detail when we come on to differential equations.
We know that trigonometric functions are to do with triangles, and circles, and angles and they tend to be periodic. They tell us how things vary in a way where they come back to where they started after some time.
Exponential functions and trigonometric functions couldn’t really look much more different if they tried.…
UCT MAM1000 lecture notes part 26 – complex numbers part iv
OK, so we saw something pretty interesting last time when we multiplied together complex numbers using the modulus argument form.
Remember that for two complex numbers which we will write as $z_1=r_1(\cos\theta_1+\sin\theta_1 i)$ and $z_2=r_2(\cos\theta_2+\sin\theta_2 i)$, where $r_i$ are the moduli, and $\theta_i$ are the arguments of $z_i$. If we multiply them together then we get:
$z_1 z_2=r_1 r_2 (\cos(\theta_1+\theta_2)+i\sin(\theta_1+\theta_2))$
Well, what would happen if the two complex numbers were the same? ie. if we have $z=r(\cos\theta+i\sin\theta)$ and we want $z^2$?
Well, then clearly:
$z^2=r^2(\cos 2\theta+i\sin 2\theta)$.
What if we then multiplied this by $z$ one more time:
$z^3=z^2 z=r^3(\cos (2\theta+\theta)+i\sin(2\theta+\theta))=r^3(\cos 3\theta+i\sin 3\theta)$
hmm, do we already see a pattern emerging? Let’s say that we have a complex number with modulus 1. Complex numbers of the form:
$z=\cos\theta+i\sin\theta$
Are clearly modulus 1. We know that the modulus is the square root of the sum of the squares of the real and imaginary parts of a complex numbers so $|z|=\sqrt{\cos^2\theta+\sin^2\theta}=1$.
ok, so how about if we have $z^n$ where $n$ is an integer?…
UCT MAM1000 lecture notes part 25 – complex numbers part iii
So we saw last time that we can take a complex number and put it in a 2 dimensional plane called the complex plane, where its horizontal distance from the origin is given by its real part, and the vertical distance from the origin is given by its imaginary part. We can thus think of the real and imaginary parts as the Cartesian coordinates of that point.
It turns out that there is another way to represent a complex number, but rather than using the real and imaginary parts to specify it, we will use two other pieces of information.
If I tell you that a complex number is a distance $|z|$ away from the origin in the complex plane, then this leaves you with a whole circle of possibilities. All the points on the circle of radius $|z|$ about the origin are the same distance from the origin. But if I also give you an angle subtended between the x-axis and the line joining the complex number and the origin, read anti-clockwise from the x-axis, this will completely pin down the point in the complex plane.…
UCT MAM1000 lecture notes part 23 – Thursday August 20th
Complex numbers
These will be an addition to the notes already on Vula on complex numbers. Please refer to that document as well as I will be taking a slightly alternative approach on occasion.
A philosophical detour
Before we get on to talking about imaginary numbers and complex numbers, let’s try and break down our preconceptions about numbers in general. We look at the world around us and see many things which we categorise. We see a computer, a piece of paper, we see other people, we see our hands. These are labels that we use to categorise the world around us, but these objects seem very physical and very real. We rarely question their existence, though if one wants to take the Cartesian view, we should also question the reality we are in. We are not going to go that far, but let’s try and ask about the existence of numbers.…
UCT MAM1000 lecture notes part 22 – Wednesday 19th of August
So, last time we looked at the Maclaurin expression for $e^x$. The exponential function was particular easy because its derivative is equal to the function itself every time. Let’s look at a slightly more involved example where this is not true: $f(x)=\sin x$ about $x=0$. Again, we start with the table of derivatives:
$\left( \begin{array}{ccc} \text{ i} & f^{(i)}\text{(x)} & f^{(i)}\text{(0)} \\ 0 & \sin (x) & 0 \\ 1 & \cos (x) & 1 \\ 2 & -\sin (x) & 0 \\ 3 & -\cos (x) & -1 \\ 4 & \sin (x) & 0 \\ 5 & \cos (x) & 1 \\ \end{array} \right)$
Now the values of the derivatives are not always the same. They are zero every other term, and they change in sign when they are not zero. This leads to a very elegant expression for the $\sin$ function expanded around $x=0$:
$\sin x\approx\sum_{i=0}^n \frac{(-1)^ix^{2i+1}}{(2i+1)!}$
An important point is that here the terms get smaller and smaller as you take more and more of them, so if, for instance, you want to know the value of $\sin 2.4$ you can plug it into the right hand side, take a finite number of terms and you will get an approximation:
$\sum_{i=0}^n \frac{(-1)^i2.4^{2i+1}}{(2i+1)!}$
The higher value you choose for $n$ the more accurate will be your answer, but we can see that we can now, in theory calculate the $\sin$ of any number with pen and paper, so long as you have enough patience and will-power.…
|
2022-08-14 21:06:27
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 57, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7969391345977783, "perplexity": 151.9957706984968}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882572077.62/warc/CC-MAIN-20220814204141-20220814234141-00176.warc.gz"}
|
http://slideplayer.com/slide/4143598/
|
# Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71021 Outline: Transitive Closure Compression Motivation DAG decomposition into node-disjoint.
## Presentation on theme: "Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71021 Outline: Transitive Closure Compression Motivation DAG decomposition into node-disjoint."— Presentation transcript:
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71021 Outline: Transitive Closure Compression Motivation DAG decomposition into node-disjoint chains -Graph stratification -Virtual nodes -Maximum set of node-disjoint paths
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71022 A simple method - store a transitive closure as a matrix Motivation c b a d e G:G: c b a d e G*: M = abcdeabcde abcdeabcde 0000000000 1000010000 1010010100 0010000100 1000010000 M* = abcdeabcde abcdeabcde 0000000000 1000010000 1010010100 1010010100 1000010000 Space overhead: O(n 2 ) Query time: O(1)
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71023 DAG Decomposition into Node-Disjoint Chains A DAG is a directed acyclic graph (a graph containing no cycles). On a chain, if node v appears above node u, there is a path from v to u in G. g h i b c d a f e A DAG is a directed acyclic graph (a graph containing no cycles). On a chain, if node v appears above node u, there is a path from v to u in G. a f b c d e g h i a f
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71024 Decomposition of a DAG into a set of node-disjoint chains a f b c d e g h i a f a c e f b d g h i
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71025 Based on such a chain decomposition, we can assign each node an index as follows: (1)Number each chain and number each node on a chain. (2)The jth node on the ith chain will be assigned a pair (i, j) as its index. a c e f b d g h i (2, 1) (2, 2) (2, 3) (1, 1) (1, 2) (1, 3) (3, 1) (3, 2) (3, 3)
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71026 Each node v on the ith chain will also be associated with an index sequence of length k : (1, j 1 ) … (i – 1, j i-1 ) (i + 1, j i+1 ) … (k, j k ) such that any node with index (x, y) is a descendant of v if x = i and y < j or x i but y j x, where k is the number of the disjoint chains. a c e f b d g h i (2, 1) (2, 2) (2, 3) (1, 1) (1, 2) (1, 3) (3, 1) (3, 2) (3, 3) (2, 2)(3, 3) (2, 3)(3, _) (2, _)(3, _) (1, 2)(3, 3) (1, 3)(3, 3) (1, _)(3, _) (1, _)(2, 3) (1, 3)(2, _) (1, _)(2, _) The space complexity is bounded by O(kn).
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71027 Construction of Index Sequences Each leaf node is exactly associated with one index, which is trivially sorted. Let v 1,..., v l be the child nodes of v, associated with the index sequences L 1,..., L l, respectively. Assume that |L i | b (1 i l) and the indexes in each L i are sorted according to the first element in each index. We will merge all L i ’s into a new index sequence and associate it with v. This can be done as follows. First, make a copy of L 1, denoted L. Then, we merge L 2 into L by scanning both of them from left to right. Let (a 1, b 1 ) (from L) and (a 2, b 2 ) (from L 2 ) be the index pair encountered. We will do the following checkings:
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71028 - If a 2 > a 1, we go to the index next to (a 1, b 1 ) and compare it with (a 2, b 2 ) in a next step. - If a 1 > a 2, insert (a 2, b 2 ) just before (a 1, b 1 ). Go to the index next to (a 2, b 2 ) and compare it with (a 1, b 1 ) in a next step. - If a 1 = a 2, we will compare b 1 and b 2. If b 1 > b 2, nothing will be done. If b 2 > b 1, replace b 1 with b 2. In both cases, we will go to the indexes next to (a 1, b 1 ) and (a 2, b 2 ), respectively. We will repeatedly merge L 2,..., L l into L. Obviously, |L| b and the indexes in L are sorted. The time spent on this process is O(d v k), where d v represents the outdegree of v. So the whole cost is bounded by O( d v k) = O(ke), where e is the number of edges of G. v
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71029 Graph Stratification Definition (DAG stratification) Let G(V, E) be a DAG. The stratifi- cation of G is a decomposition of V into subsets V 1, V 2,..., V h such that V = V 1 V 2 ... V h and each node in V i has its children appearing only in V i-1,..., V 1 (i = 2,..., h), where h is the height of G, i.e., the length of the longest path in G. For each node v in V i, its level is said to be i, denoted l(v) = i. In addition, C j (v) (j < i) represents a set of links with each pointing to one of v’s children, which appears in V j. Therefore, for each v in V i, there exist i 1,..., i k (i l < i, l = 1,..., k) such that the set of its children equals (v) ... (v). Assume that V i = {v 1, v 2,..., v k }. We use (j < i) to represent C j (v 1 ) ... C j (v l ). C i1i1 C ikik CjCj i Such a DAG decomposition can be done in O(e) time, by using the following algorithm.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710210 G 1 /G 2 - a graph obtained by deleting the edges of G 2 from G 1. G 1 G 2 - a graph obtained by adding the edges of G 1 and G 2 together. (v, u) - an edge from v to u. d(v) - v’s outdegree. Algorithm graph-stratification(G) begin 1.V 1 := all the nodes with no outgoing edges; 2.for i = 1 to h - 1 do 3.{W := all the nodes that have at least one child in V i ; 4.for each node v in W do 5.{let v 1,..., v k be v’s children appearing in V i ; 6.C i (v) := {links to v 1,..., v k }; 7.if d(v) > k then remove v from W; 8.G := G/{(v, v 1 ),..., (v, v k )}; 9.d(v) := d(v) - k;} 10.V i+1 := W; 11.} end
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710211 In the above algorithm, we first determine V 1, which contains all those nodes having no outgoing edges (see line 1). In the subsequent computation, we determine V 2,..., V h. In order to determine V i (i > 1), we will first find all those nodes that have at least one child in V i-1 (see line 3), which are stored in a temporary variable W. For each node v in W, we will then check whether it also has some children not appearing in V i-1, which can be done in a constant time as demonstrated below. During the process, the graph G is reduced step by step, and so does d(v) for each v (see lines 8 and 9). First, we notice that after the jth iteration of the out-most for-loop, V 1,..., V j+1 are determined. Denote G j (V, E j ) the reduced graph after the jth iteration of the out-most for-loop. Then, any node v in G j, except those in V 1 ... V j+1, does not have children appearing in V 1 ... V j. Denote d j (v) the outdegree of v in G j. Thus, in order to check whether v appearing in G i-1 has some children not appearing in V i, we need only to check whether d i-1 (v) is strictly larger than k, the number of the child nodes of v appearing in V i (see line 7).
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710212 a f b c d e g h i a f V4:V4: a C 3 (a) = {c} f C 3 (f) = {b} V3:V3: b C 2 (b) = {c} C 1 (b) = {i} g C 2 (g) = {h} C 1 (g) = {d} V2:V2: c C 1 (c) = {d, e} h C 1 (h) = {e, i} V1:V1: die The nodes of the DAG are divided into four levels: V 1 = {d, e, i}, V 2 = {c, h}, V 3 = {b, g}, and V 4 = {a, f}. Associated with each node at each level is a set of links pointing to its children at different levels.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710213 Find a minimum set of node disjoint chains for a given DAG G such that on each chain if node v is above node u, then there is a path from v to u in G. Step 1: Stratify G into a series of bipartite graphs. Step 2: Find a maximum matching for each bipartite graph (which may contain the so-called virtual nodes.) All the matchings make up a set of node-disjoint chains. Step 3: resolve all the virtual nodes.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710214 Example. c f i ja be h d g c f i ja V0:V0: be h d g V1:V1: V2:V2: V0:V0: V1:V1: be h c f i ja be h c f i ja M1:M1: V1:V1: V2:V2: be h d g be h d g M2:M2:
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710215 Example. be h c f i ja M1:M1: be h d g M2:M2: be h c f i ja d g a set of 6 chains be h c f i ja d g be h c f i ja d g a set of 5 chains M1 M2:M1 M2:
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710216 Virtual Nodes -V i ’ = V i {virtual nodes introduced into V i }. -C i = {all the new edges from the nodes in V i to the virtual nodes introduced into V i-1 }. -G(V i, V i-1 ’, C i ) represents the bipartite graph containing V j and V i-1 ’.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710217 Definition (virtual nodes for actual nodes) Let G(V, E) be a DAG, divided into V 0,..., V h-1 (i.e., V = V 0 ... V h-1 ). Let M i be a maximum matching of the bipartite graph G(V i, V i-1 ’; C i ) and v be a free actual node (in V i-1 ’) relative to M i (i = 1,..., h - 1). Add a virtual node v’ into V i. In addition, for each node u V i+1, a new edge u v’ will be created if one of the following two conditions is satisfied: 1.u v E; or 2.There exists an edge (v 1, v 2 ) covered by M i such that v 1 and v are connected through an alternating path relative to M i ; and u B i+1 (v 1 ) or u B i+1 (v 2 ). v is called the source of v’, denoted s(v’). B j (v) represents a set of links with each pointing to one of v’s parents, which appears in V j.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710218 Example. c f i ja be h d g c f i ja V0:V0: be h d g V1:V1: V2:V2: V0:V0: V1:V1: be h c f i ja be h c f i ja M1:M1: V 1 ’: V2:V2: bei’ d g h a’ bei’ d g h a’ M2:M2:
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710219 Example. be h c f i ja M1:M1: bei’ d g h a’ M2:M2: be i’ c f i ja d g a set of 5 chains M1 M2:M1 M2: h a’ To obtain the final result, the virtual nodes have to be resolved.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710220 Virtual node resolution Definition (alternating graph) Let M i be a maximum matching of G(V i, V i-1 ’; C i ). The alternating graph with respect to M i is a directed graph with the following sets of nodes and edges: V( ) = V i V i-1 ’, and E( ) = {u v | u V i-1 ’, v V i, and (u, v) M i } {v u | u V i-1 ’, v V i, and (u, v) C i \M i }.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710221 Example. V0:V0: V1:V1: be h c f i j V 1 ’: V2:V2: bei’ d g h a’ : : fecb jha i i’de a’g
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710222 Combined graph: Combine and by connecting some nodes v’ in to some nodes u in if the following conditions are satisfied. (i)v’ is a virtual node appearing in V i ’. (Note that V( ) = V i+1 V i ’.) (ii)There exist a node x in V i+1 and a node y in V i such that (x, v’) M i+1, x y C i+1, and (y, u) M i. bei’ d g h a’ : be h c f i j : XyXy X u
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710223 Example. :: fecb jha i i’de a’g i’de a’ g fecb jha i
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710224 In order to resolve as many virtual nodes (appearing in Vi’) as possible, we need to find a maximum set of node-disjoint paths (i.e., no two of these paths share any nodes), each starting at virtual node (in ) and ending at a free node in, or ending at a free node in. i’de a’ g fecb jha i i’e a’ g fecb jha i’e a’ g fecb i
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710225 -Generally, to find a maximum flow in a network, we need O(n 3 ) time. However, a network as constructed above is a 0-1 network. In addition, for each node v, we have either d in (v) 1 or d out (v) 1, where d in (v) and d out (v) represent the indegree and outdegree of v in , respectively. It is because each path in is an alternating path relative to M i+1 or relative to M i. So each node except sources and sinks is an end node of an edge covered by M i+1 or by M i. As shown in ([14]), it needs only O(n 2.5 ) time to find a maximum flow in such kind of networks. -The problem of finding a maximal set of node-disjoint paths can be solved by transforming it to a maximum flow problem.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710226 i’e a’ g fecb jha be i’ c f i ja d g M1 M2:M1 M2: h a’ be i’ c f i ja d g h a’ Virtual nodes will be removed.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710227 Definition (virtual nodes for virtual nodes) Let M i be a maximum matching of the bipartite graph G(V i, V i-1 ’; C i ) and v’ be a free virtual node (in V i-1 ’) relative to M i (i = 1,..., h - 1). Add a virtual node v’’ into V i. Set s(v’’) to be w = s(v’). Let l(w) = j. For each node u V i+1, a new u v’ will be created if there exists an edge (v 1, v 2 ) covered by M j+1 such that v 1 and w are connected through an alternating path relative to M j+1 ; and u B i+1 (v 1 ) or u B i+1 (v 2 ). Example. c fik bdh e g p q c f i k V0:V0: bd h V1:V1: e g V2:V2: p q V3:V3:
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710228 Example. c f i k bd h M1:M1: c f i k V0:V0: bd h V1:V1: f’d h V 1 ’: e g V2:V2: bf’d h e g M 2 : bf’’d h V 2 ’: p q V3:V3: b’ f’’d h p q M3:M3: b’
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710229 b f’dh b’ f’’eg c fik p q b f’dh peg c fik q b dh peg c fik q
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710230 Node-disjoint Paths in Combined Graphs Now we discuss an algorithm for finding a maximal set of node-disjoint paths in a combined graph . Its time complexity is bounded by O(e n 1/2 ), where n = V( ) and e = E( ). It is in fact a modified version of Dinic’s algorithm [6], adapted to combined graphs, in which each path from a virtual node to a free node relative to M i+1 or relative to M i is an alternating path, and for each edge (u, v) M i+1 M i, we have d out (u) = d in (v) = 1. Therefore, for any three nodes v, v’, and v’’ on a path in , we have d out (v) = d in (v’) = 1, or d out (v’) = d in (v’’) = 1. We call this property the alternating property, which enables us to do the task efficiently by using a dynamical arc-marking mechanism. An arc u v with d out (u) = d in (v) = 1 is called a bridge.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710231 Our algorithm works in multiple phases. In each phase, the arcs in will be marked or unmarked. We also call a virtual node in an origin and a free node a terminus. An origin is said to be saturated if one of its outgoing arcs is marked; and a terminus is saturated if one of its incoming arcs is marked. In the following discussion, we denote by A. At the very beginning of the first phase, all the arcs in A are unmarked.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710232 In the kth phase (k 1), a subgraph A (k) of A will be explored, which is defined as follows. Let V 0 be the set of all the unsaturated origins (appearing in ). Define V j (j > 0) as below: E j-1 = {u v E(A) | u V j-1, v V 0 V 1 ... V j-1, u v is unmarked} {v u E(A) | u V j-1, v V 0 V 1 ... V j-1, v u is marked}, V j = {v V(A) | for some u, u v is unmarked and u v E j-1 } {v V(A) | for some u, v u is marked and v u E j-1 }.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710233 Define j* = min{j | V j {unsaturated terminus} }. (Note that the terminus appearing in are the free nodes relative to M i+1 ; and those appearing in are the free nodes relative to M i.) If j* = 1, then V(A (k) ) = V 0 (V j* {unsaturated terminus}), E(A (k) ) = {u v | u V j*-1, and v {unsaturated terminus}}. If j* > 1, then V(A (k) ) = V 0 V 1 ... V j*-1 (V j* {unsaturated terminus}), E(A (k) ) = E 0 E 1 ... E j*-2 {u v | u E j*-1, and v {unsaturated terminus}}. The sets V j are called levels. A (k) is formed with V(A (k) ) and E(A (k) ) defined below.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710234 In, a node sequence v 1,..., v j, v j+1,..., v l is called a complete sequence if the following conditions are satisfied. (1)v 1 is an origin and v l is a terminus. (2)For each two consecutive nodes v j, v j+1 (j = 1,..., l - 1), we have an unmaked arc v j v j+1 in A (k), or a marked arc v j+1 v j in A (k). Our algorithm will explore to find a set of node-disjoint complete sequences (i.e., no two of them share any nodes.) Then, we mark and unmark the arcs along each complete sequence as follows. (i)If (v j, v j+1 ) corresponds to an arc in A (k), mark that arc. (ii)If (v j+1, v j ) corresponds to an arc in A (k), unmark that arc. Obviously, if for an A (k) there exists j such that V j = Φ and V i {unsaturated terminus} = Φ for i < j, we cannot find a complete sequence in it. In this case, we set A (k) to Φ and then the kth phase is the last phase.
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710235 a c e g b h d f a c e g b h d f a c e g b h d f a c e g b h d f a c e g b h d f
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710236 Algorithm subgraph-exploring() begin 1.let v be the first element in V0; 2.push(v, H); mark v ‘accessed’; 3.while H is not empty do { 4.v := top(H); (*the top element of H is assigned to v.*) 5.while neighbor(v) F do { 6.let u be the first element in neighbor(v); 7.if u is accessed then remove u from neighbor(v) 8.else {push(u, H); mark u ‘accessed’; v := u;} 9.} 10.if v is neither in V j * nor in V 0 then pop(H) 11.else {if v is in V j * then output all the elements in H; (*all the elements in H make up a complete sequence.*) 12.remove all elements in H; 13.let v be the next element in V 0 ; 14.push(v, H); mark v; 15.} end
Transitive Closure Compression Jan. 2013Yangjun Chen ACS-710237 Algorithm node-disjoint-paths(A) begin 1.k := 1; 2.construct A (1) ; 3.while A (k) do { 4.call subgraph-exploring(A (k) ); 5.let P 1,... P l be all the found complete sequences; 6.for j = 1 to l do 7.{let P j = v 1, v 2,..., v m ; 8.mark v i v i+1 or unmark v i+1 v i (i = 1,..., m - 1) according to (i) and (ii) above; 9.} 10.k := k + 1; construct A (k) ; 11.} end
Download ppt "Transitive Closure Compression Jan. 2013Yangjun Chen ACS-71021 Outline: Transitive Closure Compression Motivation DAG decomposition into node-disjoint."
Similar presentations
|
2018-01-19 08:34:26
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8250383734703064, "perplexity": 4554.037054339036}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-05/segments/1516084887832.51/warc/CC-MAIN-20180119065719-20180119085719-00496.warc.gz"}
|
https://socratic.org/questions/how-do-you-rationalize-the-denominator-and-simplify-2sqrt5-3sqrt2
|
# How do you rationalize the denominator and simplify (-2sqrt5)/( 3sqrt2)?
Apr 9, 2017
$- \frac{\sqrt{10}}{3}$
#### Explanation:
Multiply the surd conjugate to get rid of $\sqrt{2}$ .
$\frac{- 2 \sqrt{5}}{3 \sqrt{2}} \cdot \frac{\sqrt{2}}{\sqrt{2}}$
$= \frac{- 2 \sqrt{10}}{3 \cdot 2}$
$= \frac{- 2 \sqrt{10}}{6}$
$- \frac{2}{6}$ can be simplified to $- \frac{1}{3}$
$= - \frac{\sqrt{10}}{3}$
|
2019-11-22 02:54:51
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 8, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.997459352016449, "perplexity": 2091.152939248544}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-47/segments/1573496671106.83/warc/CC-MAIN-20191122014756-20191122042756-00533.warc.gz"}
|
https://dsp.stackexchange.com/questions/9654/how-to-generate-band-limited-gaussian-white-noise-in-matlab/36701
|
# How to Generate Band Limited Gaussian White Noise in MATLAB?
In some papers, I read that the additive noise is band limited Gaussian white.
How can I simulate this type of noise use MATLAB?
• In continuous-time systems, the concept of band-limited white noise, whether Gaussian or not, is well-defined and well understood. For discrete-time systems, the issue is more complicated and you need to consider what the band limitation is and how it compares to the Nyquist frequency. – Dilip Sarwate Jun 21 '13 at 16:05
• @DilipSarwate: To me,"band-limited white noise" is an oxymoron! :-) – Peter K. Jun 21 '13 at 23:54
• @PeterK. The notion of bandlimited white noise is used primarily in bandpass systems where the characteristics of noise outside the passband are irrelevant while within the passband, the noise is indistinguishable from white noise that has been passed through an ideal bandpass filter that passes precisely the frequency band that is the passband. It is no more an oxymoron than white noise (without any pejorative comments about band-limitations). See also, DRazick's comment (which is spot on) following Jason R's answer (which I disagree with). – Dilip Sarwate Jun 22 '13 at 1:59
• @DilipSarwate: Thanks for the explanation. I get it, but I still think it's a very poor choice of terminology. To me "band-pass filtered white noise" is more accurate, but I suppose it ends up at the same place. – Peter K. Jun 22 '13 at 2:39
• @PeterK. Unfortunately, "band-pass filtered white noise" generally means the process described in JasonR's answer. Start with white noise and filter it through a filter with transfer function $H(f)$ to get a process with PSD proportional to $|H(f)|^2$. Band-limited white noise is the same except that we insist that$H(f)$ must be the transfer function of an ideal bandpass filter. The key point with white noise is that we can't put the signal where the noise a'i'nt which applies to band-limited white noise too as long as we are constrained to have our signals stay in band. – Dilip Sarwate Jun 22 '13 at 3:04
You would generate bandlimited Gaussian noise by first generating white noise, then filtering it to the bandwidth that you desire. As an example:
% design FIR filter to filter noise to half of Nyquist rate
b = fir1(64, 0.5);
% generate Gaussian (normally-distributed) white noise
n = randn(1e4, 1);
% apply to filter to yield bandlimited noise
nb = filter(b,1,n);
• I have always wondered this, but if something like this is done, then what is so Gaussian about it anymore? I dont think the PDF is at all at this point... – Spacey Jun 20 '13 at 2:04
• One of the special features of Gaussian random variables is that the sum of two independent Gaussian RVs is also Gaussian distributed. Since the input noise is white, you can look at each sample at the filter output as a sum of many independent Gaussian random variables (where the variance of each RV depends upon the input noise variance and the values of the corresponding filter tap). Therefore, the samples at the filter output are also Gaussian distributed. However, the noise is obviously no longer white, as there is correlation between successive samples at the filter output. – Jason R Jun 20 '13 at 4:05
• This property is described in more detail at Wikipedia. Note that the property still holds even if the input noise is colored (see the "Correlated random variables" section). – Jason R Jun 20 '13 at 4:06
• facepalm. Of course. – Spacey Jun 20 '13 at 15:20
• Yet this method won't generate White noise. No need to apply a filter, every discrete sampled noise is band limited to begin with. – Royi Jun 21 '13 at 15:02
Just as a small addition to Jason's answer: usually you need to generate bandlimited noise with a given variance $\sigma^2$. You can add this code to the code given in Jason's answer:
var = 3.0; % just an example
scale = sqrt(var)/std(nb);
nb = scale*nb; % nb has variance 'var'
Note that you have to do the scaling after filtering, because in general the filter changes the noise variance.
• Good point. If you scale the filter coefficients such that $\sum_{n=0}^{N} |h[n]|^2 = 1$, then the filter will not affect the noise variance. – Jason R Jun 20 '13 at 14:39
• @Matt Nice addition! – Spacey Jun 20 '13 at 15:13
Every time you generate discrete noise samples (Using MATLAB's randn / rand for instance) you actually generate a band limited noise.
All you need to do is the adjustment of the variance of the discrete samples to the variance of the "Continuous" noise those samples are allegedly taken from.
Given a continuous White Noise (Wide Sense) with variance $$\sigma^{2}_{cn} \delta (t)$$ and you want sample it at rate of $$f_{s}$$ you should generate discrete noise samples with variance of $$f_{s} \sigma^{2}_{cn}$$.
This result is valid assuming before sampling the continuous noise you applied an ideal LPF filter with bandwidth of $$f_{s} / 2$$.
Full description is given here - How to Simulate AWGN (Additive White Gaussian Noise) in Communication Systems for Specific Bandwidth.
Why can one not use the approach mentioned in this post?
It starts with the desired frequencies and works backwards to build the signal, instead of filtering. It uses python code, but also links to the original Matlab code.
Are there any drawbacks to doing it that way?
• looking at the original matlab code, it works for a block size of n, your fft length. If I want 2n samples, you can double the fft length, which is more than doing 2 ffts. if you do 2 separate blocks, there will be a discontinuous transition from the first to the second block. you could use a window to smooth out the transition, but then you need to do more than 2 blocks to avoid scalloping your time series. Using the filter method, once the filter is in steady state, you can feed it random numbers as long as you want. The processing increase for the filter method scales linearly. – Stanley Pawlukiewicz Sep 23 at 18:11
i realize this question popped up in current view because @Drazick modified his/her 2013 answer.
if you generate a good uniform p.d.f. pseudo-random number $x$ (say using rand() or frand(), if it's a good version) that ranges from 0 to 1 (that is $0 \le x < 1$), then if you do that 12 times, add up all 12 of the supposedly independent and uncorrelated values, and subtract 6.0 from that sum, you will have something that is very close to a unit-variance and zero-mean gaussian random number. if the uniform p.d.f. pseudo-random numbers are "good" (that is they exhibit independence from each other), this sum will be as "white" as you can get a discrete-time signal to be.
"white noise" is, of course a misnomer, even for analog signals. a "power signal" with flat spectrum all the way to infinity also has infinite power. the virtually-gaussian and "white" signal generated as described has a finite power (which is the variance and is 1) and finite bandwidth which, expressed as one-sided, is Nyquist. (so the 'power spectral density" or power per unit frequency is 1/Nyquist.) scale it and offset it however you please.
i s'pose i can edit this later and add some C-like pseudo-code to show this explicitly.
Producing full spectrum white noise and then filtering it is like you want to paint a wall of your house white, so you decide to paint the whole house white and then paint back all house except the wall. Is idiotic. (But has sense in electronics).
I made a small C program that can generate white noise at any frequency and any bandwidth (let's say at 16kHz central frequency and 2 kHz "wide"). No filtering involved.
What I did is simple: inside the main (infinite) loop I generate a sinusoid at center frequency +/- a random number between -half bandwidth and +halfbandwidth, then I keep that frequency for an arbitrary number of samples (granularity) and this is the result:
White noise 2kHz wide at 16kHz center frequency
Pseudo code:
while (true)
{
f = center frequency
r = random number between -half of bandwidth and + half of bandwidth
<secondary loop (for managing "granularity")>
for x = 0 to 8 (or 16 or 32....)
{
[generate sine Nth value at frequency f+r]
output = generated Nth value
}
}
• The STFT isn’t flat across the band. You have not shown why there is any advantage to your technique. Btw most paint is stocked as a grayish white and then mixed with pigment. Orange paint isn’t made by just using orange ingredients. There isn’t any extra work in generating white noise. – Stanley Pawlukiewicz Sep 22 at 12:59
• @StanleyPawlukiewicz In electronics you are righe because a noise generator and a filter are two very simple "objects". In programming, a filter is complex in number of instructions way more than just generating the needed data. So when programming is preferable my approach if you have time critical applications. If you downvoted I suggest you to think again about it. – Zibri Sep 23 at 6:21
• your noise isn’t preferable. the spectrum isn’t flat across the band. calling a transcendental function on the fly isn’t faster than filtering. your arguments are unsubstantiated – Stanley Pawlukiewicz Sep 23 at 11:37
• Actually the inband ripple is a design parameter. To say they peak at the center frequency is also false – Stanley Pawlukiewicz Sep 24 at 12:32
• since your technique so easy to modify, why don’t you write your own sine wave routine instead of linking to one and claiming that your code is less complex and compare that to a biquad. while you are add it, how about a fixed point version. you might also think about how your technique scales as you increase the number of samples – Stanley Pawlukiewicz Sep 24 at 13:43
|
2019-12-06 23:15:20
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 4, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6460765600204468, "perplexity": 1033.9157980083307}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-51/segments/1575540491491.18/warc/CC-MAIN-20191206222837-20191207010837-00551.warc.gz"}
|
http://math.stackexchange.com/questions/40106/push-forward-and-pullback-in-products
|
# Push forward and pullback in products
I am reading this Questions about Serre duality, and there is one part in the answer that I'd like to know how it works. But after many tries I didn't get anywhere. So here is the problem.
Let $X$ and $B$ be algebraic varieties over an algebraically closed field, $\pi_1$ and $\pi_2$ be the projections from $X\times B$ onto $X$ and $B$, respectively. Then it was claimed that $R^q\pi_{2,*} \pi_1^* \Omega_X^p \cong H^q(X, \Omega^p_X)\otimes \mathcal{O}_B$.
I am guessing it works for any (quasi)coherent sheaf on $X$.
Basically, I have two tools available, either Proposition III8.1 of Hartsshorne or going through the definition of the derived functors.
Thank you.
-
Using flat base-change (Prop. III.9.3 of Hartshorne), one sees that $$R^1\pi_{2 *} \pi_1^*\Omega_X^p = \pi_1^* H^q(X,\Omega^p_X) = H^q(X,\Omega^p_X)\otimes \mathcal O_B.$$
|
2013-05-19 01:09:30
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.792633593082428, "perplexity": 185.4608356895523}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-20/segments/1368696383077/warc/CC-MAIN-20130516092623-00072-ip-10-60-113-184.ec2.internal.warc.gz"}
|
https://aptitude.gateoverflow.in/1017/cat2003-1-121
|
17 views
Choose 1 if the question can be answered by one of the statements alone but not by the other.
Choose 2 if the question can be answered by using either statement alone.
Choose 3 if the question can be answered by using both the statements together, but cannot be answered by using either statement alone.
Choose 4 if the question cannot be answered even by using both the statements together.
Is $a^{44} < b^{11}$, given that a=2 and b is an integer?
1. b is even
2. b is greater than 16
retagged | 17 views
|
2019-09-17 03:03:43
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6131630539894104, "perplexity": 458.62887761366244}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-39/segments/1568514573011.59/warc/CC-MAIN-20190917020816-20190917042816-00245.warc.gz"}
|
https://docs.tangramvision.com/plex/advtop/model_differences/
|
# Model differences
There are a variety of popular open-source libraries that provide some form of calibration. Each of these provides certain types of projection, distortion, and affinity-like models. However, these are not always the same.
If you're transitioning to TVCal and using Plexes, these differences may seem subtle and of no consequence. Unfortunately, there can exist a number of differences between models even when the models are expressed using the same parameters. Differences in how the models are posed may ultimately change how one leverages them in practice. Let's dive into the differences between Tangram Vision's models and some of the models used by popular open-source projects today.
## Cameras
A first look at our pages on projection, distortion, and affinity will set the stage as a good primer on our calibration models and describe some of the immediately obvious differences.
### Projection & Affinity
The most immediate difference between the model used by Tangram Vision and almost all popular computer vision models is our use of a single focal length in our pinhole projection model. Some notion of $$f_x$$ and $$f_y$$ is common in computer vision applications, but instead we opt to model using a single focal parameter $$f$$.
Often, the use of two focal lengths in the pinhole projection model is an attempt to model scale differences between the x and y-axes. This is sometimes referred to as having "non-square pixels." In our blog post on the matter, we describe the history behind the problem of "non-square pixels," and how it is more often than not a result of clock-skew inconsistencies between the CCD clock and DAC.
Regardless of the origin of the effect, it can still be observed. Consequently, we often want to model it. Instead of modeling this effect as two separate focal lengths, we instead model it as an affinity correction about the x-axis:
$g_{\mathsf{affinity}}(x) = \begin{bmatrix} a_1 (x - c_x) \\ 0 \end{bmatrix}$
which combined with pinhole projection produces the following model:
$\begin{bmatrix} x \\ y \end{bmatrix} = f \begin{bmatrix} X_c/Z_c \\ Y_c/Z_c \end{bmatrix} + \begin{bmatrix} c_x \\ c_y \end{bmatrix} + \begin{bmatrix} a_1 (x - c_x) \\ 0 \end{bmatrix}$
Notice that our affinity parameter $$a_1$$ is parameterized relative to our image coordinate $$x$$, not the object space $$f X_c / Z_c$$. This is done for the following reasons:
1. The affinity correction is purely modeling an aspect of image space. There are not, after all, different scales for meters or feet or inches or whatever depending on whether you measure in the x or y-direction when we define our target field.
2. This de-couples our estimation of the model parameter $$a_1$$ from our model parameter $$f$$.
The latter point is the most important one here. If we are to model this effect in terms of object space, we would instead have a model similar to the following:
$\begin{bmatrix} x \\ y \end{bmatrix} = f \begin{bmatrix} (1 + a_1) X_c/Z_c \\ Y_c/Z_c \end{bmatrix} + \begin{bmatrix} c_x \\ c_y \end{bmatrix}$
This form is quite compact, so let's expand it somewhat:
$\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} f \cdot X_c/Z_c \\ f \cdot Y_c/Z_c \end{bmatrix} + \begin{bmatrix} f \cdot a_1 \cdot X_c/Z_c \\ 0 \end{bmatrix} + \begin{bmatrix} c_x \\ c_y \end{bmatrix}$
The important part of this model to take note of is $$f \cdot a_1 \cdot X_c / Z_c$$. When estimating $$a_1$$ here, we are immediately correlating it with $$f$$, which is a difficult parameter to estimate. Not only does this mean that we have a strong projective compensation between $$a_1$$ and $$f$$, we also introduce a strong data dependency on our target field, since $$a_1$$ and $$f$$ here are going to necessarily have a strong projective compensation with $$X_c / Z_c$$ as well. This model makes it significantly more difficult to produce a robust and consistent calibration.
#### Other Projection Models
Other Projection Models
At present, Tangram Vision only supports pinhole projection models. If you're interested in other forms of projection (orthographic, equidistant, dual-sphere, etc.) contact us and let us know! Doing so will help us prioritize which models to add next.
### Distortion
Tangram Vision presently supports two kinds of distortion intrinsics — Brown-Conrady $$(k_1, k_2, k_3, p_1, p_2)$$ distortions and Kannala-Brandt $$(k_1, k_2, k_3, k_4)$$ distortions. While there are some differences between these two models, the points below apply equally to both types of distortions.
#### OpenCV: Undistorted to Distorted
One the first major differences to consider is what "distortion" we're modeling. Open-source libraries such as OpenCV will model distortion as an additive effect in object space. First, lets look at the general geometry of the problem as follows:
In a pinhole model, distortion appears as if it were a "shift" in the final image coordinates. In the above image, we can visualize radial lens distortion (and the associated "shift") as the orange area. In this initial photo, there is no distortion, because the lines going into our lens (treated as a pinhole) and the lines coming out the other side are entirely straight. Let's look at what this might look like with distortion:
In this image the dotted lines are in the same position they were in the original image. However, the projected position of a point in the image space (left side of the lens) is shifted. This is the effect of distortion.
Now we consider how this is modeled in OpenCV. In OpenCV, distortion is "added" to the perfect scenario. It is parameterized in terms of a change of our object space:
So one can see, the pinhole model is preserved and the lines are thus straight again. From a mathematical point of view, this effectively means that distortions are parameterized by the object space. For Brown-Conrady distortion, this takes the form of:
$U = \frac{X_c}{Z_c}$
$V = \frac{Y_c}{Z_c}$
$r = \sqrt{U^2 + V^2}$
$\begin{bmatrix} x \\ y \end{bmatrix} = f \begin{bmatrix} X_c / Z_c \cdot (1 + k_1 r^2 + k_2 r^4 + k_3 r^6) + 2 p_1 U V + p_2 (r^2 + 2 U^2) \\ Y_c / Z_c \cdot (1 + k_1 r^2 + k_2 r^4 + k_3 r^6) + p_1 (r^2 + 2 V^2) + 2 p_2 U V \end{bmatrix} + \begin{bmatrix} c_x \\ c_y \end{bmatrix}$
As was the case with affinity, parameterizing in terms of the object space parameters conflates these parameters with the focal length. This model, which is not what Tangram Vision uses, is a function that maps undistorted points to distorted points.
This has a number of key disadvantages:
1. As mentioned previously, this conflates the determination of the parameters with the determination of the focal length. This is one kind of projective compensation.
2. Once determined, these parameters take the true location of a point within an image (in other words, an undistorted point), and determine the shift that would occur on that point due to distortion. One can take the true location of points (if known), and then distort these points. But that's not typically what we want! When we capture images from a camera, distortion has already occured due to the light passing through the lens. So we don't have the "true" or undistorted location of the observed point, instead the point we have observed has already been distorted (by the lens!).
#### Tangram Vision: Distorted to Undistorted
In direct contrast to software like OpenCV, Tangram Vision models distortion in image space.
In this model, the distorted point locations are what's observable, but the solid lines are the true location. Instead of adding distortion to the object space, the Tangram Vision Platform optimizes for a correction in image space. This takes the following form mathematically:
$u = \left(x - c_x\right)$
$v = \left(y - c_y\right)$
$r = \sqrt{u^2 + v^2}$
$\begin{bmatrix} x \\ y \end{bmatrix} = f \begin{bmatrix} X_c / Z_c \\ Y_c / Z_c \end{bmatrix} + \begin{bmatrix} c_x \\ c_y \end{bmatrix} + \begin{bmatrix} u (k_1 r^2 + k_2 r^4 + k_3 r^6) + p_1 (r^2 + 2 u^2) + 2 p_2 u v \\ v (k_1 r^2 + k_2 r^4 + k_3 r^6) + 2 p_1 u v + p_2 (r^2 + 2v^2) \end{bmatrix}$
In this way, rather than modeling distortion as being added to an image (and later undistorting it), we are instead modeling a correction. This is sometimes called the inverse Brown-Conrady model. Intel® RealSense™ even refers to it as such for select models of their cameras in their documentation. In our API, we avoid the inverse terminology for both Brown-Conrady and Kannala-Brandt, but you can expect that both models are constructed in this way.
This model has the advantage of behaving as a function that maps distorted points in a frame directly to the "true" locations of those points, in closed form. This is more commonly what we want when measuring distortion, rather than adding distortion to our object space to compensate for the adjusted positions of distorted points in an image.
In addition, these parameters are computed in image space, which makes them independent of other parameters being solved for (excepting $$c_x$$ and $$c_y$$). This does mean that we often have to be careful of projective compensation between $$c_x$$ and $$c_y$$, but by and large this can be mitigated by capturing data with different orientations. See our tutorial on this for more information.
In most cases, you'll just want to apply the above parameters directly to the point coordinates in an image directly to map distorted points from a raw camera frame to undistorted point coordinates. If you are looking to map a point in 3D space and project this back to a (distorted) pixel location, you'll need to generate some form of lookup table or iterative process to do so.
#### Balanced vs. Gaussian Profile
Some software opts to use the "Balanced" distortion profile. A distortion profile that is balanced (as opposed to the normal, Gaussian profile) will ultimately optimize to the same degree of reprojection error, but balances the distortion by adjusting the profile of the distortion curve (the polynomial described by your distortion parameters). This balancing in effect will limit the maximum amount of distortion at a given $$r$$ or $$\theta$$ within the image (whether you're using the balanced Brown-Conrady or Kannala-Brandt distortions).
The above graphs were generated to demonstrate what the distortion curve looks like relative to the radius for purely radial distortion (Brown-Conrady). On the left hand side we have the Gaussian profile, which is what we refer to as the "normalized" distortion. On the right, we have the Balanced profile, which is balanced such that the distortion is zero at a radius of ~85 pixels.
So although these two distortion profiles can produce the same reprojection errors, how are two different sets of distortions equivalent for the same camera? Well, this balancing is achieved by altering the focal length or principal distance, resulting in a new virtual focal length. Specifically, it removes the linear trend from the Gaussian profile through this focal length alteration. In the example above, the focal length is scaled by about 1.5% to produce a new virtual focal length and balanced distortion curve from the same distortion parameters.
Note
Sometimes the "virtual focal length" is referred to as a calibrated principal distance, which muddies up the terminology considerably. We've avoided calling it that here because it is easy to confuse the concept of a virtual focal length with a focal length that's actually been derived through a calibration process!
The balanced distortion profile does not provide any advantage to the calibration process. Historically, this technique was used to set the upper numerical limit on distortion observed from mechanical stereo-plotters, which had physical limits constraining how much distortion could be observed. This was a great aide for users of these mechanical devices, but no longer makes sense if we're applying distortion parameters numerically with a computer.
The downsides of the balanced profile do exist, however:
1. If we're shifting the focal length to some "virtual" value, this effectively means that we're scaling focal length. An astute reader might realize that in cases where $$f_x$$ and $$f_y$$ are used, we are conflating that focal shift across both parameters. In the case of Tangram Vision's model, this would produce a correlation between our distortion parameters and focal length, as well as a correlation between the distortion parameters and affinity scale.
2. We have to make a choice about where we want to balance our distortion to. In the example above it balances such that distortion is zero at ~85 pixels. Is this correct for every camera? How do we pick a(n otherwise arbitrary) value to balance towards?
OpenCV does in fact still use a balanced profile in their fisheye model. In their documentation, they describe the distortion as:
\begin{align} g_{\mathsf{fisheye}}(\theta) &= \theta (1 + k_1 \theta^2 + k_2 \theta^4 + k_3 \theta^6 + k_4 \theta^8) \\ &= \theta + k_1 \theta^3 + k_2 \theta^5 + k_3 \theta^7 + k_4 \theta^9 \end{align}
This is fairly close to what is described by Kannala-Brandt:
\begin{align} g_{\mathsf{KB}}(\theta) &= k_1 \theta + k_2 \theta^3 + k_3 \theta^5 + k_4 \theta^7 + \ldots \end{align}
As can be seen, the linear component Kannala-Brandt formulation (seen as $$k_1$$ in $$g_{\mathsf{KB}}(\theta)$$) does not exist in the OpenCV fisheye formulation. This is the linear component of the Gaussian profile, which is set to 1 in the Balanced profile. Tangram Vision avoids this balancing due to the disadvantages listed previously. Just remember that when using our distortion models, that e.g. our $$k_1$$ through $$k_4$$ terms may be shifted compared to how OpenCV describes them.
|
2022-05-25 06:37:50
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 2, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7450505495071411, "perplexity": 805.5841717744784}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662580803.75/warc/CC-MAIN-20220525054507-20220525084507-00539.warc.gz"}
|
https://www.tutorialspoint.com/program-to-find-the-largest-sum-of-the-path-between-two-nodes-in-a-binary-tree-in-python
|
# Program to find the largest sum of the path between two nodes in a binary tree in Python
PythonServer Side ProgrammingProgramming
Suppose we have a binary tree; we have to find the maximum sum of any path between any two nodes.
So, if the input is like
then the output will be 62 as the nodes are [12,13,14,16,7].
To solve this, we will follow these steps −
• Define a function utils() . This will take root
• if root null, then
• return 0
• l := utils(left of root)
• r := utils(right of root)
• max_single := maximum of (max of l and r) + value of root) and value of root
• max_top := maximum of max_single and l + r + value of root
• res := maximum of res and max_top
• return max_single
• From the main method, do the following −
• if root is null, then
• return 0
• res := infinity
• utils(root)
• return res
Let us see the following implementation to get better understanding −
## Example
Live Demo
class TreeNode:
def __init__(self, value):
self.val = value
self.left = None
self.right = None
class Solution:
def solve(self, root):
if root is None:
return 0
self.res = float("-inf")
self.utils(root)
return self.res
def utils(self, root):
if root is None:
return 0
l = self.utils(root.left)
r = self.utils(root.right)
max_single = max(max(l, r) + root.val, root.val)
max_top = max(max_single, l + r + root.val)
self.res = max(self.res, max_top)
return max_single
ob = Solution()
root = TreeNode(13)
root.left = TreeNode(12)
root.right = TreeNode(14)
root.right.left = TreeNode(16)
root.right.right = TreeNode(22)
root.right.left.left = TreeNode(4)
root.right.left.right = TreeNode(7)
print(ob.solve(root))
## Input
root = TreeNode(13)
root.left = TreeNode(12)
root.right = TreeNode(14)
root.right.left = TreeNode(16)
root.right.right = TreeNode(22)
root.right.left.left = TreeNode(4)
root.right.left.right = TreeNode(7)
## Output
62
Published on 09-Oct-2020 18:52:53
|
2021-05-14 19:41:50
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.1996990442276001, "perplexity": 13660.278437850488}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991207.44/warc/CC-MAIN-20210514183414-20210514213414-00377.warc.gz"}
|
https://en-academic.com/dic.nsf/enwiki/144433
|
# Thévenin's theorem
Thévenin's theorem
In electrical circuit theory, Thévenin's theorem for linear electrical networks states that any combination of voltage sources, current sources and resistors with two terminals is electrically equivalent to a single voltage source "V" and a single series resistor "R". For single frequency AC systems the theorem can also be applied to general impedances, not just resistors. The theorem was first discovered by German scientist Hermann von Helmholtz in 1853, but was then rediscovered in 1883 by French telegraph engineer Léon Charles Thévenin (1857-1926).
This theorem states that a circuit of voltage sources and resistors can be converted into a Thévenin equivalent, which is a simplification technique used in circuit analysis. The Thévenin equivalent can be used as a good model for a power supply or battery (with the resistor representing the internal impedance and the source representing the electromotive force). The circuit consists of an ideal voltage source in series with an ideal resistor.
Calculating the Thévenin equivalent
To calculate the equivalent circuit, one needs a resistance and some voltage - two unknowns. And so, one needs two equations. These two equations are usually obtained by using the following steps, but any conditions one places on the terminals of the circuit should also work:
# Calculate the output voltage, "V"AB, when in open circuit condition (no load resistor - meaning infinite resistance). This is "V"Th.
# Calculate the output current, "I"AB, when those leads are short circuited (load resistance is 0). "R"Th equals "V"Th divided by this "I"AB.
* The equivalent circuit is a voltage source with voltage "V"Th in series with a resistance "R"Th.
Step 2 could also be thought of like this: :2a. Now replace voltage sources with short circuits and current sources with open circuits.:2b. Replace the load circuit with an imaginary ohm meter and measure the total resistance, "R", "looking back" into the circuit. This is "R"Th.
The Thévenin-equivalent voltage is the voltage at the output terminals of the original circuit. When calculating a Thévenin-equivalent voltage, the voltage divider principle is often useful, by declaring one terminal to be "V"out and the other terminal to be at the ground point.
The Thévenin-equivalent resistance is the resistance measured across points A and B "looking back" into the circuit. It is important to first replace all voltage- and current-sources with their internal resistances. For an ideal voltage source, this means replace the voltage source with a short circuit. For an ideal current source, this means replace the current source with an open circuit. Resistance can then be calculated across the terminals using the formulae for series and parallel circuits.
Example
In the example, calculating equivalent voltage:
:$V_mathrm\left\{AB\right\}= \left\{R_2 + R_3 over \left(R_2 + R_3\right) + R_4\right\} cdot V_mathrm\left\{1\right\}$
::$= \left\{1,mathrm\left\{k\right\}Omega + 1,mathrm\left\{k\right\}Omega over \left(1,mathrm\left\{k\right\}Omega + 1,mathrm\left\{k\right\}Omega\right) + 2,mathrm\left\{k\right\}Omega\right\} cdot 15 mathrm\left\{V\right\}$
::$= \left\{1 over 2\right\} cdot 15 mathrm\left\{V\right\} = 7.5 mathrm\left\{V\right\}$(notice that "R"1 is not taken into consideration, as above calculations are done in an open circuit condition between A and B, therefore no current flows through this part which means there is no current through R1 and therefore no voltage drop along this part)
Calculating equivalent resistance:
: $R_mathrm\left\{AB\right\} = R_1 + left \left( left \left( R_2 + R_3 ight \right) | R_4 ight \right)$:: $= 1,mathrm\left\{k\right\}Omega + left \left( left \left( 1,mathrm\left\{k\right\}Omega + 1,mathrm\left\{k\right\}Omega ight \right) | 2,mathrm\left\{k\right\}Omega ight \right)$:: $= 1,mathrm\left\{k\right\}Omega + left\left(\left\{1 over \left( 1,mathrm\left\{k\right\}Omega + 1,mathrm\left\{k\right\}Omega \right)\right\} + \left\{1 over \left(2,mathrm\left\{k\right\}Omega \right) \right\} ight\right)^\left\{-1\right\} = 2,mathrm\left\{k\right\}Omega$
Conversion to a Norton equivalent
A Norton equivalent circuit is related to the Thévenin equivalent by the following equations::$R_\left\{Th\right\} = R_\left\{No\right\} !$:$V_\left\{Th\right\} = I_\left\{No\right\} R_\left\{No\right\} !$:$V_\left\{Th\right\} / R_\left\{Th\right\} = I_\left\{No\right\}!$
Practical limitations
*Many, if not most circuits are only linear over a certain load range, thus the Thévenin equivalent is valid only within this linear range and may not be valid outside the range.
*The Thévenin equivalent has an equivalent I-V characteristic only from the point of view of the load.
* Since power is not linearly dependent on voltage or current, the power dissipation of the Thévenin equivalent is not identical to the power dissipation of the real system.
In popular culture
Both Thévenin's theorem and Norton's theorem were featured in the 4th and 10th of May 2006 Doonesbury comic strip panels.
* Norton's theorem
* Impedance
* Superposition theorem
* Extra element theorem
* Nodal analysis
* Mesh analysis
* Y-Δ transform (a.k.a. "Star-Delta transformation")
* Source transformation
* Léon Charles Thévenin
* Edward Lawry Norton
* [http://tcts.fpms.ac.be/cours/1005-01/equiv.pdf Origins of the equivalent circuit concept]
Wikimedia Foundation. 2010.
### Look at other dictionaries:
• Thevenin — Thévenin ist der Name von Charles Thévenin (1764−1838), französischer Maler des Neoklassizismus Léon Charles Thévenin : französischer Telegrafeningenieur (* 1857; † 1926); Namensgeber des Thévenin Theorems. Siehe auch: Thévenin Theorem : Ein Satz … Deutsch Wikipedia
• Thévenin — ist der Familienname folgender Personen: Charles Thévenin (1764−1838), französischer Maler des Neoklassizismus Léon Charles Thévenin, französischer Telegrafeningenieur (* 1857; † 1926); Namensgeber des Thévenin Theorems. Siehe auch: Thévenin… … Deutsch Wikipedia
• Thevenin-Theorem — In der Theorie linearer elektrischer Netzwerke besagt das Thévenin Theorem (auch Helmholtz Thévenin Theorem), dass jede mögliche Kombination von Spannungsquellen, Stromquellen und Widerständen bezüglich zweier Klemmen elektrisch äquivalent zu… … Deutsch Wikipedia
• Thevenin-Äquivalent — In der Theorie linearer elektrischer Netzwerke besagt das Thévenin Theorem (auch Helmholtz Thévenin Theorem), dass jede mögliche Kombination von Spannungsquellen, Stromquellen und Widerständen bezüglich zweier Klemmen elektrisch äquivalent zu… … Deutsch Wikipedia
• Thévenin-Äquivalent — In der Theorie linearer elektrischer Netzwerke besagt das Thévenin Theorem (auch Helmholtz Thévenin Theorem), dass jede mögliche Kombination von Spannungsquellen, Stromquellen und Widerständen bezüglich zweier Klemmen elektrisch äquivalent zu… … Deutsch Wikipedia
• Thévenin-Theorem — In der Theorie linearer elektrischer Netzwerke besagt das Thévenin Theorem, beannnt nach Léon Charles Thévenin und auch als Helmholtz Thévenin Theorem oder Helmholtz Satz bezeichnet, dass jede mögliche Kombination von Spannungsquellen,… … Deutsch Wikipedia
• Norton's theorem — for linear electrical networks, known in Europe as the Mayer–Norton theorem, states that any collection of voltage sources, current sources, and resistors with two terminals is electrically equivalent to an ideal current source, I, in parallel… … Wikipedia
• Léon Charles Thévenin — (March 30, 1857 September 21, 1926) was a French telegraph engineer who extended Ohm s law to the analysis of complex electrical circuits. Background Born in Meaux, Thévenin graduated from the École Polytechnique in Paris in 1876. In 1878, he… … Wikipedia
• Extra element theorem — The Extra Element Theorem (EET) is an analytic technique developed by R.D. Middlebrook for simplifying the process of deriving driving point and transfer functions for linear electronic circuits. cite book author=Vorpérian, Vatché title=Fast… … Wikipedia
• Mayer-Norton-Theorem — In der Theorie linearer elektrischer Netzwerke besagt das Norton Theorem (auch Mayer Norton Theorem), dass jede mögliche Kombination von Spannungsquellen, Stromquellen und Widerständen bezüglich zweier Klemmen elektrisch äquivalent zu einer… … Deutsch Wikipedia
|
2021-07-27 09:22:47
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 9, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6975451111793518, "perplexity": 8058.6707868784}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046153223.30/warc/CC-MAIN-20210727072531-20210727102531-00618.warc.gz"}
|
http://pubman.mpdl.mpg.de/pubman/faces/viewItemOverviewPage.jsp?itemId=escidoc:1834225
|
de.mpg.escidoc.pubman.appbase.FacesBean
English
# Item
ITEM ACTIONSEXPORT
Released
Report
#### Towards practical permutation routing on meshes
##### MPS-Authors
http://pubman.mpdl.mpg.de/cone/persons/resource/persons44745
Kaufmann, Michael
Algorithms and Complexity, MPI for Informatics, Max Planck Society;
http://pubman.mpdl.mpg.de/cone/persons/resource/persons45038
Meyer, Ulrich
Algorithms and Complexity, MPI for Informatics, Max Planck Society;
http://pubman.mpdl.mpg.de/cone/persons/resource/persons45478
Sibeyn, Jop Frederic
Algorithms and Complexity, MPI for Informatics, Max Planck Society;
##### Locator
There are no locators available
##### Fulltext (public)
MPI-I-94-153.pdf
(Any fulltext), 187KB
##### Supplementary Material (public)
There is no public supplementary material available
##### Citation
Kaufmann, M., Meyer, U., & Sibeyn, J. F.(1994). Towards practical permutation routing on meshes (MPI-I-94-153). Saarbrücken: Max-Planck-Institut für Informatik.
Cite as: http://hdl.handle.net/11858/00-001M-0000-0014-B53F-0
##### Abstract
We consider the permutation routing problem on two-dimensional $n \times n$ meshes. To be practical, a routing algorithm is required to ensure very small queue sizes $Q$, and very low running time $T$, not only asymptotically but particularly also for the practically important $n$ up to $1000$. With a technique inspired by a scheme of Kaklamanis/Krizanc/Rao, we obtain a near-optimal result: $T = 2 \cdot n + {\cal O}(1)$ with $Q = 2$. Although $Q$ is very attractive now, the lower order terms in $T$ make this algorithm highly impractical. Therefore we present simple schemes which are asymptotically slower, but have $T$ around $3 \cdot n$ for {\em all} $n$ and $Q$ between 2 and 8.
|
2018-03-23 03:45:42
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8691555857658386, "perplexity": 5470.9645036629645}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-13/segments/1521257648177.88/warc/CC-MAIN-20180323024544-20180323044544-00388.warc.gz"}
|
https://kmhsphysics.club/2018/02/13/ThirdMeeting.html
|
## Overview of Meeting
We finished the powerpoint and started the problems. Winter break is next week, so you will have time to look at the problems. Try to do the first 3-4. Getting the right answer or the right approach is not important. The important thing is that you think about the concepts, even if you cannot grasp them. Try to think for about half an hour (just during one day in the entirety of the following two weeks) about the problems and forget about them until the next meeting. You may be surprised to see that everything clicks as we review. Then, I think you can confidently solve the last couple of problems.
## Next Meetings
In the next meeting, we will review the concepts, go over paradoxes, and finish the problems. I will create a comprehensive review paper that will make everything clear or your money back. I expect that everyone will be comfortable with the basics of relativity, and we will finish the invariant interval, Lorentz transformations, velocity addition, and Minkowski diagrams by March 6. The last lecture will cover dynamics and energy ($E=mc^2$), and will occur on March 13. These last two lectures will be much quicker and more intense than the first three.
|
2019-11-20 18:02:15
|
{"extraction_info": {"found_math": true, "script_math_tex": 1, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.560157060623169, "perplexity": 412.84267203730246}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-47/segments/1573496670597.74/warc/CC-MAIN-20191120162215-20191120190215-00096.warc.gz"}
|
https://www.authorea.com/users/20453/articles/93692-protein-structure-refinement-using-quantum-mechanics-based-chemical-shift-prediction/_show_article
|
# Protein Structure Refinement using Quantum Mechanics-Based Chemical Shift Prediction
Abstract
Alternative title: Small changes in protein structure improves quantum mechanics-based chemical shift prediction
Can QM-based chemical shift prediction be made as accurate as empirical methods by making small changes to the protein structure?
If these changes are small enough, it may not make sense to talk if an improvement
Real question (not addressed here) if protein structure determination is more accurate with ProCS15. E.g. does one get better structures starting from 4-6 Å structures?
Comparison to CHARMM only refinement?
# Introduction
Some of us recently showed (Christensen 2013) that protein refinement using a DFT-based backbone amide proton chemical shift predictor (ProCS) yielded more accurate hydrogen-bond geometries and $$^\text{3h}$$J$$_\text{NC'}$$ coupling constants involving backbone amide groups than corresponding refinement with CamShift. Furthermore, the ProCS predictions based on the structurally refined ensemble yielded amide proton chemical shift predictions that were at least as accurate as CamShift. This suggests that the larger RMSD observed for QM-based chemical shift predictions may, at least in part, be due to relatively small errors in the protein structures used for the predictions, and not a deficiency in the underlying method. This paper tests whether this is true for other back bone atoms and C$$\beta$$ using ProCS15 (Larsen 2015). We first describe how the isotropic chemical shielding values can be related to the experimental chemical shifts as part of the simulation. Secondly, we perform Monte Carlo simulations to refine the structures of xx proteins ...
|
2017-05-26 16:58:32
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5277602672576904, "perplexity": 3224.8682627146845}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-22/segments/1495463608669.50/warc/CC-MAIN-20170526163521-20170526183521-00226.warc.gz"}
|
https://msp.org/jomms/2011/6-5/p04.xhtml
|
#### Vol. 6, No. 5, 2011
Recent Issues
The Journal Subscriptions Editorial Board Research Statement Scientific Advantage Submission Guidelines Submission Form Ethics Statement Author Index To Appear ISSN: 1559-3959 Other MSP Journals
Effective property estimates for heterogeneous materials with cocontinuous phases
### Patrick Franciosi, Renald Brenner and Abderrahim El Omri
Vol. 6 (2011), No. 5, 729–763
##### Abstract
This work concerns heterogeneous multiphase materials which may exhibit omnidirectional full or partial cocontinuity of several or all phases. The estimate of their effective (mechanical or physical) properties is not yet well handled as compared to those for well-defined aggregate or reinforced-matrix structures, especially in the context of homogenization methods. We propose in this framework a modeling scheme which aims at accounting for such phase cocontinuity features. In the mechanical application field, the modeling validity restricts to elastic properties of unloaded materials or in load situations as far as bending and torsion effects of possibly strut-like phase parts are not essential. For other physical properties (dielectric, magnetic, etc.), the modeling applications concern those for which homogenization approaches are relevant. The modeling is based on a material’s morphology description in terms of a generalization of so-called “fiber systems” that were introduced in early literature reports. Using parameters that describe the clustering characteristics of the individual phases and of their assemblage, we have considered these fiber systems both within a layer-based approach of the material structure and within an aggregate-like one. By these two routes, we have obtained two estimate forms that differ only slightly in definition. The presentation uses the elasticity formalism, in simple cases of isotropic mixtures of two-phase materials with isotropic phase behavior but the modeling extends to $n$-phase anisotropic materials as established separately. Our estimates are compared with basic variational bounds and homogenization estimates, with some literature data and with homogenization results obtained with the fast Fourier transform approach on numerical structures. All data are matched with different parameter sets corresponding to different types of phase organization. The two estimates remain nearly equal for all of the examined structures regardless of phase contrast and with only slight differences consistent with their definition difference.
##### Keywords
phase cocontinuity, effective properties, heterogeneous materials, clustering
|
2019-07-23 05:38:05
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 1, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4325961172580719, "perplexity": 2264.194650131087}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195528869.90/warc/CC-MAIN-20190723043719-20190723065719-00551.warc.gz"}
|
http://ncatlab.org/nlab/show/star+product
|
# nLab star product
### Context
#### Algebra
higher algebra
universal algebra
# Contents
## Idea
In deformation quantization of Poisson manifolds the commutative product $\cdot$ of the commutative algebra of functions is replaced by a noncommutative associative product. This is often called a star product and denoted “$\star$”.
An archetypical example is the Moyal star product that deforms the function algebra on a Poisson vector space, and sometimes “star product” is by default understood to be a Moyal star product.
More recently also nonassociative “star products” have been proposed to be of interest.
Revised on April 2, 2013 20:17:51 by Urs Schreiber (131.174.41.18)
|
2014-08-30 14:31:32
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 2, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5127550363540649, "perplexity": 1774.9724182670234}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-35/segments/1408500835488.52/warc/CC-MAIN-20140820021355-00367-ip-10-180-136-8.ec2.internal.warc.gz"}
|
http://asomef.org.co/o9gmu2tt/molar-mass-and-percent-composition-worksheet-d460f8
|
Find its empirical formula. CJ UVaJ j! For a solution, mass percent equals the mass of an element in one mole of the compound divided by the molar mass of the compound, multiplied by 100%. Mass percent composition is also known percent by weight. 3 mol O=3 × 16.00 g/mol= 48.00 g/mol. Title: Molar Mass worksheet Author: ochs.tf.t Last modified by: Windows User Created Date: 12/13/2019 4:13:00 PM 1. Some of the worksheets displayed are Percent composition by mass work, Chemistry computing formula mass work, Percent composition and molecular formula work, Percent composition work ii, Molar mass work, Lwtech learning lab science molar mass, Percent composition work 1, Molar mass practice work. Answer the following questions: 9. Determine the empirical formula of acetic acid. What's the empirica] formula of a molecule containing 65.5% carbon, S. 5% hydrogen, and 29.0% oxygen? 7. Percent Composition Worksheet 1. The percent composition Percent Composition Homework the relative mass of each element in a compound. 2. So for p = 62 * 100 / 182 . A compound has an empirical formula of C2H30 and a molar mass of 172 g/mol. For a solution, mass percent equals the mass of an element in one mole of the compound divided by the molar Worksheet 11.1 KEY Molar Mass Calculations A mole is a standard unit of measurement for amount of a substance. Molecular Mass And Percent Composition mass percent = (mass of solute / mass of solution) x 100%. Chemistry: Molar Mass and Percentage Composition KEY Calculate the molar masses and percentage composition of each of the following compounds. a. A similar unit of concentration is molality (m), which is defined as the number of moles of solute per kilogram of solvent, not per liter of solution: $molality\: =\: \frac{moles\: solute}{kilograms\: solvent}$ Chemistry: Percentage Composition and Empirical & Molecular Formula. CHEMISTRY COMPUTING FORMULA MASS WORKSHEET Problem Set-up example: Find the formula mass of Ca(NO3)2 Ca: 1 x 40.1 = 40.1 N: 2 x 14.0 = 28.0 O: 6 x 16.0 = 96.0 ____ 10. Solve the following problems. Essential concepts: Molar mass, percent composition. A compound is found to contain 36.5% Na, 25.4% S, and 38.1% O. So Ca = 120*100/182 . Percent By Mass. 8. Ca3P2. Calculate Percent By Mass And Percent By Volume - Displaying top 8 worksheets found for this concept.. 116.3 g, 20.9% Mg, 24.1% N, 55.0% O 4. A compound has a molar mass of 86 g/mol and has the percent composition (by mass) of 55.8% C, 37.2% O, and 7.0% H. Determine the empirical formula and the molecular formula. Percent composition and molar mass. Calculate the percent composition of each element for the following compounds. 2. 13. 136.2 g, 29.4% Ca, 23.6% S, 47.0% O 8. Molecular Mass And Percent Composition Mass percent composition describes the relative quantities of elements in a chemical compound. CJ UVaJ j U j� CJ EH��H*OJ QJ U^J jU�C This worksheet has 8 problems to solve. Show your work and always include units. C2F2Br2O2. ���� ž� � ��Ѣ��֢֙��֍|����p_��� j6 CJ EH��H*OJ QJ U^J j1�C Purpose: The percent composition of a compound is the percent, by mass, of each individual element within the compound. Answer the following questions about carbon dioxide, CO 2. Ca(OH) 2 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 3. mol-1”, depending on how your teacher likes to see it written. Solve the following problems. If the molar mass of the compound in problem 1 is 110 grams/mole, what's the molecular formula? a. Answer sheet included. 142.1 g, 32.4% Na, 22.6% S, 45.0% O 7. Show your work, and always include units where needed. C 3H 3O 2) If the molar mass of the compound in problem 1 is 110 grams/mole, what’s the molecular formula? CJ EH��H*OJ QJ U^J j�C Some of the worksheets displayed are Percent composition by mass work, Chemistry computing formula mass work, Percent composition and molecular formula work, Percent composition work ii, Molar mass work, Lwtech learning lab science molar mass, Percent composition work 1, Molar mass practice work. The percentage composition of acetic acid is found to be 39.9% C, 6.7% H, and 53.4% O. The units of mass are typically grams. b. Nomenclature for Simple Inorganic Coumpounds; Worksheets w/Solutions. Some of the worksheets displayed are Percent composition by mass work, Chemistry computing formula mass work, Ch 11 ws 3 molarity molality percent solution, Work, Chemistry i work name calculating formula mass, Molar mass work, Percent composition by mass, Percent composition work ii. For more practice with these skills, try the game! A compound has a molar mass of 100 g/mol and the percent composition (by mass) of 65.45% C, 5.45% H, and 29.09% O. Mg(NO3) 2 8. 12. CJ UVaJ j UCJ H*OJ QJ ^J j CJ H*OJ QJ U^J jO CJ EH��H*OJ QJ U^J $The units of mass are typically grams. Calculate the molar mass for the following compounds SiF 4 KOH 2. Ca3P2 2. You calculate the answer Some of the worksheets for this concept are Percent composition and molecular formula work, Molar mass work, Percent composition and molecular formula work, Formula or molar mass work epub, Chemistry computing formula mass work, Formula work, Empirical and molecular formula work, Student work extra practice questions molar. Mole conversion practice mass to moles 1 step pdf. The molar mass is the sum of the masses of all the atoms in one mole of the compound. formula worksheet 1 h8n and a molar mass of 46 grams per mole answer the of 100 g mole if the percent composition is' 'Moles Molar Mass And Percentage Composition Percent Composition Name Date Show all work for finding the molar mass AND the percent composition requested. Page I of I 'Hour 0)MDlar Mass = The molar mass for question #9 was determined by experiment to be 60.0 g/mol. ' ( ) * + , 6 7 8 � � � � � � � � � � � � � � � � � � � � � � � � � � � �$a$� � 8 9 : ; J K L M N O ^ _ a b c q r s t u v ~ � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � 4 � � G H � � � � & * 7 8 � � � � + , 6 7 � � � � > 386.2 g, 50.8% Zn, 16.1% P, 33.1 % O 3. C 6H 6O 2 _____ C8H8O2. 2) A compound with an empirical formula of C4H4O and a molar mass of 136 grams per mole. 7. The percentage composition of acetic acid is found to be 39.9% C, 6.7% H, and 53.4% O. The percentage composition of acetic acid is found to be 39.9% C, 6.7% H, and 53.4% O. Answer: Molar mass is 22.99 + 35.45 = 58.44 g/mol Percent composition: %Na = (22.99 / 58.44) K 100% = 39.34 % Na 1) What oercent ofMgB½ is magnesium? Molar Mass and Percentage position Worksheet for 9th 12th from Percent Composition Worksheet Answer Key With Work, source: lessonplanet.com. 4O and a molar mass of 136 grams per mole. CJ UVaJ j�( CJ EH��H*OJ QJ U^J ja&�C 18. 74.6g, 52.4% K, 47.6% Cl Chemistry: Molar Mass and Percentage Composition KEY Calculate the molar masses and percentage composition of each of the following compounds. Molar Mass And Comp - Displaying top 8 worksheets found for this concept.. Answers: 1. A compound with an empirical formula of CFBrO and a molar mass of 254.7 grams per mole. Mass percent is also known as percent by weight or w/w%. Percent Composition Name Date Show all work for finding the molar mass AND the percent composition requested. (NH4) 2SO4. Mass percent is also known as percent by weight or w/w%. Percent By Mass - Displaying top 8 worksheets found for this concept.. CaSO4. ' ( ) * + , 4 6 7 > ? Percent Composition Notes and Practice. The molar mass for question #9 was determined by experiment to be 60.0 g/mol. Percent Composition and Molecular Formula Worksheet I. Percent Composition and Molecular Formula Worksheet I. Chemistry: Molar Mass and Percentage Composition KEY Calculate the molar masses and percentage composition of each of the following compounds. CJ UVaJ j� EH��UjV�C Find the formula mass of the following compounds. 19. It is abbreviated as w/w%. 10. 5. The sum all the mass percentages should add up to 100%. (NH4) 2SO4 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 6. Answer the following questions: 9. C D v w � � Show your work and always include units. This Molecular Mass and Percent Composition Worksheet is suitable for 9th - 12th Grade. CJ UVaJ j� CJ EH��H*OJ QJ U^J js��C 7. 1 mol Fe= 1 x 55.85 g/mol= 55.85 g/mol. R S T U Y Z m n o p u v � � � � � � � ��� � ��� �¸˸���������o��� c\� � j�# EH��Uj���C 4) A compound with an empirical formula of C2H8N and a molar mass of 46 grams per mole. Chemistry: Molar Mass and Percentage Composition. KCl. # ���� o ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �� � bjbj� � ". Showing top 8 worksheets in the category - Mass Percent Chemistry. Show your work and always include units. Zn3(PO4) 2 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 7. ��ࡱ� > �� ! 3 mol O=3 × 16.00 g/mol= 48.00 g/mol. " #$ % ) * 4 7 8 ? Find the empirical formula of a compound that is 53.7% iron and 46.3% sulfur. Determine the % by mass … 182.3 g, 66.0% Ca, 34.0% P 5. Some of the worksheets for this concept are molar mass work molar mass work answer key chemistry computing formula mass work ws molar mass chemistry 11 mole conversions molar mass work molar mass … Mass percent composition is also known percent by weight. A compound has a molar mass of 86 g/mol and has the percent composition (by mass) of 55.8% C, 37.2% O, and 7.0% H. Determine the empirical formula and the molecular formula. C8H8O2. CaSO4 5. Ca(OH) 2 3. KCl Answers: 1. 1. Ca 3 P 2 g 182.3 P Ca g 62.0 g/mol 31.0 @ P 2 g 120.3 g/mol 40.1 @ Ca 3 2 3 Ca 66.0% 100 g 182.3 g 120.3 Ca % P 34.0% 100 g 182.3 g 62.0 P % 2. Percent Composition Notes and Practice. Ca(OH) 2. CJ UVaJ j CJ H*OJ QJ U^J CJ H*OJ QJ ^J CJ OJ QJ ^J CJ OJ QJ ^J jQ EH��Uj}�C 4O and a molar mass of 136 grams per mole. One of the two worksheets is viewable in the Preview so you can see that the questions will be great practice for your students. 3. Ca3P2 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 2. In this chemical compounds worksheet, students calculate the molar masses and the percentage composition for the given compounds. 8. Ca3P2 molar mass is : Ca [ 40 * 3 ] + P [ 31*2] = 182 u . Useful for AQA C2.3. Round atomic masses to the tenth of a decimal place. A compound with an empirical formula of CzHEN and a molar mass of 46 grams per mole. The molar mass for question #9 was determined by experiment to be 60.0 g/mol. Molar Mass Practice Worksheet Find the molar masses of the following compounds: 1) NaBr 2) PbSO 4 3) Ca(OH) 2 4) Na 3PO 4 5) (NH 4) 2CO 3 6) C 6H 12O 6 7) Fe 3(PO 4) 2 8) (NH 4) 2S 9) Zn(C 2H 3O 2) 2 10) AgF . Example: What percent ofNaCl is sodium? Nicotine is 74.1% carbon, 8.6% hydrogen, and 17.3% nitrogen by mass. Percent Review Worksheet Worksheets for all from Percent Composition Worksheet Answer Key With Work, source: bonlacfoods.com Figure $$\PageIndex{3}$$: Table salt, NaCl, contains an array of sodium and chloride ions combined … 1. C2F2Br2O2. For instance, the percent composition of oxygen in water is 89%. 2. Percent Review Worksheet Worksheets for all from Percent Composition Worksheet Answer Key With Work, source: bonlacfoods.com CJ UVaJ j� CJ EH��H*OJ QJ U^J j���C The percent composition worksheet. Show your work and always include units. Zn3(PO4) 2. How to Calculate Mass Percent Composition Percent composition can also be used to determine the mass of a certain element that is contained in any mass … 'Molar Mass And Percent Composition Worksheet FREE May 13th, 2018 - Hi Searching For Molar Mass And Percent Composition Worksheet You Are Specifically Here Possibly You Came Via Internet Search Engine After That You Find This Web Site As Well As Chose To See This Website Many Thanks For That''South Pasadena Chemistry chemmybear com 6. �j �j � �� �� �� l � � � � � � � ^ ^ ^ ^ D � $� � � 2 � � � 6 8 8 8 8 8 8$ m � � \ � � � � � � \ _ � � � q _ _ _ � . CaSO4 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 5. Elements Compounds Mixtures Worksheet; Calculations. If the molar mass of the compound in problem 1 is 110 grams/mole, what's the molecular formula? percentage Composition : mass of the element in the compund * 100 / molar mass of the compound . 3. Percent composition is used to find the percentage of elements in a compound. 1. Answer the following questions about carbon dioxide, CO 2. 12. : ´*. Mg(NO2) 2 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 8. CaCO 3 CH 4 Sn(CO 3) 2 3. 3. Worksheet 11.3 Percent Composition 3. , ; � � ; 6 _ � � � � � Name: ________________________ Hour: ____ Date: _______________ Chemistry: Molar Mass and Percentage Composition Calculate the molar masses and percentage composition of each of the following compounds. 18. The percentage composition of acetic acid is found to be 39.9% C, 6.7% H, and 53.4% O. Detailed answer key is included. The molar mass is the sum of the masses of all the atoms in one mole of the compound. CJ UVaJ CJ H*OJ QJ ^J j CJ H*OJ QJ U^J j CJ EH��H*OJ QJ U^J o p q v w � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � A compound with an empirical formula of C 2H 8N and a molar mass of 46 grams per mole. Worksheet 11.1 KEY Molar Mass Calculations A mole is a standard unit of measurement for amount of a substance. Answer: Molar mass is 22.99 + 35.45 = 58.44 g/mol Percent composition: %Na = (22.99 / 58.44) K 100% = 39.34 % Na 1) What oercent ofMgB½ is magnesium? Ä Ä ÿÿÿÿ 2 2 2 8 j D ® 4 2 , à â â â â â ½ ½ ½ P, R, R, R, R, R, R, �. What is the molecular formula. Its molar mass is … 74.1 g, 54.1% Ca, 43.2% O, 2.7% H 6. chlorite. The mass percent is the mass of an element in a compound expressed as a percentage of the total mass of the compound. 15.03: Solution Concentration - Molality, Mass Percent, ppm and ppb Last updated; Save as PDF Page ID 178209; No headers. Find the empirical formula of a compound that is 53.7% iron and 46.3% sulfur. This worksheet is a good application of molar mass, as students will calculate the mass of the individual atoms of familiar compounds, such as baking soda. O and a molar mass of 136 grams per mole. 182.3 g, 66.0% Ca, 34.0% P 5. CJ UVaJ CJ OJ QJ ^J CJ OJ QJ ^J CJ OJ QJ ^J j� EH��Uj��C Formula mass / molecular weight / moles / % percentage by mass worksheets with range of difficulties. The answers appear after the final question. ��� �������պ�˟��˫˂q�� � e^� � j�. Na2SO4 4. Calorimetry Worksheet; Mixed Gas Laws Worksheet; Molar Mass Worksheet; Mole Calculations Worksheet 1; Mole Calculations Worksheet 2; Percent Composition Worksheet Nomenclature Handouts. 7. 2. For a solution, mass percent equals the mass of an element in one mole of the compound divided by the molar mass of the compound, multiplied by 100%. Step 1:Find the molar mass of the compound. 10. 10. The second worksheet has similar questions, with different compounds. CJ UVaJ j U j� EH��Uj���C 3) A compound with an empirical formula of CFBrO and a molar mass of 254.7 grams per mole. 8. 132.1 g, 21.2% N, 6.1% H, 24.3% S, 48.4% O 2. ² ?1 ² R, ½ ½ ½ ½ ½ R, â â Û g, Å Å Å ½ ‚ â â P, Å ½ P, Å Å Æ \$* � Ø+ â ÿÿÿÿ Ğ >Ù°Ğ ÿÿÿÿ ? C 3H 3O 2) If the molar mass of the compound in problem 1 is 110 grams/mole, what’s the molecular formula? Nicotine is 74.1% carbon, 8.6% hydrogen, and 17.3% nitrogen by mass. Calculate the percent composition of carbon for the following compounds. bold atom and ONLY the bold atoms. Some of the worksheets for this concept are Percent composition by mass work, Chemistry computing formula mass work, Ch 11 ws 3 molarity molality percent solution, Work, Chemistry i work name calculating formula mass, Molar mass work, Percent composition by mass, Percent composition … EH��Ujo!�C Show your work, and always include units where needed. 8. Essential concepts:Molar mass, percent composition. Its molar mass is about 160 g./mol. I I. Ibuprofen, a common headache remedy, has an empirical formula of C;H90 and a molar mass of approximately 215 g/mol. Show your work, and round answers to the ones place. This Molar Mass and Percentage Composition Worksheet is suitable for 9th - 12th Grade. The molar mass for question 9 was determined by experiment to be 600 gmol. Answer the following questions: 9. N 2 O Sr(NO 3) 2 NH 4 NO 3 4. 16 divided by 18 is .89. Purpose: The percent composition of a compound is the percent, by mass, of each individual element within the compound. Determine the empirical formula of acetic acid. Determine the empirical formula of acetic acid. 4) A compound with an empirical formula of C2H8N and a molar mass of 46 grams per mole. I I. Ibuprofen, a common headache remedy, has an empirical formula of C;H90 and a molar mass of approximately 215 g/mol. Calculate the percent composition of each element for the following compounds. � � 6 _ � 6 _ _ � � � � 6 � U����� Z ^ � 6 � 0 � CJ UVaJ #� � � � � � � � � � � � � � � � � � � � � � � � � � � � In this molecular mass and percent composition activity, students complete 5 sections where they determine atomic masses of given elements, they determine formula masses for given molecules, they find the molecular mass of 12 molecules and they determine the percent composition of 10 compounds. Percent By Mass - Displaying top 8 worksheets found for this concept.. Chemistry: Percentage Composition and Empirical & Molecular Formula. Percent Composition and Molecular Formula Worksheet Solutions 1) What’s the empirical formula of a molecule containing 65.5% carbon, 5.5% hydrogen, and 29.0% oxygen? 3) A compound with an empirical formula of CFBrO and a molar mass of 254.7 grams per mole. A compound with an empirical formula of CzHEN and a molar mass of 46 grams per mole. I use this game instead of a worksheet to build students' confidence and fluency in these problems before we move … Calculate the molar masses and percentage composition of each of the following compounds. 2) A compound with an empirical formula of C4H4O and a molar mass of 136 grams per mole. Place your final answer in the FORMULA MASS COLUMN. It is abbreviated as w/w%. In this moles and molecules worksheet, students answer fourteen questions about moles, mass, and the mole and they solve eight problems for molecular formulas, empirical formulas and percent composition. N 2 O Sr(NO 3) 2 NH 4 NO 3 4. 3. Find the formula mass of the following compounds. CHEMISTRY COMPUTING FORMULA MASS WORKSHEET Problem Set-up example: Find the formula mass of Ca(NO3)2 Ca: 1 x 40.1 = 40.1 N: 2 x 14.0 = 28.0 O: 6 x 16.0 = 96.0 ____ Title: Microsoft Word - WS-moles_molar_mass.doc Author: acrosby Created Date: 10/4/2007 8:50:46 PM A compound has a molar mass of 100 g/mol and the percent composition (by mass) of 65.45% C, 5.45% H, and 29.09% O. C 6H 6O 2 _____ Percent composition is the percent by mass of each element found in a compound. This Molar Mass and Percentage Composition Worksheet is suitable for 9th - 12th Grade. Show your work, and round answers to the ones place. The molar mass of water is 18g/mol, and oxygen has a molar mass of 16g/mol. Answer the following questions: 9. @ S T U V Z [ n o �����ʹ�� � ������ֆ���zi����] j�C CJ UVaJ j CJ H*OJ QJ U^J !CJ OJ QJ ^J eh r� � CJ H*OJ QJ ^J CJ OJ QJ ^J CJ OJ QJ ^J j U j>&. Ca 3 P 2 g 182.3 P Ca g 62.0 g/mol 31.0 @ P 2 g 120.3 g/mol 40.1 @ Ca 3 2 3 Ca 66.0% 100 g 182.3 g 120.3 Ca % P 34.0% 100 g 182.3 g 62.0 P % 2. Mg(NO3) 2. (NH4) 2SO4 6. A compound with an empirical formula of CFBrO and a molar mass of 254.7 grams per mole. 132.1 g, 21.2% N, 6.1% H, 24.3% S, 48.4% O. Determine the empirical formula of acetic acid. b. Percent Composition by Mass Find the percent composition by mass the . One must know the molar mass of the elements and the compound in order to get percent composition. A compound with an empirical formula of CFBrO and a molar mass of 254.7 grams per mole. Example: What percent of iron (III) hydroxide, Fe(OH) 3, is oxygen? Zn3(PO4) 2 7. What's the empirica] formula of a molecule containing 65.5% carbon, S. 5% hydrogen, and 29.0% oxygen? 'Molar Mass And Percent Composition Worksheet FREE May 13th, 2018 - Hi Searching For Molar Mass And Percent Composition Worksheet You Are Specifically Here Possibly You Came Via Internet Search Engine After That You Find This Web Site As Well As Chose To See This Website Many Thanks For That''South Pasadena Chemistry chemmybear com Example: What percent ofNaCl is sodium? Molar Mass and Percent Composition Card Game Potassium permanganate – (Oxygen) Calcium. 1. CJ UVaJ j\, CJ EH��H*OJ QJ U^J jK!�C Mass percent composition describes the relative quantities of elements in a chemical compound. This Chapter 8 Worksheet-Mass, Mole, Percent Composition Worksheet is suitable for 10th - 12th Grade. CJ UVaJ CJ OJ QJ ^J CJ OJ QJ ^J jX EH��Ujf�C Round atomic masses to the tenth of a decimal place. The molar mass for … Percent composition and molecular formula worksheet. A compound has an empirical formula of C2H30 and a molar mass of 172 g/mol. Mole Mass Problems Worksheet Answers Lovely Mole Mass Problems from molar mass worksheet answers , source:thefriendlyghosthunters.net The Molar Worksheets, when used with an example that shows the properties of the molecules in a particular compound, will show the composition of the compound and the answer to the question “What is Molar Matter?” that a person may be looking for. Place your final answer in the FORMULA MASS COLUMN. A compound with an empirical formula of C 2H 8N and a molar mass of 46 grams per mole. Determine the % by mass … 10. CaCO 3 CH 4 Sn(CO 3) 2 3. Answer the following questions: 9. 4. Chemistry Worksheet NAME: _____ Mole Conversions and Percent Composition Block: _____ 5. 2. 2. Percent Composition Worksheet 1. Determine the empirical formula of acetic acid. Determine the molar mass of carbon dioxide. Percent Composition and Molecular Formula Worksheet Solutions 1) What’s the empirical formula of a molecule containing 65.5% carbon, 5.5% hydrogen, and 29.0% oxygen? We found some Images about Percent Composition Molar Mass Worksheet: Percent Composition and Molecular Formula Worksheet Molarity Worksheet Chemistry Free Worksheets Library | Download ... 1025 TEST II _ PRACTICE PACK _ 02 Molarity - 0.700 M solution . 1. 19. The sum all the mass percentages should add up to 100%. Showing top 8 worksheets in the category - Calculate Percent By Mass And Percent By Volume. Na2SO4 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 EMBED Equation.3 4. Worksheets; Supermarket Science; ... Quiz #2-3 PRACTICE: Molar Masses & Percent Composition For each of the following questions or statements, select the most appropriate response and click its letter: Start . And 29.0 % oxygen a molecule containing 65.5 % carbon, S. 5 % hydrogen, and round answers the! Composition Block: _____ 5 P, 33.1 % O 7 composition is percent. 182 u 172 g/mol 600 gmol composition mass percent is the mass percent is known! Of I 'Hour 0 ) MDlar mass = percent composition of a substance get percent composition Worksheet answer source! Is … Showing top 8 worksheets found for this concept how your likes... For instance, the percent composition Worksheet 1 composition by mass … percent by.! H 6 132.1 g, 21.2 % N, 6.1 % H, and include. Purpose: the percent by mass and percent by weight S, 47.0 % O.! 172 g/mol 11.3 percent composition is the percent composition Worksheet 1 %,... Percent Chemistry percent of iron ( III ) hydroxide, Fe ( OH ) 3 is... Mol-1 ”, depending on how your teacher likes to see it written carbon dioxide CO! 4 KOH 2 40 * 3 ] + P [ 31 * 2 ] = 182 u within... Hydroxide, Fe ( OH ) 3, is oxygen Name Date all... Where needed of I 'Hour 0 ) MDlar mass = Chemistry: molar mass of grams. ) x 100 % Volume - Displaying top 8 worksheets in the formula mass.! X 55.85 g/mol= 55.85 g/mol for more practice with these skills, try the game … Showing top worksheets..., source: lessonplanet.com from percent composition by mass is suitable for 9th 12th from percent composition requested a of! Mole conversion practice mass to moles 1 step pdf = percent composition is the percent composition requested elements in compound... Depending on how your teacher likes to see it written of acetic acid found..., 6.1 % H, and always include units where needed the compound and %! Composition mass molar mass and percent composition worksheet is also known as percent by mass, of element! Following questions about carbon dioxide, CO 2 acid is found to contain 36.5 % Na 25.4! The total mass of the compound mass for question # 9 was determined experiment! And empirical & molecular formula I 'Hour 0 ) MDlar mass = percent composition of acetic acid is found be... Formula mass of the masses of all the mass percent is also known as percent by weight or w/w.. H, and 53.4 % O N 2 O Sr ( NO 3 ) 2 EMBED Equation.3 EMBED EMBED... * 3 ] + P [ 31 * 2 ] = 182 u 18g/mol... C4H4O and a molar mass of 254.7 grams per mole: mass of 46 per... [ 31 * 2 ] = 182 u Worksheet 11.1 KEY molar mass of an element in a compound... Carbon for the following questions about carbon dioxide, CO 2 has an empirical formula of C2H30 and molar. Modified by: Windows User Created Date: 12/13/2019 4:13:00 PM percent composition Worksheet is for! Depending on how your teacher likes to see it written Sn ( CO 3 ) a compound that is %! Worksheet for 9th - 12th Grade 116.3 g, 21.2 % N 55.0... The mass percent composition Worksheet is suitable for 10th - 12th Grade composition the! 6.1 % H, and 38.1 % O the percent, by mass is used to Find the formula of. Dioxide, CO 2 11.3 percent composition Card game the percent composition = ( mass of 254.7 per... 3 ] + P [ 31 * 2 ] = 182 u, of each element for following. Fe ( OH ) 3, is oxygen _____ mole Conversions and percent composition percent composition each! With different compounds of oxygen in water is 89 % similar questions, with different compounds III hydroxide! Oxygen atom … percent by weight ”, depending on how your teacher likes to see it written where! Masses and percentage composition of 2 hydrogen atoms and 1 oxygen atom the following questions about carbon dioxide, 2..., by mass the the compound is suitable for 10th - 12th Grade, %! Phosphate – ( hydrogen ) Mg ( N. O3 ) 2 3 N, 55.0 % O, 2.7 H... The game water is 89 % 182.3 g, 32.4 % Na, 25.4 % S, 48.4 O..., mole, percent composition of 2 hydrogen atoms and 1 oxygen atom 3 CH 4 Sn CO... Moles 1 step pdf I of I 'Hour 0 ) MDlar mass = Chemistry: percentage KEY! The sum of the following compounds as percent by mass is also percent. The masses of all the atoms in one mole of the masses of all the mass of grams... Composition: mass of 136 grams per mole a compound is found to contain 36.5 % Na, %. 6.7 % H, and oxygen has a molar mass of water is 18g/mol and... Worksheet: Chemistry Worksheet Name: _____ 5 percent by weight or w/w % # ���� O ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �. 8N and a molar mass is the percent composition mass percent composition used... And always include units where needed order to get percent composition molar mass and percent composition worksheet composition is the sum all mass. The formula mass of 136 grams per mole Equation.3 4 User Created Date: 12/13/2019 4:13:00 percent... Ca [ 40 * 3 ] + P [ 31 * 2 ] = 182 u 110 grams/mole what. With different compounds [ 31 * 2 ] = 182 u iron and 46.3 % sulfur one of! 116.3 g, 29.4 % Ca, 43.2 % O, of each individual element within the compound, %! 4 Sn ( CO 3 ) 2 EMBED Equation.3 EMBED Equation.3 7 1. Sn ( CO 3 ) a compound your teacher likes to see it written 9th - Grade. Ch 4 Sn ( CO 3 ) 2 NH 4 NO 3 2... 40 * 3 ] + P [ 31 * 2 ] = 182 u so P! - mass percent composition is also known as percent by mass Find the formula. Nitrogen by mass … percent by Volume acetic acid is found to 36.5. * 2 ] = 182 u, S. 5 % hydrogen, and round answers to the mass. 100 / molar mass practice Worksheet from percent composition Showing top 8 in... … Showing top 8 worksheets in the category - mass percent = ( mass of 136 grams per mole the! O and a molar mass of 254.7 grams per mole composition Find the formula mass COLUMN game!, 55.0 % O % Mg, 24.1 % N, 55.0 % O 2.7! Block: _____ mole Conversions and percent composition Homework the relative quantities of elements in a compound, %... Oh ) 3, is oxygen empirica ] formula of C2H8N and a mass. … mass percent is the percent, by mass 45.0 % O 4 132.1 g 20.9. The second Worksheet has similar questions, with different compounds each of the element a... Be 600 gmol OH ) 3, is oxygen be 39.9 % C, %... Percent is also known percent by mass Find the percentage composition: of! With work, and 38.1 % O 3 100 / 182 known percent by mass of.... 2H 8N and a molar mass is: Ca [ 40 * 3 ] + [! Of solution ) x 100 % compounds: Ammonium phosphate – ( hydrogen ) Mg ( N. ). % Mg, 24.1 % N, 6.1 % H, and 29.0 oxygen... Position Worksheet for 9th 12th from percent composition Worksheet is suitable for 9th 12th from composition... P = 62 * 100 / molar mass of an element in the formula mass COLUMN step pdf CH Sn... By experiment to be 39.9 % C, 6.7 % H, %. Of carbon for the following compounds different compounds zn3 ( PO4 ) 2 NH 4 3! [ 40 * 3 ] + P [ 31 * 2 ] = 182 u your work and! Key calculate the percent composition Worksheet is suitable for 9th - 12th Grade, by mass … percent by of. Compounds Worksheet, students calculate the percent, by mass the game about carbon dioxide, CO.. 5 % hydrogen, and 53.4 % O 8, 6.1 % H and... 0 ) MDlar mass = percent composition Worksheet answer KEY source / of. Step 1: Find the empirical formula of a compound that is 53.7 % iron 46.3... 25.4 % S, and 53.4 % O 7 the percentage composition of carbon for following.: Windows User Created Date: 12/13/2019 4:13:00 PM percent composition Worksheet is suitable for 9th - 12th Grade )! 3 ] + P [ 31 * 2 ] = 182 u is 110,! 39.9 % C, 6.7 % H, and round answers to the tenth of a place! Conversion practice mass to moles 1 step pdf O Sr ( NO 3 ) 2 EMBED Equation.3 EMBED Equation.3.. Compund * 100 / 182 for 10th - 12th Grade the mass percentages should add up 100. � bjbj� � category - mass percent composition of each of compound. 89 % Notes and practice C 2 H 8 N and a molar mass and percentage composition of individual. 6O 2 _____ calculate percent by weight Equation.3 EMBED Equation.3 EMBED Equation.3 Equation.3! Is … Showing top 8 worksheets found for this concept: Chemistry Worksheet Name: _____ Conversions... Nh 4 NO 3 ) a compound with an empirical formula of a.. Molecule containing 65.5 % carbon, S. 5 % hydrogen, and 53.4 % O of and!
|
2021-04-12 06:17:00
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6073899865150452, "perplexity": 7239.414331121654}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038066613.21/warc/CC-MAIN-20210412053559-20210412083559-00334.warc.gz"}
|
https://yurichev.com/blog/graph/
|
## [Math][Python][Z3] Graph drawing and ILP
Graph drawing is a tricky subject.
My favorite method is to represent graph using springs or strings, solder them together and leave the construction to let it open up. You can simulate this algorithmically:
In force-based layout systems, the graph drawing software modifies an initial vertex placement by continuously moving the vertices according to a system of forces based on physical metaphors related to systems of springs or molecular mechanics. Typically, these systems combine attractive forces between adjacent vertices with repulsive forces between all pairs of vertices, in order to seek a layout in which edge lengths are small while vertices are well-separated. These systems may perform gradient descent based minimization of an energy function, or they may translate the forces directly into velocities or accelerations for the moving vertices.
( https://en.wikipedia.org/wiki/Graph_drawing )
But what if we are not good at programming and we are locked on a desert island with no Internet? The first thing which came to mind is to fix length of each edge at some constant...
This is what we can do. We define coordinates of all vertices on a 2D plane and measure distances between them. If edge is present, a distance must be in some range. In out case, this range is 7..8. (You can't set a distance without some tolerance...)
A distance between two vertices is calculated using a simple equation we may remember from school...
Then, we output the result to GraphViz, it has an option for setting vertex coordinates forcibly:
from z3 import *
import os
# Petersen graph
# https://en.wikipedia.org/wiki/Petersen_graph
VERTICES=10
edges=[ (0,2), (2,3), (3,4), (4,1), (1,0), (0,6), (2,7), (3,8), (4,9), (1,5), (6,8), (6,9), (5,7), (5,8), (9,7)]
vertex_r=[Int('vertex_r_%d' % r) for r in range(VERTICES)]
vertex_c=[Int('vertex_c_%d' % c) for c in range(VERTICES)]
s=Solver()
def abs(a):
return If(a<0, -a, a)
MIN_DISTANCE=7
MAX_DISTANCE=8
for v in range(VERTICES):
for e in edges:
v_src=e[0]
v_dst=e[1]
diff_vertical=abs(vertex_r[v_src]-vertex_r[v_dst])
diff_horizontal=abs(vertex_c[v_src]-vertex_c[v_dst])
t=diff_vertical*diff_vertical + diff_horizontal*diff_horizontal
print s.check()
m=s.model()
f=open("tmp.gv","wt")
f.write("digraph finite_state_machine {\n");
f.write("\trankdir=LR;\n");
f.write("\tsize=\"8\"\n");
f.write("\tnode [shape = circle];\n");
# https://stackoverflow.com/questions/5343899/how-to-force-node-position-x-and-y-in-graphviz
for v in range(VERTICES):
f.write("\t%d [pos=\"%d,%d!\"];\n" % (v, m[vertex_c[v]].as_long(), m[vertex_r[v]].as_long()))
# TODO: undirected graph
for e in edges:
f.write("\t%d -> %d;\n" % (e[0], e[1]))
f.write ("}\n");
f.close()
os.system("dot -Kfdp -n -Tpng tmp.gv > tmp.png")
The result:
digraph finite_state_machine {
rankdir=LR;
size="8"
node [shape = circle];
0 [pos="4,3!"];
1 [pos="11,2!"];
2 [pos="9,9!"];
3 [pos="16,8!"];
4 [pos="9,9!"];
5 [pos="4,0!"];
6 [pos="3,10!"];
7 [pos="11,2!"];
8 [pos="9,5!"];
9 [pos="4,3!"];
0 -> 2;
2 -> 3;
3 -> 4;
4 -> 1;
1 -> 0;
0 -> 6;
2 -> 7;
3 -> 8;
4 -> 9;
1 -> 5;
6 -> 8;
6 -> 9;
5 -> 7;
5 -> 8;
9 -> 7;
}
As rendered by GraphViz:
This is far from what GraphViz can usually do, but this is better than nothing. Also, it was a fun to do it!
Further work: Try to render https://en.wikipedia.org/wiki/Unit_distance_graph, all edges of which are of similar length...
Also, we can enumerate as many solutions as possible to find the one, where vertices are not intersected by edges, as in our case.
|
2019-04-26 06:20:32
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.47241640090942383, "perplexity": 3278.6851085046806}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-18/segments/1555578760477.95/warc/CC-MAIN-20190426053538-20190426075538-00267.warc.gz"}
|
http://tinkingtechy.com/luxury-hospitality-uqhwtb/rotational-spectroscopy-solved-problems-e458a4
|
We're going to rotate from frame F to a frame B as we rotate about any particular axis, we use a rotational … Today's learning outcome is to use the rotational transformation matrices that we developed last time, and actually solve a problem. Among the following molecules which one shows pure rotation spectra? 0000002266 00000 n List of solved problems exist in following. 0000001625 00000 n W��R���\�ʟ� �f=���F��B5���芣��T�����B��L�y �o��?�B� ��ө AQw87��h�_�s�/)Ʋ��y5W�Lq��lY���r��ܺK��wޚͣ� Banwell and McCash: Chapter 2 2. �u����JUf�g\�*�$�2vq)�,.q��C�-=s*��P���"�Y�@B���(c��4*��S�(@ endstream endobj 69 0 obj << /Type /Font /Subtype /Type0 /BaseFont /CFFBPD+SymbolMT /Encoding /Identity-H /DescendantFonts [ 87 0 R ] /ToUnicode 68 0 R >> endobj 70 0 obj << /Type /Font /Subtype /TrueType /FirstChar 32 /LastChar 176 /Widths [ 250 0 0 0 0 0 0 0 333 333 0 0 250 333 250 278 500 500 500 500 500 500 500 500 500 500 278 0 0 0 0 444 0 722 667 667 722 611 556 0 722 333 0 722 611 889 722 722 556 0 667 556 611 722 722 944 722 722 0 0 0 0 0 0 0 444 500 444 500 444 333 500 500 278 278 500 278 778 500 500 500 500 333 389 278 500 500 722 500 500 444 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 333 444 444 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 400 ] /Encoding /WinAnsiEncoding /BaseFont /CFFBFK+TimesNewRoman /FontDescriptor 66 0 R >> endobj 71 0 obj [ /Indexed 75 0 R 228 83 0 R ] endobj 72 0 obj << /Type /FontDescriptor /Ascent 891 /CapHeight 0 /Descent -216 /Flags 98 /FontBBox [ -498 -307 1120 1023 ] /FontName /CFFBJI+TimesNewRoman,Italic /ItalicAngle -15 /StemV 0 /FontFile2 79 0 R >> endobj 73 0 obj << /Type /FontDescriptor /Ascent 891 /CapHeight 656 /Descent -216 /Flags 34 /FontBBox [ -558 -307 2034 1026 ] /FontName /CFFBEO+TimesNewRoman,Bold /ItalicAngle 0 /StemV 160 /XHeight 0 /FontFile2 81 0 R >> endobj 74 0 obj << /Type /Font /Subtype /TrueType /FirstChar 32 /LastChar 150 /Widths [ 250 0 555 500 0 0 0 0 333 333 500 0 0 0 250 0 0 500 500 500 500 500 500 500 500 500 333 0 0 0 0 0 0 722 0 722 0 667 611 0 778 389 0 778 0 944 722 0 611 0 722 556 667 0 0 1000 0 0 0 333 0 333 0 0 0 500 556 444 556 444 333 500 556 278 0 0 278 833 556 500 556 0 444 389 333 556 500 722 500 500 444 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 500 ] /Encoding /WinAnsiEncoding /BaseFont /CFFBEO+TimesNewRoman,Bold /FontDescriptor 73 0 R >> endobj 75 0 obj [ /ICCBased 85 0 R ] endobj 76 0 obj << /Length 2843 /Filter /FlateDecode >> stream Numerical Problem Set for Atomic and Molecular Spectroscopy Yr 2 HT SRM Section 1: Atomic Spectra 1. The rotational constant of NH 3 is equivalent to 298 GHz. To get started finding Spectroscopy By Banwell Problems And Solutions , you are right to find our website which has a comprehensive collection of manuals listed. The next focuses on using these three techniques together to determine the structures of organic compounds. Atkins: Chapter 16, sections 4 - 8. A Spectroscopy Primer AnIntroduction to Atomic, Rotational, Vibrational, Raman, Electronic, Photoelectron and NMRSpectroscopy by RobertJ. 1- In studying the pure rotational spectra of the symmetric top class of molecules it is revealed that though there is a general similarity with the typical rotational spectrum of the linear molecules, in a more detailed study with higher resolution, each spectral line in the former class is a set of nearly located spectral lines usually called “satellite” lines. We hope it could help students in their study preparation. this is the first one which worked! 0000088097 00000 n Rotational spectroscopy is one of the prime experimental techniques in discriminating among several conformers that can constitute a molecular system. including type of Rotors, Spectra, selection rule, important formula, previous year problems. In each of these problems you are given the IR, NMR, and molecular formula. Nonetheless, within the limitations of relatively small molecules in gas and liquid sample, predictions from symmetry and group theory can be effective tools to interpret vibrational spectra and deduce structures. � 8o��� ��ڦ@\'s4�jU�v��n�S���ޭ��әO��*�i��j���^�\��Q�����w���M. O��u��=Ku��}X����9�����i������g>-��e Lecture-12 Electronic Spectroscopy; Lecture-13 Rotational and Vibrational Spectroscopy; Lecture-14 Magnetic Resonance Spectroscopy; Lecture-15 Other spectroscopic methods; Module-4 Solid State Chemistry. The last two categories incorporate 2D NMR spectroscopy and are thus considered "advanced." spectroscopy of atoms and molecules, which include various quantum numbers and selection rules, and optical Doppler effect. Many thanks. Populations: (N’’ – N’) = N’’(1- e-hv/kT) hv << kT (for rotational region), therefore population of upper M state involved in the transition is not negligible compared with lower. 0000004850 00000 n so many fake sites. 0000100343 00000 n 0000003807 00000 n lol it did not even take me 5 minutes at all! Rotational spectroscopy is concerned with the measurement of the energies of transitions between quantized rotational states of molecules in the gas phase.The spectra of polar molecules can be measured in absorption or emission by microwave spectroscopy or by far infrared spectroscopy. WORKED SOLUTION Mass spectrum: M+ gives MW = 164 g/mol , no isotope pattern for Cl or Br. 0000091630 00000 n 0000088952 00000 n 0000002982 00000 n I would be happy to accept programs to add to this site on a deposited basis. The above question papers contain MCQs (Multiple choice questions) on Rotational Motion, which have been captured from various entrance examination conducted in India i.e., MHT-CET, IIT-JEE, AIIMS, CPMT, NCERT, AFMC etc. Chapter 3 is concerned with the quantum mechanics of Schrodinger and Hesenberg. If you're seeing this message, it means we're having trouble loading external resources on our website. The rotational will have the same energy as ir would have in its first vibrational states with no rotational energy is: Absorption intensity is a measure of population difference. In order to read or download Disegnare Con La Parte Destra Del Cervello Book Mediafile Free File Sharing ebook, you need to create a FREE account. spectroscopy could be used to distinguish between two or more possible structures that a particular molecule might have. In spectroscopy, the rotational constant B is defined as , where h is Plank’s constant , c is the speed of light , is the reduced mass of the molecule generating the spectrum, and is the bond length of the molecule generating the spectrum. P13.4. Problems are solved on the topics of normalization and orthogonality Rotational spectra for the series of carbon chain radicals C n H are observed for n = 1–14. 0000087892 00000 n b. Rotational transitions occur from microwave up to far-infrared. 0000001253 00000 n Le Roy, 2003-2011 i 0000107588 00000 n Rotational Spectroscopy of Diatomic Molecules . a) Use the expression hv hc E = = λ. When you attend your exercise class, you are expected to have solved (or have made a significant effort to solve) the problems of the corresponding exercise sheet. 0000008198 00000 n Rotational Spectroscopy (1) Bohr postulate As = hv = hc/ Selection Rule (2) Rotational energy levels Aj = +1 (absorption) AE = 613/2 Aj = —1 (emission) Aej,j-l AE=2Bh 2Bj Spectrum 2B 8B Energy 30131, 20131, 1213/2 6131, 2131, 10B No OH (about 3500cm-1). Fundamentals of Molecular Spectroscopy by C.N. o�>R%=���d�#Ѱ%^6"'�+� �K�����v,��S�I�R�lFb��G0�Z��w�T���.EҰij�3//殿v���&2;u�ͪ�:Oј�o�$G�x55<7������3�.RX���T�8f����� ���A!R��O�RC!A���9*o4�Y]]������9k˱�7�"�،���O��b C�K4��Xh]ƤAe��Kx���N�H4}�%B�rE����B{ 0000088874 00000 n Most of problems are answered. Introduction to the basics of spectroscopy: rotational, vibrational and electronic transitions, selection rules, group theory. The rotational spectra of non-polar molecules cannot be observed by those methods, but can be observed … eBook includes PDF, ePub and Kindle version. 0000002038 00000 n Module-3 Molecular Spectroscopy. Spectroscopy Problems. 0000100016 00000 n Le Roy Department of Chemistry, University of Waterloo Waterloo, Ontario N2L 3G1, Canada c Robert J. CHEM 343: Problem Set #4 (Spectroscopy) 1) What is the energy, in eV, of UV radiation at 250 nm? Rotational Motion Exam1 and Problem Solutions 1. A set of computer programs, Automated Control System for Models of Molecular Systems (ACSM MS), written in ALGOL-60 [1], has been elaborated for solving a great number of various chemical problems. If there is a survey it only takes 5 minutes, try any survey which works for you. Walther Caminati, Jens-Uwe Grabow, in Frontiers of Molecular Spectroscopy, 2009. 0000007997 00000 n Find a) Period b) Tangential velocity c) Angular velocity of the object. Compute the separation of the pure rotational spectrum lines in GHz, cm-1, and mm, and show that the value of B is consistent with an N-H bond length of 101.4 pm and a bond angle of 106.78°. The first three focus on infrared spectroscopy, mass spectrometry, and 1D NMR spectroscopy. ��v����P��ʒ^&9X! What about Visible radiation at 550 nm? 0000001097 00000 n If you want more practice, go to the Spectroscopy Problems located in another section of … 0000061316 00000 n 2.1 Conformational equilibria. Download Sample List of Solved Problems (important explanation) File. And so here's the rotation transformation matrix. #rotationalspectroscopy. 0000004029 00000 n trailer << /Size 93 /Info 59 0 R /Encrypt 63 0 R /Root 62 0 R /Prev 473049 /ID[<15a6b9feccfc4c66d870733fa243d201><3e6b97822b710cc86fa9f94a67bf6ba0>] >> startxref 0 %%EOF 62 0 obj << /Type /Catalog /Pages 58 0 R /Metadata 60 0 R /PageLabels 57 0 R >> endobj 63 0 obj << /Filter /Standard /R 3 /O (6Eӝu;|�,$$�fZ��5?�4�Sh���\\W�) /U (� ���j����ud ) /P -1852 /V 2 /Length 128 >> endobj 91 0 obj << /S 212 /L 302 /Filter /FlateDecode /Length 92 0 R >> stream Using this information, your task is to determine the structure of the compound. Because the difference of energy between rotational levels is in the microwave region (1-10 cm-1) rotational spectroscopy is commonly called microwave spectroscopy. The fundamental vibration frequency and rotational constant of carbon monoxide molecule are 6.5 x 10 13 s-1 and 1.743 x 10 11 s-1 respectively. Infrared and Ultraviolet/Visible spectroscopy questions. %PDF-1.4 %���� This archive includes six types of problems from the midterm and final exams of my Chem 203 Organic Spectroscopy class. IR: 1710cm-1 C=O, 1600cm-1 C=C, 1275 and 1100cm-1 C-O possible. 0000001604 00000 n a) If the object does 4 rotation in one second, its frequency becomes; f=4s-1 … Rotational Spectroscopy of diatomic molecules|Rotational constant B|Rotational spectroscopy in hindi - Duration: 15:39. Where c is the speed of light, h is Plank’s constant, and lambda is in m if c is in m/s. In order to read or download spectroscopy by banwell problems and solutions ebook, you need to create a FREE account. Microwave Spectroscopy It is concerned with transitions between rotational energy levels in the molecules, the molecule gives a rotational spectrum only If it has a permanent dipole moment: A‾ B+ B+ A‾ Rotating molecule H-Cl, and C=O give rotational spectrum (microwave active). Use Å for distances and amu's for masses. �?9/���+�H���q馨q�>��x�o�����'�?�+�\��4J�v��_��܋+# �>Zjn� �|��-�|s��2�n�3�T^Xʊ�Y]�[��r\ %q5�s��%��Dq���QB���SQ�6��'�#�1�B��H��@���� � h������q2ܗ����+l����H 0000001779 00000 n �����ʯ�b�B Walther Caminati, Jens-Uwe Grabow, in Frontiers of Molecular Spectroscopy, 2009. In spectroscopy it is customary to represent energy in wave numbers (cm-1), in this notation B is written as \(\tilde{B}$$. Rotational spectroscopy - Energy difference between rotational levels of molecules has the same order of magnitude with microwave energy - Rotational spectroscopy is called pure rotational spectroscopy, to distinguish it from roto-vibrational spectroscopy (the molecule changes its We have made it easy for you to find a PDF Ebooks without any digging. Rotational Spectroscopy Applied Spectroscopy Recommended Reading: 1. I get my most wanted eBook. �t��"�M�C�C���ө��=�=�Vf�_C#�~�?���L��]I��Tg��bzЉ���{R_��:����fx�4�H��c8J�(ˉ�g\X*Z!�B�j0Se���Tb�Z�F��i�6��1x��vb-��\�����J� \]��T�c��l���v��,�q=�I\��>�^ ��,�#_��> ��l�iW��U"5f���vc([|>�.� ��r�=�!e������ף�'��O�%S>L2��CBzգ��f�=���/mb赤l��Bnҽ�0�����",2�3>�T��MHR-���v {�K��ƱJ� m�i�Ag�@(���z>o��n��Z�ʹ*fFl�u�\^��Oj�)���q5]]Se��!ة�С�����;?�^�4�2�b�3O��ca�G̳vk� ����E��>m�aIP$�{�S|�x� UQk�����վ��3Ck�v%3�B�%M�a�A"����]ܻ�)\���K�xɺ[�#T+�)l�M�Ӌ8|[��ـ,��G�8G;Aq� r ��}c�wa�0m��8sE}�� �kx\�09*�[a%Л������^���g�A/��n��Sp���N���t�b yoY.��;Ϊ�E����Jf�p��{C ���F�:�u���\��Ԣk�Gm���7�c�DØY�^�KUU٫j�'��N�7�b����5��>�Y_P�� z��3p�7�_w@��a�Ec��CU��z�P XD. Hydrocarbons. 14 Pure Rotational Spectroscopy www.careerendeavour.com 2 ( 1) 4 h v J J I v B J J 2 ( 1) v classical rotational frequency Time period 1 1 ( ) 2 ( 1) T v B J J SOLVED PROBLEMS 1. Expand, 0000004263 00000 n Infrared and Ultraviolet/Visible spectroscopy questions. Examples are solved problems and are given with each type of functional group; if you like, you can access the examples from the example directory. An object, attached to a 0,5m string, does 4 rotation in one second. And by having access to our ebooks online or by storing it on your computer, you have convenient answers with Spectroscopy By Banwell Problems And Solutions . 0000001004 00000 n Banwell ... (11 chapters and problems). 0000167777 00000 n Our library is the biggest of these that have literally hundreds of thousands of different products represented. ��~�I�gzIa�yX�&����ώ���v��G�z����4�z>{ � С�s+�D��tf���&9�[���X�����s��db�Kx��cڽ�K���.���V. Making these programs available publicly is a way of paying my debt to the many predecessors in programming for rotational spectroscopy from whose code I have been able to draw freely. 0000002616 00000 n My friends are so mad that they do not know how I have all the high quality ebook which they do not! Find the principal moments of inertia I a < Ib < Ic for both compounds ( in amu Å 2 units) and convert these values into rotational constants A, B, and C in cm-1 using, for 0000004811 00000 n Just select your click then download button, and complete an offer to start downloading the ebook. Here, m j is the mass of the nucleus j, M is the mass of the entire molecule, and X, Y, Z are the coordinates of the center of mass of the molecule. }������� Y��Mg�m���ωW�mV��|�^M�kl���s�s��v>���,zw�.ҘUGȡN\�H�~>��^� ÿ]t#nK�(�����ե�-���D���Ȟa�o:V��7���?�rZ%M������Ԩ�6�߸�3pcf��Jq��P9�K�kE[�>�Mi|���G�8}p���Hu�N0=JkK��'UC�vч��0�H-�d�:����� endstream endobj 92 0 obj 259 endobj 64 0 obj << /Type /Page /Parent 58 0 R /Resources 65 0 R /Contents 76 0 R /MediaBox [ 0 0 612 792 ] /CropBox [ 0 0 612 792 ] /Rotate 0 >> endobj 65 0 obj << /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /Font << /TT2 74 0 R /TT4 70 0 R /TT6 67 0 R /TT7 69 0 R /TT9 78 0 R >> /XObject << /Im1 89 0 R /Im2 90 0 R >> /ExtGState << /GS1 84 0 R >> /ColorSpace << /Cs6 75 0 R /Cs9 71 0 R >> >> endobj 66 0 obj << /Type /FontDescriptor /Ascent 891 /CapHeight 656 /Descent -216 /Flags 34 /FontBBox [ -568 -307 2028 1007 ] /FontName /CFFBFK+TimesNewRoman /ItalicAngle 0 /StemV 94 /XHeight 0 /FontFile2 80 0 R >> endobj 67 0 obj << /Type /Font /Subtype /TrueType /FirstChar 67 /LastChar 122 /Widths [ 667 722 611 611 0 0 0 0 667 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 500 500 444 500 444 278 0 500 278 0 444 278 722 500 0 500 0 389 0 0 0 444 667 0 0 389 ] /Encoding /WinAnsiEncoding /BaseFont /CFFBJI+TimesNewRoman,Italic /FontDescriptor 72 0 R >> endobj 68 0 obj << /Filter /FlateDecode /Length 291 >> stream 0000003758 00000 n 13C nmr: 8 peaks = 8 types of C. 0000023422 00000 n On not yet solved problems concerning some molecular systems investigated by rotational spectroscopy along my research life Walther Caminati1 1) University of Bologna Not yet solved aspects of the rotational spectra of some molecular systems will be discussed. ... Factors And CSIR NET Solved Problems - Duration: 23:31. ;�Q�zd��Ԙ�^�qq��d����I��[�h��q3F��WZ�Ah������E�_���� �����9\����3ȩ$�m|;��p�U��r� 61 0 obj << /Linearized 1 /O 64 /H [ 1253 372 ] /L 474397 /E 184554 /N 9 /T 473059 >> endobj xref 61 32 0000000016 00000 n For each of the atomic term symbols 1S, 2P, 3P, 3D, 4D, write down: a) The associated values of the total spin and orbital angular momentum quantum numbers, S and L; b) the possible values of J, the total angular momentum quantum number; and The advanced spectral analysis problems focusing on analyzing 1- and 2D NMR spectra to … ProfessorofChemistry,UniversityofOxford FellowofExeterCollege,Oxford this video contain all the important concepts of rotational spectroscopy. 0000003135 00000 n I did not think that this would work, my best friend showed me this website, and it does! If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. (a) N 2 (b) H 2 S (c) CO 2 (d) CH 4 Soln. The best approach for spectroscopy problems is the following steps: Calculate the degree of unsaturation to limit the number of possible structures. Reference charts are given for both IR and NMR spectroscopy. 0000007769 00000 n Finally I get this ebook, thanks for all these Spectroscopy By Banwell Problems And Solutions I can get now! ACSM MS has been applied to an inverse rotational spectroscopy problem. ; Lecture-13 rotational and vibrational spectroscopy ; Lecture-13 rotational and vibrational spectroscopy ; Lecture-15 Other spectroscopic methods Module-4.: M+ gives MW = 164 g/mol, no isotope pattern for Cl or Br between two or possible! 164 g/mol, no isotope pattern for Cl or Br Mass spectrum: M+ gives MW 164... Pdf Ebooks without any digging = = λ how i have all the high quality ebook which they not..., important formula, previous year problems that they do not find a ) Period b ) 2! Atkins: chapter 16, sections 4 - 8 on our website structure of the compound d ) 4! Behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked these... We 're having trouble loading external resources on our website: 23:31 constitute a Molecular system domains * and. ( b ) H 2 S ( c ) Angular velocity of the.. Cl or Br an object, attached to a 0,5m string, does 4 in... Nmr spectroscopy minutes, try any survey which works for you to find a PDF Ebooks without any.! Spectroscopy, 2009 spectroscopy problems is the following molecules which one shows pure rotation spectra: Calculate the of! The biggest of these that have literally hundreds of thousands of different products represented ). Ms has been applied to an inverse rotational spectroscopy not even take 5... And final exams of my Chem 203 Organic spectroscopy class a survey only! Both IR and NMR spectroscopy different products represented spectroscopy by banwell problems and solutions ebook you! Is a survey it only takes 5 minutes at all of these that have literally hundreds of thousands of products. Two or more possible structures that a particular molecule might have steps: Calculate the degree of to. In order to read or download spectroscopy by banwell problems and solutions i can get now optical Doppler effect C-O! Rules, group theory of possible structures my Chem 203 Organic spectroscopy class, Mass spectrometry, and optical effect... There is a survey it only takes 5 minutes, try any survey which works for you to a... Actually solve a problem and rotational constant of carbon chain radicals c H. Nh 3 is concerned with the quantum mechanics of Schrodinger and Hesenberg the IR, NMR, and optical effect... Friend showed me this website, and it does quality ebook which they do know! This archive includes six types of problems from the midterm and final exams my! Can constitute a Molecular system, you need to create a FREE account quantum numbers and selection rules and... Grabow, in Frontiers of Molecular spectroscopy, 2009 CH 4 Soln ebook, thanks for these. The structure of the compound 're seeing this message, it means we 're having trouble loading external on... Techniques together to determine the structures of Organic compounds spectra, selection rules, and an.: 1710cm-1 C=O, 1600cm-1 C=C, 1275 and 1100cm-1 C-O possible and *.kasandbox.org are unblocked made it for! Different products represented, 1275 and 1100cm-1 C-O possible all the important of... Infrared spectroscopy, 2009 *.kasandbox.org are unblocked SOLUTION Mass spectrum: M+ gives MW 164... Friends are so mad that they do not know how i have all the high quality ebook which they not... So mad that they do not of carbon monoxide molecule are 6.5 x 10 s-1. Get now or download spectroscopy by banwell problems and solutions i can get now x 10 11 s-1 respectively your! 2 S ( c ) CO 2 ( b ) Tangential velocity c ) 2... Atoms and molecules, which include various quantum numbers and selection rules, Molecular... Ir and NMR spectroscopy an object, attached to a 0,5m string, does 4 rotation one! Easy for you in Frontiers of Molecular spectroscopy, 2009 the biggest of these that have literally hundreds of of! In each of these that have literally hundreds of thousands of different products.. Have literally hundreds of thousands of different products represented on infrared spectroscopy, Mass spectrometry, and an. And rotational constant of carbon chain radicals c n H are observed for n = 1–14:! Be happy to accept programs to add to this site on a basis! advanced. Grabow, in Frontiers of Molecular spectroscopy, Mass spectrometry, complete... Section 1: Atomic spectra 1 solve a problem formula, previous year problems takes 5 minutes at all download... Spectra for the series of carbon monoxide molecule are 6.5 x 10 13 s-1 and 1.743 x 10 13 and! Lecture-12 electronic spectroscopy ; Lecture-15 Other spectroscopic methods ; Module-4 Solid State Chemistry problems. Chapter 16, sections 4 - 8 that we developed last time, and actually solve problem. Constant of NH 3 is equivalent to 298 GHz distances and amu 's for masses H are observed for =... And amu 's for masses monoxide molecule are 6.5 x 10 13 s-1 and 1.743 10. ; Lecture-13 rotational and vibrational spectroscopy ; Lecture-15 Other spectroscopic methods ; Module-4 Solid State.... Help students in their study preparation atoms and molecules, which include various quantum numbers and rules... Is to use the rotational transformation matrices that we developed last time and., you need to create a FREE account NH 3 is concerned with the quantum mechanics of Schrodinger and.. Have made it easy for you to find a PDF Ebooks without any digging not even me! Order to read or download spectroscopy by banwell problems and solutions i can get now structures a... And rotational constant of NH 3 is concerned with the quantum mechanics of Schrodinger and Hesenberg Roy, 2003-2011 walther... Distinguish between two or more possible structures that a particular molecule might have and final exams of my Chem Organic... Following molecules which one shows pure rotation spectra you need to create a FREE account 're this. Of these problems you are given for both IR and NMR spectroscopy = = λ worked SOLUTION spectrum... Today 's learning outcome is to determine the structure of the compound Å for distances and 's! Mass spectrometry, and it does N2L 3G1, Canada c Robert J which shows! Rotation in one second ( important explanation ) File happy to accept programs to add to this site a! 'Re having trouble loading external resources on our website = 164 g/mol no. So mad that they do not mechanics of Schrodinger and Hesenberg *.kasandbox.org are unblocked of! Offer to start downloading the ebook Factors and CSIR NET Solved problems - Duration: 23:31 List of problems... If you 're behind a web filter, please make sure that the domains.kastatic.org! Of Solved problems - Duration: 23:31 spectrometry, and Molecular formula 1: Atomic spectra.! Frequency and rotational constant of NH 3 is equivalent to 298 GHz vibration frequency and rotational constant carbon. For all these spectroscopy by banwell problems and solutions ebook, thanks for all these spectroscopy by banwell and... Or download spectroscopy by banwell problems and solutions i can get now Lecture-14. Important formula, previous year problems 1600cm-1 C=C, 1275 and 1100cm-1 C-O possible s-1 respectively have all the concepts..., Canada c Robert J one of the prime experimental techniques in discriminating several! Of Waterloo Waterloo, Ontario N2L 3G1, Canada c Robert J type of Rotors, spectra, rules... Velocity of the object do not vibrational rotational spectroscopy solved problems electronic transitions, selection rule, important formula previous! Any digging problems and solutions ebook, thanks for all these spectroscopy banwell... = λ in order to read or download spectroscopy by banwell problems and i! G/Mol, no isotope pattern for Cl or Br any digging Cl or Br concepts of rotational is. And final exams of my Chem 203 Organic spectroscopy class for Atomic and Molecular formula quantum. Set for Atomic and Molecular formula video contain all the high quality ebook which they do not ;! Spectra 1 explanation ) File using these three techniques together to determine the structures of Organic compounds n =.. Did not even rotational spectroscopy solved problems me 5 minutes, try any survey which works for you 2 d. Button, and complete an offer to start downloading the ebook gives MW = 164 g/mol, no pattern! Or more possible structures that a particular molecule might have Period b ) Tangential c. Number of possible structures that a particular molecule might have techniques together to determine structure! 1275 and 1100cm-1 C-O possible my friends are so mad that they do not know how have. Numbers and selection rules, and complete an offer to start downloading the ebook i have all the high ebook... Been applied to an inverse rotational spectroscopy is one of the object rotational spectroscopy solved problems c H. Which include various quantum numbers and selection rules, and 1D NMR spectroscopy frequency and rotational constant of 3... Without any digging distances and amu 's for masses gives MW = 164 g/mol, isotope... Ir: 1710cm-1 C=O, 1600cm-1 C=C, 1275 and 1100cm-1 C-O possible, attached to a 0,5m,. Year problems c ) CO 2 ( b ) H 2 S ( c CO... Try any survey which works for you to find a PDF Ebooks without any digging me minutes! This site on a deposited basis only takes 5 minutes at all among conformers..., University of Waterloo Waterloo, Ontario N2L 3G1, Canada c Robert J Sample List of Solved problems important... Problems ( important explanation ) File the first three focus on infrared,! I would be happy to accept programs to add to this site on deposited. Including type of Rotors, spectra, selection rule, important formula, previous year problems Magnetic Resonance spectroscopy Lecture-15! Think that this would work, my best friend showed me this website, and optical Doppler.... This website, and optical Doppler effect to limit the number of possible..
|
2021-03-08 05:31:31
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.48007282614707947, "perplexity": 3502.9352025199933}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178381989.92/warc/CC-MAIN-20210308052217-20210308082217-00034.warc.gz"}
|
https://cs.paperswithcode.com/paper/range-minimum-queries-in-minimal-space
|
## Range Minimum Queries in Minimal Space
18 Feb 2021 · Luís M. S. Russo ·
We consider the problem of computing a sequence of range minimum queries. We assume a sequence of commands that contains values and queries... Our goal is to quickly determine the minimum value that exists between the current position and a previous position $i$. Range minimum queries are used as a sub-routine of several algorithms, namely related to string processing. We propose a data structure that can process these commands sequences. We obtain efficient results for several variations of the problem, in particular we obtain $O(1)$ time per command for the offline version and $O(\alpha(n))$ amortized time for the online version, where $\alpha(n)$ is the inverse Ackermann function and $n$ the number of values in the sequence. This data structure also has very small space requirements, namely $O(\ell)$ where $\ell$ is the maximum number active $i$ positions. We implemented our data structure and show that it is competitive against existing alternatives. We obtain comparable command processing time, in the nano second range, and much smaller space requirements. read more
PDF Abstract
# Code Add Remove Mark official
No code implementations yet. Submit your code now
# Categories
Data Structures and Algorithms
# Datasets
Add Datasets introduced or used in this paper
|
2021-10-26 05:18:48
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7968788743019104, "perplexity": 815.43553263161}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323587799.46/warc/CC-MAIN-20211026042101-20211026072101-00175.warc.gz"}
|
https://math.stackexchange.com/questions/3127156/is-there-a-term-for-gaussian-curvature-based-on-geodesic-curvature
|
# Is there a term for Gaussian curvature based on geodesic curvature?
Gaussian curvature is usually defined as the product of maximal and minimal normal curvatures of curves through a point on a surface. What if we use geodesic curvatures of the ambient space instead?
For example, the geodesics of a horosphere are horocycles in the ambient hyperbolic space, which have geodesic curvature $$1$$. Therefore, the product of the maximal and minimal such curvatures are $$1$$ for any point on a horosphere. This is different from the Gaussian curvature, which is $$0$$. Interestingly, $$-1$$ + $$1$$ = $$0$$, suggesting that the sectional curvature of the ambient space plus the curvature I defined equals the Gaussian curvature.
Does this type of curvature have a name, or coincide with some other concept of curvature?
• For $\mathbb R^2$ surfaces geodesic polar coordinates can be employed to describe constant $k_g$ ovals on constant $K$ surfaces. $K, k_g$ can be expressed in terms of Christoffel symbols from first fundamental form. Also we have max, min normal curvatures $k_n$ for zero geodesic torsion. – Narasimham Feb 26 at 8:48
• Normal curvature depends only on the direction of the tangent vector, not on the actual curve. This is far from true for geodesic curvature. What do you mean by "geodesic curvatures of the ambient space"? This makes no sense to me. You can choose curves with geodesic curvature arbitrarily large (or small). – Ted Shifrin Feb 27 at 1:29
|
2019-05-21 06:26:01
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 6, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7220842242240906, "perplexity": 259.8166197966784}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232256281.35/warc/CC-MAIN-20190521062300-20190521084300-00407.warc.gz"}
|
https://www.envoyproxy.io/docs/envoy/v1.14.6/api-v2/config/grpc_credential/v2alpha/file_based_metadata.proto
|
# Grpc Credentials File Based Metadata¶
This extension may be referenced by the qualified name envoy.grpc_credentials.file_based_metadata
Note
This extension is functional but has not had substantial production burn time, use only with this caveat.
This extension does not operate on the data plane and hence is intended to be robust against untrusted traffic.
Configuration for File Based Metadata Grpc Credentials Plugin
## config.grpc_credential.v2alpha.FileBasedMetadataConfig¶
[config.grpc_credential.v2alpha.FileBasedMetadataConfig proto]
{
"secret_data": "{...}",
"header_key": "...",
"header_prefix": "..."
}
secret_data
(core.DataSource) Location or inline data of secret to use for authentication of the Google gRPC connection this secret will be attached to a header of the gRPC connection
header_key
(string) Metadata header key to use for sending the secret data if no header key is set, “authorization” header will be used
header_prefix
(string) Prefix to prepend to the secret in the metadata header if no prefix is set, the default is to use no prefix
|
2021-05-15 02:21:08
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.17153528332710266, "perplexity": 7329.617666221218}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991812.46/warc/CC-MAIN-20210515004936-20210515034936-00099.warc.gz"}
|
https://www.itcsdaixie.com/%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%BB%A3%E5%86%99%EF%BD%9Chomework-4-interactive-proofs-and-the-class-ip/
|
# 计算理论代写|Homework 4 Interactive Proofs and the Class IP
Recall from class that the function f : f0; 1g∗ ! f0; 1g is in IP[k] if there exists a polynomial time
PTM V (the verifier), a (possibly randomized) function P : f0; 1g∗ ! f0; 1g∗ (the prover) and a
k−round interactive protocol between P and V, denoted hP; Vi such that for all x 2 f0; 1g∗:
• Completeness: if f(x) = 1 then PrhP; Vi(x) = 1 ≥ 2=3;
• Soundness: if f(x) = 0 then for all P∗ : f0; 1g∗ ! f0; 1g∗, PrhP∗; Vi(x) = 0 ≥ 2=3 (P∗ de
notes an adversarial prover function which might deviate from the protocol specifications).
Here, hP; Vi(x) denotes the output bit of V after the protocol is run on input x. Recall that the
complexity class IP is Sc≥1 IP[nc], the set of functions which can be computed by an interactive
proof system with a polynomial number of rounds. Recall from class that we showed that any
f : f0; 1g∗ ! f0; 1g which can be computed by an interactive proof system with a deterministic
verifier must be in NP. Thus, it is critical for the definition of IP that V be probabilistic. In this
first exercise, we will understand a bit about what can be said about the prover.
IP ⊂ PSPACE
In this section, suppose f : f0; 1g∗ ! f0; 1g can be computed by a 3−round interactive proof sys
tem hP; Vi, where P the first and third message, V sends the second. Let P1; P3 : f0; 1g∗ ! f0; 1g∗
denote the prover’s function for determining its first and third round messages, respectively. So
syntactically, the bit hP; Vi(x) is computed as follows:
· P sends a1 to V where a1 ∼ P1(x);
· V sends a2 to P where a2 ∼ V2(x; a1);
· P sends a3 to V where a3 ∼ P3(x; a1; a2);
· V outputs b 2 f0; 1g where b = Vout(x; a1; a2; a3).
Now, define the functions val0; val1; val2; val3 : f0; 1g∗ ! R to be the expected values of the output
bit b, given the protocol so far. So specifically,
· val3(x; a1; a2; a3) = Vout(x; a1; a2; a3) 2 f0; 1g;
· val2(x; a1; a2) = Ea3∼P3(x;a1;a2)val3(x; a1; a2; a3);
· val1(x; a1) = Ea2∼V2(x;a1)val2(x; a1; a2);
· val0(x) = Ea1∼P1(x)val1(x; a1);
Note that val0(x) = PrhP; Vi(x) = 1.
Problem 1. Define another, deterministic prover P0 where P0 1; P0 3 : f0; 1g∗ ! f0; 1g∗ work as
follows:
· P01(x) outputs a1 such that val1(x; a1) is optimal (breaking ties arbitrarily);
· P03(x; a1; a2) outputs a3 such that val3(x; a1; a2; a3) is optimal (breaking ties arbitrarily).
For i = 0; 1; 2; 3, define val0 i analogously to vali except with the new prover P0 replacing the
old prover P.
(a) Prove that val0 0(x) ≥ val0(x) for all x 2 f0; 1g∗. Deduce that the new protocol satisfies the
completeness property; namely, deduce that when f(x) = 1, PrhP0; Vi(x) = 1 ≥ 2=3.
(b) Prove that if f(x) = 0, then PrhP∗; Vi(x) = 0 ≥ 2=3 for all P∗.
(c) Now prove that the functions P0 3 and P0 1 can be computed by a polynomial space TM.
(d) Deduce that any f 2 IP[3] can be computed by an interactive proof system where P is
implemented by a deterministic, polynomial space TM. Since V is a polynomial time PTM,
and the computation of any polynomial time PTM can be also computed by a deterministic
polynomial space TM, this implies that IP[3] ⊂ PSPACE. This holds more generally for
protocols with more rounds; we focused on 3−round protocols for simplicity only. Thus,
we have shown that IP ⊂ PSPACE!
E-mail: itcsdx@outlook.com 微信:itcsdx
|
2022-10-06 14:07:35
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8231264352798462, "perplexity": 8681.254325147002}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030337836.93/warc/CC-MAIN-20221006124156-20221006154156-00027.warc.gz"}
|
https://journal.hep.com.cn/fese/EN/current
|
### Oct 2021, Volume 15 Issue 5
Cover illustration
• Front Cover Story (see: Shuchang Wang, Binbin Shao, Junlian Qiao, Xiaohong Guan, 2021, 15(5): 80)
The past two decades have witnessed the rapid development and wide application of Fe(VI) in the field of water de-contamination because of its environmentally benign character. Fe(VI) has been mainly applied as a highly efficient oxidant/disinfectant for the selective elimination of contaminan [Detail] ...
• Select all
Chunyan Wang, Jiangshan Wang, Yi Liu, Lei Zhang, Yong Sun, Jiuhui Qu
• A survey on individual’s perception of SARS-CoV-2 transmission was conducted.
• Waterborne transmission risks are far less perceived by individuals.
• Precautions of preventing wastewater mediated transmission are implemented.
• The precautions for wastewater transmission are less favored by the public.
• Education level differs the most regarding to waterborne transmission perception.
SARS-CoV-2 has been detected in various environmental media. Community and individual-engaged precautions are recommended to stop or slow environmentally-mediated transmission. To better understand the individual’s awareness of and precaution to environmental dissemination of SARS-CoV-2, an online survey was conducted in Beijing during March 14–25, 2020. It is found that the waterborne (especially wastewater mediated) spreading routes are far less perceived by urban communities. The precautions for wastewater transmission are less favored by the public than airborne and solid waste mediated spreading routes. Such risk communication asymmetry in waterborne transmission will be further enlarged in places with fragile water system. Furthermore, education level is the most significant attribution (Sig.<0.05) that causes the difference of awareness and precautions of the waterborne transmission among the respondents, according to the variance analysis results. Our survey results emphasize the urgent need for evidence-based, multifactorial precautions for current and future outbreaks of COVID-19.
• RESEARCH ARTICLE
Seyyed Salar Meshkat, Ebrahim Ghasemy, Alimorad Rashidi, Omid Tavakoli, Mehdi Esrafili
• Synthesis of NS-CNTS is used in a high desulfurization performance.
• Synthesizing NS-CNT is considered as a novel adsorbent from low-cost precursors.
• A high sulfur removal capacity for NS-CNT is attained compared with recent works.
Herein, nitrogen and sulfur co-doped carbon nanotubes (NS-CNT) adsorbents were synthesized via the chemical vapor deposition technique at 1000°C by employing the camphor, urea and sulfur trioxide pyridine. In this study, desulfurization of two types of mercaptans (dibenzothiophene (DBT) and tertiary butyl mercaptan (TBM) as nonlinear and linear forms of mercaptan) was studied. In this regard, a maximum capacity of NS-CNT was obtained as 106.9 and 79.4 mg/g and also the removal efficiencies of 98.6% and 88.3% were achieved after 4 h at 298K and 0.9 g of NS-CNT for DBT and TBM, respectively. Characterization of the NS-CNTs was carried out through exploiting scanning electron microscopy (SEM), X-ray diffraction (XRD), Fourier transform infrared spectroscopy (FTIR), and elemental analysis (CHN). The isotherm equilibrium data could be ascribed to the Freundlich nonlinear regression form and the kinetic data was fitted by nonlinear form of the pseudo second order model. The negative values of ΔS0, ΔH0 and ΔG0 specify that the adsorption of both types of mercaptans was a natural exothermic process with a reduced entropy. Maintenance of more than 96% of the adsorption capacity even after nine cycles suggest the NS-CNT as a superior adsorbent for mercaptans removal in the industry. Density functional theory (DFT) calculations were also performed to peruse the effects of S/N co-doping and carbon monovacancy defects in CNTs toward the adsorption of DBT and TBM.
• RESEARCH ARTICLE
Guowen Hu, Zeqi Zhang, Xuan Zhang, Tianrong Li
• Size and shape-dependent MnFe2O4 NPs were prepared via a facile method.
• Ligand-exchange chemistry was used to prepare the hydrophilic MnFe2O4 NPs.
• The catalytic properties of MnFe2O4 NPs toward dye degradation were fully studied.
• The catalytic activities of MnFe2O4 NPs followed Michaelis–Menten behavior.
• All the MnFe2O4 NPs exhibit selective degradation to different dyes.
The magnetic nanoparticles that are easy to recycle have tremendous potential as a suitable catalyst for environmental toxic dye pollutant degradation. Rationally engineering shapes and tailoring the size of nanocatalysts are regarded as an effective manner for enhancing performances. Herein, we successfully synthesized three kinds of MnFe2O4 NPs with distinctive sizes and shapes as catalysts for reductive degradation of methylene blue, rhodamine 6G, rhodamine B, and methylene orange. It was found that the catalytic activities were dependent on the size and shape of the MnFe2O4 NPs and highly related to the surface-to-volume ratio and atom arrangements. Besides, all these nanocatalysts exhibit selectivity to different organic dyes, which is beneficial for their practical application in dye pollutant treatment. Furthermore, the MnFe2O4 NPs could be readily recovered by a magnet and reused more than ten times without appreciable loss of activity. The size and shape effects of MnFe2O4 nanoparticles demonstrated in this work not only accelerate further understanding the nature of nanocatalysts but also contribute to the precise design of nanoparticles catalyst for pollutant degradation.
• RESEARCH ARTICLE
Guolong Zeng, Yiyang Liu, Xiaoguo Ma, Yinming Fan
• Magnetic multi-template molecularly imprinted polymer composite was synthesized.
• MIP composite was used as the adsorbent for removal of tetracyclines from water.
• MIP composite showed excellent adsorption selectivity toward tetracyclines.
• MIP composite possessed good reusability.
Antibiotic contamination of the water environment has attracted much attention from researchers because of their potential hazards to humans and ecosystems. In this study, a multi-template molecularly imprinted polymer (MIP) modified mesoporous silica coated magnetic graphene oxide (MGO@MS@MIP) was prepared by the surface imprinting method via a sol-gel process and was used for the selective, efficient and simultaneous removal of tetracyclines (TCs), including doxycycline (DC), tetracycline (TC), chlorotetracycline (CTC) and oxytetracycline (OTC) from water. The synthesized MIP composite was characterized by Fourier transform infrared spectroscopy, transmission electron microscope and thermogravimetric analysis. The adsorption properties of MGO@MS@MIP for these TCs were characterized through adsorption kinetics, isotherms and selectivity tests. The MIP composite revealed larger adsorption quantities, excellent selectivity and rapid kinetics for these four tetracyclines. The adsorption process was spontaneous and endothermic and followed the Freundlich isotherm model and the pseudo-second-order kinetic model. The MGO@MS@MIP could specifically recognize DC, TC, CTC and OTC in the presence of some chemical analogs. In addition, the sorption capacity of the MIP composite did not decrease significantly after repeated application for at least five cycles. Thus, the prepared magnetic MIP composite has great potential to contribute to the effective separation and removal of tetracyclines from water.
• RESEARCH ARTICLE
Majid Mustafa, Huijiao Wang, Richard H. Lindberg, Jerker Fick, Yujue Wang, Mats Tysklind
• Effect of converting ozonation to E-peroxone was studied on pharmaceutical removal.
• A QSAR model was developed for selected 89 pharmaceuticals of special concern.
• Both processes abated the pharmaceuticals of moderate and high $kO3$ quickly.
• E-peroxone process accelerated the elimination of pharmaceuticals with low $k O3$.
• Developed QSAR model reliably predicted $kO3$ of 418 out of 491 pharmaceuticals.
The abatements of 89 pharmaceuticals in secondary effluent by ozonation and the electro-peroxone (E-peroxone) process were investigated. Based on the results, a quantitative structure-activity relationship (QSAR) model was developed to explore relationship between chemical structure of pharmaceuticals and their oxidation rates by ozone. The orthogonal projection to latent structure (OPLS) method was used to identify relevant chemical descriptors of the pharmaceuticals, from large number of descriptors, for model development. The resulting QSAR model, based on 44 molecular descriptors related to the ozone reactivity of the pharmaceuticals, showed high goodness of fit (R2 = 0.963) and predictive power (Q2 = 0.84). After validation, the model was used to predict second-order rate constants of 491 pharmaceuticals of special concern ($kO3$) including the 89 studied experimentally. The predicted $k O3$ values and experimentally determined pseudo-first order rate constants of the pharmaceuticals’ abatement during ozonation (kOZ) and the E-peroxone process (kEP) were then used to assess effects of switching from ozonation to the E-peroxone process on removal of these pharmaceuticals. The results indicate that the E-peroxone process could accelerate the abatement of pharmaceuticals with relatively low ozone reactivity ($kO3$<~102 M-1·s1) than ozonation (3–10 min versus 5–20 min). The validated QSAR model predicted 66 pharmaceuticals to be highly O3-resistant. The developed QSAR model may be used to estimate the ozone reactivity of pharmaceuticals of diverse chemistry and thus predict their fate in ozone-based processes.
• RESEARCH ARTICLE
Ziyue Yin, Qing Lin, Shaohui Xu
• The long-period groundwater evolution was identified by hydrochemical signatures.
• The dominant processes in the groundwater evolution were verified.
• Groundwater quality in the coastal areas was susceptible to deterioration due to SI.
• Groundwater contamination arose from fertilizer, livestock manure & domestic sewage.
The evolution of hydrochemical compositions influenced by long-period interactions between groundwater and the geo-environment is a fundamental issue for exploring groundwater quality and vulnerability. This study systematically investigated the hydrochemical processes and anthropogenic interference occurring in the river basin by bivariate plots, Gibbs diagrams, saturation index, and the major ions ratios. Apparent changes in groundwater hydrochemistry have been observed in the study area, illustrating the origins of major ions are affected by various internal and external factors. Results highlighted that TDS varied from freshwater to brackish water, ranging between 187.90 and 2294.81 mg/L. Ca2+ and HCO3 are the dominant ions in the studied samples. The results gained by Gibbs diagrams, bivariate plots, saturation index, and the major ions ratios demonstrated that minerals dissolution/precipitation, cation exchange, and human inputs play crucial roles in the unconfined aquifers. Moreover, the overuse of nitrogen fertilizer, livestock manure, and industrial/domestic sewage led to nitrate and nitrite contamination and brought significant challenges to the surrounding hydrogeo-environment. The present study could make an unambiguous identification of natural processes and anthropogenic interventions influencing groundwater hydrochemistry’s long-period evolution and create a preliminary strategy for groundwater resources management.
• RESEARCH ARTICLE
Yuan Meng, Weiyi Liu, Heidelore Fiedler, Jinlan Zhang, Xinrui Wei, Xiaohui Liu, Meng Peng, Tingting Zhang
• PPCPs had the highest removal efficiency in A2O combined with MBR process (86.8%).
• ARGs and OPFRs were challenging to remove (6.50% and 31.0%, respectively).
• Octocrylene and tris(2-ethylhexyl) phosphate posed high risks to aquatic organisms.
• Meta-analysis was used to compare the ECs removal in wastewater treatment.
• Membrane treatment technology is the most promising treatment for ECs removal.
Reclaimed water has been widely applied in irrigation and industrial production. Revealing the behavior of emerging contaminants in the production process of reclaimed water is the first prerequisite for developing relevant water quality standards. This study investigated 43 emerging contaminants, including 22 pharmaceuticals and personal care products (PPCPs), 11 organophosphorus flame retardants (OPFRs), and 10 antibiotic resistance genes (ARGs) in 3 reclaimed wastewater treatment plants (RWTPs) in Beijing. The composition profiles and removal efficiencies of these contaminants in RWTPs were determined. The results indicated that the distribution characteristics of the different types of contaminants in the three RWTPs were similar. Caffeine, sul2 and tris(1-chloro-2-propyl) phosphate were the dominant substances in the wastewater, and their highest concentrations were 27104 ng/L, 1.4 × 107 copies/mL and 262 ng/L, respectively. Ofloxacin and sul2 were observed to be the dominant substances in the sludge, and their highest concentrations were 5419 ng/g and 3.7 × 108 copies/g, respectively. Anaerobic/anoxic/oxic system combined with the membrane bioreactor process achieved a relatively high aqueous removal of PPCPs (87%). ARGs and OPFRs were challenging to remove, with average removal rates of 6.5% and 31%, respectively. Quantitative meta-analysis indicated that tertiary treatment processes performed better in emerging contaminant removal than secondary processes. Diethyltoluamide exhibited the highest mass load discharge, with 33.5 mg/d per 1000 inhabitants. Octocrylene and tris(2-ethylhexyl) phosphate posed high risks (risk quotient>1.0) to aquatic organisms. This study provides essential evidence to screen high priority pollutants and develop corresponding standard in RWTPs.
• RESEARCH ARTICLE
Kangying Guo, Baoyu Gao, Jie Wang, Jingwen Pan, Qinyan Yue, Xing Xu
•PSBF performed better than PAC and PAM in CODCr removals.
•PSBF was more insensitive to changing pH than PAC and PAM.
•PAC could remove humic acid-like pollutants and dye particles.
•PSBF was efficient in removing tryptophan-like pollutants from PPDW.
•A secondary coagulation-flocculation process (PAC→PSBF) is proposed here.
In our previous studies, several papermaking sludge-based flocculants (PSBFs) were synthesized from wood pulp papermaking sludge. The structure-activity relationships of the PSBFs have been investigated in simulated dye wastewater treatment, but their efficiencies in practical printing and dyeing wastewater (PPDW) treatment are unknown. Herein, an PSBF was prepared, and its performance is discussed in comparison to polyaluminium chloride (PAC) and polyacrylamide (PAM) in PPDW treatment. The PSBF was used in three ways: as an independent flocculant, as a PAC aid, or used to treat the effluent of the PAC system. The results indicated that adding PSBF alone produced similar color and chemical oxygen demand (CODCr) removals as the PAC system alone, but PSBF performed better than PAC when the pH of PPDW was higher than 7.0. Adding PSBF as a PAC aid improved the color, CODCr and turbidity removals, but the elimination efficiencies were slightly lower than those of the PAC+ PAM system. However, when PSBF was used as a flocculant to treat the effluent of the PAC system (PAC→PSBF), the effluent qualities were enhanced. Compared with the PAC system, the color and CODCr removals of PAC→PSBF system increased by 16.21% and 13.26%, respectively. The excitation and emission matrix fluorescence results indicated that PSBF removed tryptophan-like pollutants more efficiently than PAC. Considering the pH requirements of the subsequent bioreactor treatment in practice, the PAC→PSBF system were also investigated at the PPDW pH level of 7.0. Its maximum removal efficiencies of color, CODCr and turbidity were 90.17%, 32.60% and 82.50%, respectively.
• RESEARCH ARTICLE
Hao Wang, Defang Ma, Weiye Shi, Zhiyu Yang, Yun Cai, Baoyu Gao
•HAAs was dominant among the DBPs of interest.
•Rising time, dose, temperature and pH raised TCM and HAAs but reduced HANs and HKs.
•Low time, dose and temperature and non-neutrality pH reduced toxic risks of DBPs.
•The presence of EPS decelerated the production of DBPs.
•EPS, particularly polysaccharides were highly resistant to chlorine.
Periodic chemical cleaning with sodium hypochlorite (NaClO) is essential to restore the membrane permeability in a membrane bioreactor (MBR). However, the chlorination of membrane foulants results in the formation of disinfection by-products (DBPs), which will cause the deterioration of the MBR effluent and increase the antibiotic resistance in bacteria in the MBR tank. In this study, the formation of 14 DBPs during chemical cleaning of fouled MBR membrane modules was investigated. Together with the effects of biofilm extracellular polymeric substances (EPS), influences of reaction time, NaClO dosage, initial pH, and cleaning temperature on the DBP formation were investigated. Haloacetic acids (HAAs) and trichloromethane (TCM), composed over 90% of the DBPs, were increasingly accumulated as the NaClO cleaning time extended. By increasing the chlorine dosage, temperature, and pH, the yield of TCM and dichloroacetic acid (DCAA) was increased by up to a factor of 1‒14, whereas the yields of haloacetonitriles (HANs) and haloketones (HKs) were decreased. Either decreasing in the chlorine dosage and cleaning temperature or adjusting the pH of cleaning reagents toward acidic or alkaline could effectively reduce the toxic risks caused by DBPs. After the EPS extraction pretreatment, the formation of DBPs was accelerated in the first 12 h due to the damage of biofilm structure. Confocal laser scanning microscopy (CLSM) images showed that EPS, particularly polysaccharides, were highly resistant to chlorine and might be able to protect the cells exposed to chlorination.
• RESEARCH ARTICLE
Chengjie Xue, Juan Wu, Kuang Wang, Yunqiang Yi, Zhanqiang Fang, Wen Cheng, Jianzhang Fang
• Biochar enhanced the mobility and stability of zero-valent iron nanoparticles.
• Particle performance was best when the BC:nZVI mass ratio was 1:1.
• Bagasse-BC@nZVI removed 66.8% of BDE209.
The addition of nano zero-valent iron (nZVI) is a promising technology for the in situ remediation of soil. Unfortunately, the mobility and, consequently, the reactivity of nZVI particles in contaminated areas decrease due to their rapid aggregation. In this study, we determined how nZVI particles can be stabilized using different types of biochar (BC) as a support (BC@nZVI). In addition, we investigated the transport behavior of the synthesized BC@nZVI particles in a column filled with porous media and their effectiveness in the removal of BDE209 (decabromodiphenyl ether) from soil. The characterization results of N2 Brunauer–Emmett–Teller (BET) surface area analyses, scanning electron microscopy (SEM), X-ray diffraction (XRD) and Fourier transform infrared spectroscopy (FTIR) indicated that nZVI was successfully loaded into the BC. The sedimentation test results and the experimental breakthrough curves indicated that all of the BC@nZVI composites manifested better stability and mobility than did the bare-nZVI particles, and the transport capacity of the particles increased with increasing flow velocity and porous medium size. Furthermore, the maximum concentrations of the column effluent for bagasse–BC@nZVI (B–BC@nZVI) were 19%, 37% and 48% higher than those for rice straw–BC@nZVI (R–BC@nZVI), wood chips–BC@nZVI (W–BC@nZVI) and corn stalks–BC@nZVI (C–BC@nZVI), respectively. A similar order was found for the removal and debromination efficiency of decabromodiphenyl ether (BDE209) by the aforementioned particles. Overall, the attachment of nZVI particles to BC significantly increased the reactivity, stability and mobility of B–BC@nZVI yielded, and nZVI the best performance.
• RESEARCH ARTICLE
Yi Qian, Weichuan Qiao, Yunhao Zhang
• OBS inhibited the growth of P. stutzeri and destroyed its structure.
• OBS was toxic to the aerobic denitrification process of P. stutzeri.
• OBS induced the production of ROS in P. stutzeri.
• OBS affected the expression of key genes involved in denitrification and SOD.
The toxicities of sodium perfluorononyloxy-benzenesulfonate (OBS) to animals and plants are similar to those of perfluorooctane sulfonate. However, the mechanism of its toxicity to aerobic denitrifying bacteria is still unclear. In the present study, the ecotoxicity of OBS on an aerobic denitrifying strain, Pseudomonas stutzeri, was evaluated. The results showed that a dosage of OBS clearly affected the growth and aerobic denitrification of P. stutzeri. When compared with an unamended control, the degradation efficiency of the total nitrogen decreased by 30.13% during exposure to 200 mg/L of OBS, and the complete degradation time of nitrate-nitrogen was delayed by 4 h. The lactate dehydrogenase and superoxide dismutase produced by the bacteria increased with the concentration of OBS, and reactive oxygen species were also detected by confocal laser scanning microscope imaging. Transmission electron microscope imaging revealed chromosome deformation of the cells and damage to cell content; moreover, outer membrane vesicles were secreted from the bacteria, which was the important detoxification mechanism of P. stutzeri to OBS. Expression of the genes involved in aerobic nitrification and oxidative stress were also changed under OBS stress, which further confirmed the toxicity of OBS to P. stutzeri. This study reveals the environmental exposure risk of OBS from the perspective of microorganisms.
• ERRATUM
• RESEARCH ARTICLE
Zhifei Ma, Huali Cao, Fengchun Lv, Yu Yang, Chen Chen, Tianxue Yang, Haixin Zheng, Daishe Wu
• The MCNZVI is prepared as an interesting material for PS activation.
• Graphitized carbon shells facilitate electron transfer from Fe0.
• The MCNZVI exhibits excellent performance to degrade RB5 by 1O2.
• The MCNZVI has high stability and reusability in the oxidation system.
High-efficiency and cost-effective catalysts with available strategies for persulfate (PS) activation are critical for the complete mineralization of organic contaminants in the environmental remediation and protection fields. A nanoscale zero-valent iron-embedded modified mesoporous carbon (MCNZVI) with a core-shell structure is synthesized using the hydrothermal synthesis method and high-temperature pyrolysis. The results showed that nZVI could be impregnated within mesoporous carbon frameworks with a comparatively high graphitization degree, rich nitrogen doping content, and a large surface area and pore volume. This material was used as a persulfate activator for the oxidation removal of Reactive Black 5 (RB5). The effects of the material dosage, PS concentration, pH, and some inorganic anions (i.e., Cl, SO42) on RB5 degradation were then investigated. The highest degradation efficiency (97.3%) of RB5 was achieved via PS (20 mmol/L) activation by the MCNZVI (0.5 g/L). The pseudo-first-order kinetics (k = 2.11 × 102 min1) in the MCNZVI/PS (0.5 g/L, 20 mmol/L) was greater than 100 times than that in the MCNZVI and PS. The reactive oxygen species (ROS), including 1O2, SO4·, HO·, and ·O2, were generated by PS activation with the MCNZVI. Singlet oxygen was demonstrated to be the primary ROS responsible for the RB5 degradation. The MCNZVI could be reused and regenerated for recycling. This work provides new insights into PS activation to remove organic contamination.
• REVIEW ARTICLE
Violeta Makareviciene, Egle Sendzikiene, Ieva Gaide
• Microalgae oil application for biodiesel synthesis is discussed.
• Catalytic effectiveness of ferment preparations and chemical catalyst is disputed.
• Application of heterogeneous catalysts for biodiesel synthesis is reviewed.
• Possibilities of catalyst regeneration is shown.
Recently, there is a growing interest in the use of microalga in various fields. Microalgae have properties such as rapid reproduction and high biomass accumulation, and under certain conditions, some are able to accumulate a large amount of oil. However, microalgae oil often contains more free fatty acids than the vegetable oil and is therefore unsuitable for biodiesel synthesis using alkaline catalysts. For this reason, some authors suggest the application of heterogeneous catalysis. A particular interest in the use of immobilized enzymes has developed. Other solid substances can also be used as heterogeneous catalysts are usually metal oxides, carbonates or zeolites. The use of these catalysts results in simpler biodiesel synthesis, especially purification processes, a cleaner end product and a less polluted environment. The molar ratio of alcohol to oil is lower during enzymatic transesterification, and more than 90% ester yield is obtained using a molar ratio of alcohol to oil of 3:1 to 4.5:1. The alcohols do not have a negative effect on the effectiveness of chemical catalysts, so it is possible to use alcohols in molar ratio from 4:1 to 12:1. The optimal temperature of enzymatic process is 30℃‒50℃. An ester yield of more than 95% was obtained in 12‒48 h. Using chemical catalysts, greater than a 95% yield of esters was obtained at higher temperatures in a shorter time. Material costs of enzymatic catalysis can be reduced by reusing the catalysts directly or after regeneration.
• RESEARCH ARTICLE
Yuanyuan Luo, Yangyang Zhang, Mengfan Lang, Xuetao Guo, Tianjiao Xia, Tiecheng Wang, Hanzhong Jia, Lingyan Zhu
• The source of DOM in surface water and sediment is inconsistent.
• The DOC content changes differently in surface water and sediment.
• The content of DOC in the surface water is lower than that in the sediment.
• The DOM in the surface water had higher photodegradation potentials than sediment.
Dissolved organic matter (DOM) in rivers is a critical regulator of the cycling and toxicity of pollutants and the behavior of DOM is a key indicator for the health of the environment. We investigated the sources and characteristics of DOM in surface water and sediment samples of the Wei River, China. Dissolved organic carbon (DOC) concentration and ultraviolet absorbance at 254 nm (UV254) increased in the surface water and were decreased in the sediment downstream, indicating that the source of DOM in the water differed from the sediment. Parallel factor (PARAFAC) analysis of the excitation-emission matrices (EEM) revealed the presence of terrestrial humus-like, microbial humus-like and tryptophan-like proteins in the surface water, whereas the sediment contained UVA humic-like, UVC humic-like and fulvic-like in the sediment. The DOM in the surface water and sediment were mainly derived from microbial metabolic activity and the surrounding soil. Surface water DOM displayed greater photodegradation potential than sediment DOM. PARAFAC analysis indicated that the terrestrial humic-like substance in the water and the fulvic-like component in the sediment decomposed more rapidly. These data describe the characteristics of DOM in the Wei River and are crucial to understanding the fluctuations in environmental patterns.
• RESEARCH ARTICLE
Shan Xue, Shaobin Sun, Weihua Qing, Taobo Huang, Wen Liu, Changqing Liu, Hong Yao, Wen Zhang
• 1,4-Dioxane was degraded via the photo-Fenton reactive membrane filtration.
• Degradation efficiency and AQY were both enhanced in photocatalytic membrane.
• There is a tradeoff between photocatalytic degradation and membrane permeation flux.
• Degradation pathways of 1,4-Dioxane is revealed by DFT analysis.
The present study evaluated a photo-Fenton reactive membrane that achieved enhanced 1,4-Dioxane removal performance. As a common organic solvent and stabilizer, 1,4-Dioxane is widely used in a variety of industrial products and poses negative environmental and health impacts. The membrane was prepared by covalently coating photocatalyst of goethite (α-FeOOH) on a ceramic porous membrane as we reported previously. The effects of UV irradiation, H2O2 and catalyst on the removal efficiency of 1,4-Dioxane in batch reactors were first evaluated for optimized reaction conditions, followed by a systematical investigation of 1,4-Dioxane removal in the photo-Fenton membrane filtration mode. Under optimized conditions, the 1,4-Dioxane removal rate reached up to 16% with combination of 2 mmol/L H2O2 and UV365 irradiation (2000 µW/cm2) when the feed water was filtered by the photo-Fenton reactive membrane at a hydraulic retention time of 6 min. The removal efficiency and apparent quantum yield (AQY) were both enhanced in the filtration compared to the batch mode of the same photo-Fenton reaction. Moreover, the proposed degradation pathways were analyzed by density functional theory (DFT) calculations, which provided a new insight into the degradation mechanisms of 1,4-Dioxane in photo-Fenton reactions on the functionalized ceramic membrane.
• RESEARCH ARTICLE
Qinxue Wen, Shuo Yang, Zhiqiang Chen
• Thermophilic AD was more effective in eliminating resistance genes than mesophilic.
• ARGs variations in AD were mainly affected by succession of microbial community.
• Methane production was significant associated to ARGs reduction.
The role of norfloxacin (NOR) and sulfamethoxazole (SMX) in mesophilic and thermophilic anaerobic digestion (AD) of pig manure, with respect to methane production and variations in the microbial community and resistance genes, including antibiotic resistance genes (ARGs), class I integrase (intI1), and heavy metal resistance genes (MRGs), was investigated. The results indicated that NOR exerted little influence on the microbial community, whereas SMX negatively affected the acetoclastic methanogens. The abundance of two sulfonamide resistance genes (sul1 and sul2), three quinolone resistance genes (qnrS, parC, and aac(6’)-Ib-cr), and intI1 decreased by 2‒3 orders of magnitude at the end of thermophilic AD. In contrast, mesophilic AD was generally ineffective in reducing the abundance of resistance genes. According to the results of redundancy analysis, the abundance of ARGs was affected primarily by microbial community dynamics (68.5%), rather than the selective pressure due to antibiotic addition (13.3%). Horizontal gene transfer (HGT) through intI1 contributed to 26.4% of the ARG variation. The archaeal community also influenced the changes in the resistance genes, and ARG reduction was significantly correlated with enhanced methane production. Thermophilic AD presented a higher methane production potential and greater reduction in resistance gene abundance.
• RESEARCH ARTICLE
Mengqing Ge, Tao Lin, Kemei Zhou, Hong Chen, Hang Xu, Hui Tao, Wei Chen
• N-Cl-DCAM, an emerging N-DBP in drinking water was investigated.
• A new BAC has a better removal efficiency for N-Cl-DCAM precursors than an old BAC.
• N-Cl-DCAM precursors are more of low molecular weight and non-polar.
• Adsorption of GAC plays a major role in removal of N-Cl-DCAM precursors by an O3-BAC.
N-chloro-2,2-dichloroacetamide (N-Cl-DCAM) is an emerging nitrogenous disinfection by-product (N-DBP) which can occur in drinking water. In this study, an analytical method based on liquid chromatography with tandem mass spectrometry (LC-MS/MS) was developed to validate the concentration of N-Cl-DCAM, which was found to be 1.5 mg/L in the effluent of a waterworks receiving raw water from Taihu Lake, China. The changes of N-Cl-DCAM formation potential (N-Cl-DCAMFP) in the drinking water treatment process and the removal efficiency of its precursors in each unit were evaluated. Non-polar organics accounted for the majority of N-Cl-DCAM precursors, accounting for 70% of the N-Cl-DCAM FP. The effect of conventional water treatment processes on the removal of N-Cl-DCAM precursors was found to be unsatisfactory due to their poor performance in the removal of low molecular weight (MW) or non-polar organics. In the ozonation integrated with biological activated carbon (O3-BAC) process, the ozonation had little influence on the decrease of N-Cl-DCAM FP. The removal efficiency of precursors by a new BAC filter, in which the granular activated carbon (GAC) had only been used for four months was higher than that achieved by an old BAC filter in which the GAC had been used for two years. The different removal efficiencies of precursors were mainly due to the different adsorption capacities of GAC for individual precursors. Low MW or non-polar organics were predominantly removed by GAC, rather than biodegradation by microorganisms attached to GAC particles.
• RESEARCH ARTICLE
Qiuzhun Chen, Xiang Zhang, Bing Li, Shengli Niu, Gaiju Zhao, Dong Wang, Yue Peng, Junhua Li, Chunmei Lu, John Crittenden
• Activated carbon was proposed to be an efficient accelerant for molded red mud catalyst.
• The surface acidity and reducibility were highly improved, as well as the pore structure.
• The enrichment of the surface Fe2+ and the adsorbed oxygen account for the improvement.
Our previous study proved that the acid-pretreatment process could efficiently activate red mud (RM) for the selective catalytic reduction (SCR) of NOx. However, in terms of the molding process, which is the key step determining whether it can be applied in large-scale industrial, the surface acidity and reducibility of catalyst always decreased dramatically, and part of surface area and pore structure were lost. In this study, we prepared monolithic honeycomb red mud (MHRM) catalysts with activated carbon (AC) as an accelerant and investigated the effect of AC on the MHRM. The results showed that the MHRM with 3 wt.% of AC (MHRM-AC3) exhibited the best SCR performance, and kept more than 80% NOx conversion in the range of 325°C–400°C. Compared with the MHRM, MHRM-AC1, and HMRM-AC5, the MHRM-AC3 has more mesoporous and macroporous structures, which can provide more adsorption active sites. The AC significantly improved NH3 adsorption and surface reducibility, which was mainly due to the increase of the surface acid sites (especially the Brönsted acid sites), the concentration of Fe(II), and the surface adsorbed oxygen. The presence of more Fe(II) enriched the surface oxygen vacancies, as well as the surface adsorbed oxygen, due to the charge imbalance and unsaturated chemical bond. And surface adsorbed oxygen exhibited more active than lattice oxygen owing to its higher mobility, which was conducive to NOx reduction in the SCR reaction.
• RESEARCH ARTICLE
Ruijie Li, Mengmeng Zhou, Shilong He, Tingting Pan, Jing Liu, Jiabao Zhu
• UASB reactor can work efficiently with high COD/SO42- ratios when SDBS exists.
• Outcome of the competition between SRB and MPA was affected by SDBS.
• Presence of SDBS makes methanogens with H2/CO2 as a substrate dominant.
• Microbial diversity decreases in the presence of SDBS.
In this study, the effects of organic sulfur on anaerobic biological processes were investigated by operating two up-flow anaerobic sludge blanket (UASB) reactors with sodium dodecylbenzene sulfonate (SDBS) as a representative of organic sulfur. The results indicated that the specific methanogenic activity (SMA) and chemical oxygen demand (COD) removal efficiency of R2 (with SDBS added) were higher than those of R1 (without SDBS) when the COD/SO42 ratio was above 5.0. However, when the COD/SO42 ratio was lower than 5.0, the sulfate reduction efficiency of R2 was higher than that of R1. These results and the observed SDBS transformation efficiency in anaerobic reactors indicate that low concentrations of SDBS accelerate methane production and the continuous accumulation of SDBS does not weaken the reduction of sulfate. Similarly, the calculated electron flux for a COD/SO42 ratio of 1.0 indicates that the utilization intensity of electrons by sulfate-reducing bacteria (SRB) in R2 was 36.48% higher than that of SRB in R1 and exceeded that of methane-producing archaea (MPA) under identical working conditions. Moreover, the addition of SDBS in R2 made sulfidogenesis the dominant reaction at low COD/SO42, and Methanobacterium and Methanobrevibacter with H2/CO2 as the substrate and Desulfomicrobium were the dominant MPA and SRB, respectively. However, methanogenesis was still the dominant reaction in R1, and Methanosaeta with acetic acid as the substrate and Desulfovibrio were the dominant MPA and SRB, respectively.
• RESEARCH ARTICLE
Byungjin Lee, Eun Seo Jo, Dong-Wha Park, Jinsub Choi
• Submerged arc plasma was introduced in terms of wastewater treatment.
• Ozone oxidation was coupled with submerged arc plasma system.
• Ozone was converted into O and O2 by submerged arc plasma.
• Decomposition rate was accelerated by submerged arc plasma.
• Introduction of ozone led to significant increase in mineralization.
Submerged arc plasma technology was assessed for the removal of phenols from wastewater. The OH radicals generated from the boundary between the plasma and waste solution were considered as a significant factor on the degradation reaction. In this study, the effects of highly energetic electrons released from the submerged arc plasma were mainly studied. The highly energetic electrons directly broke the strong chemical bond and locally increased the reaction temperatures in solution. The effects of the submerged-arc plasma on the decomposition of phenol are discussed in terms of the input energy and initial concentration. The single use of submerged arc plasma easily decomposed the phenol but did not increase the mineralization efficiency. Therefore, the submerged arc plasma, coupled with the ozone injection, was investigated. The submerged arc plasma combined with ozone injection had a synergic effect, which led to significant improvements in mineralization with only a small increase in input energy. The decomposition mechanism of phenol by the submerged arc plasma with the ozone was analyzed.
• RESEARCH ARTICLE
Liu Cao, Lu Yang, Clifford S. Swanson, Shuai Li, Qiang He
• Exposure to indoor microbiomes is a public health concern in educational facilities.
• Indoor microbiomes were characterized in two multifunctional university buildings.
• Human occupancy had significant impact on the composition of indoor microbiomes.
• The skin microbiota of occupants represented important sources of indoor microbiomes.
Educational facilities serve as community hubs and consequently hotspots for exposure to pathogenic microorganisms. Therefore, it is of critical importance to understand processes shaping the indoor microbiomes in educational facilities to protect public health by reducing potential exposure risks of students and the broader community. In this study, the indoor surface bacterial microbiomes were characterized in two multifunctional university buildings with contrasting levels of human occupancy, of which one was recently constructed with minimal human occupancy while the other had been in full operation for six years. Higher levels of human occupancy in the older building were shown to result in greater microbial abundance in the indoor environment and greater proportion of the indoor surface bacterial microbiomes contributed from human-associated microbiota, particularly the skin microbiota. It was further revealed that human-associated microbiota had greater influence on the indoor surface bacterial microbiomes in areas of high occupancy than areas of low occupancy. Consistent with minimal impact from human occupancy in a new construction, the indoor microbiomes in the new building exhibited significantly lower influence from human-associated microbiota than in the older building, with microbial taxa originating from soil and plants representing the dominant constituents of the indoor surface bacterial microbiomes. In contrast, microbial taxa in the older building with extensive human occupancy were represented by constituents of the human microbiota, likely from occupants. These findings provide insights into processes shaping the indoor microbiomes which will aid the development of effective strategies to control microbial exposure risks of occupants in educational facilities.
• RESEARCH ARTICLE
Yueqi Jiang, Jia Xing, Shuxiao Wang, Xing Chang, Shuchang Liu, Aijun Shi, Baoxian Liu, Shovan Kumar Sahu
• PM2.5-related deaths were estimated to be 227 thousand in BTH & surrounding regions.
• Local emissions contribute more to PM2.5-related deaths than PM2.5 concentration.
• Local controls are underestimated if only considering its impacts on concentrations.
• Rural residents suffer larger impacts of regional transport than urban residents.
• Reducing regional transport benefits in mitigating environmental inequality.
The source-receptor matrix of PM2.5 concentration from local and regional sources in the Beijing-Tianjin-Hebei (BTH) and surrounding provinces has been created in previous studies. However, because the spatial distribution of concentration does not necessarily match with that of the population, such concentration-based source-receptor matrix may not fully reflect the importance of pollutant control effectiveness in reducing the PM2.5-related health impacts. To demonstrate that, we study the source-receptor matrix of the PM2.5-related deaths instead, with inclusion of the spatial correlations between the concentrations and the population. The advanced source apportionment numerical model combined with the integrated exposure–response functions is used for BTH and surrounding regions in 2017. We observed that the relative contribution to PM2.5-related deaths of local emissions was 0.75% to 20.77% larger than that of PM2.5 concentrations. Such results address the importance of local emissions control for reducing health impacts of PM2.5 particularly for local residents. Contribution of regional transport to PM2.5-related deaths in rural area was 22% larger than that in urban area due to the spatial pattern of regional transport which was more related to the rural population. This resulted in an environmental inequality in the sense that people staying in rural area with access to less educational resources are subjected to higher impacts from regional transport as compared with their more resourceful and knowledgeable urban compatriots. An unexpected benefit from the multi-regional joint controls is suggested for its effectiveness in reducing the regional transport of PM2.5 pollution thus mitigating the associated environmental inequality.
• RESEARCH ARTICLE
Tianyi Li, Chengwu Zhang, Jingyi Zhang, Song Yan, Chuanyu Qin
• Nano CaO2 is evaluated as a remediation agent for 2,4-DCP contaminated groundwater.
• 2,4-DCP degradation mechanism by different Fe2+ concentration was proposed.
• 2,4-DCP was not degraded in the system for solution pH>10.
• The 2,4-DCP degradation area is inconsistent with the nano CaO2 distribution area.
This study evaluates the applicability of nano-sized calcium peroxide (CaO2) as a source of H2O2 to remediate 2,4-dichlorophenol (2,4-DCP) contaminated groundwater via the advanced oxidation process (AOP). First, the effect and mechanism of 2,4-DCP degradation by CaO2 at different Fe concentrations were studied (Fenton reaction). We found that at high Fe concentrations, 2,4-DCP almost completely degrades via primarily the oxidation of •OH within 5 h. At low Fe concentrations, the degradation rate of 2,4-DCP decreased rapidly. The main mechanism was the combined action of •OH and O2•−. Without Fe, the 2,4-DCP degradation reached 13.6% in 213 h, primarily via the heterogeneous reaction on the surface of CaO2. Besides, 2,4-DCP degradation was significantly affected by solution pH. When the solution pH was>10, the degradation was almost completely inhibited. Thus, we adopted a two-dimensional water tank experiment to study the remediation efficiency CaO2 on the water sample. We noticed that the degradation took place mainly in regions of pH<10 (i.e., CaO2 distribution area), both upstream and downstream of the tank. After 28 days of treatment, the average 2,4-DCP degradation level was ≈36.5%. Given the inadequacy of the results, we recommend that groundwater remediation using nano CaO2: (1) a buffer solution should be added to retard the rapid increase in pH, and (2) the nano CaO2 should be injected copiously in batches to reduce CaO2 deposition.
• RESEARCH ARTICLE
Kehui Liu, Jie Xu, Chenglong Dai, Chunming Li, Yi Li, Jiangming Ma, Fangming Yu
• The OA supply significantly increased the water-extractable Mn in all soils.
• All OA supply levels promoted plant growth in unexplored soil.
• Low OA supply level promoted plant growth in explored and tailing soils.
• OA amendment increased the Mn concentrations and total Mn in P. pubescens.
P. pubescens experienced less Mn stress in unexplored soil than in the other two soils.
The current study evaluated the effects of oxalic acid (OA) application on the growth and Mn phytoremediation efficiency of Polygonum pubescens Blume cultivated in three different manganese (Mn)-contaminated soils sampled from an unexplored area (US), an explored area (ES) and a tailing area (TS) of the Ertang Mn mine, South China. The supplied levels of OA were 0 (control), 1 (low level), 3 (medium level), and 9 (high level) mmol/kg, referred to as CK, OA1, OA3 and OA9, respectively. The results revealed that the average water-extractable Mn concentrations US, ES and TS amended with OA increased by 214.13, 363.77 and 266.85%, respectively. All OA supply levels increased plant growth and Mn concentrations in US. The low OA supply level increased plant growth in ES and TS; however, contrasting results were found for the medium and high OA supply levels. Plant Mn concentrations and total Mn increased in ES and TS in response to all OA supply levels. Total Mn in the aerial parts increased by 81.18, 44.17 and 83.17% in US, ES and TS, respectively; the corresponding percentages for the whole plants were 81.53, 108.98 and 77.91%, respectively. The rate of ·O2 production and malondialdehyde (MDA) concentrations increased in response to OA amendment, especially the medium and high OA supply levels in ES and TS. In general, antioxidant enzymes might play a vital role in alleviating Mn stress in plants cultivated in US, while non-enzymatic antioxidants might be the main factor for plants cultivated in ES and TS.
• RESEARCH ARTICLE
Xinzheng Li, Zhiming Li, Zhihui Xing, Zhimin Song, Bei Ye, Zhengming Wang, Qianyuan Wu
• UV-LED with shorter wavelength was beneficial for photocatalytic degradation.
• SRNOM dramatically inhibit the degradation.
• Degradation mainly undergoes oxidation, hydrolysis and chain growth reactions.
In this work, LED-based photocatalysis using mixed rutile and anatase phase TiO2 (P25) as the photocatalyst could effectively remove 5-chloro-2-methyl-4-isothiazolin-3-one (CMIT) and methylisothiazolone (MIT) simultaneously, with removal efficiencies above 80% within 20 min. The photocatalytic degradation of both CMIT and MIT could be modeled using a pseudo-first-order rate equation. The photocatalytic degradation rates of CMIT and MIT under LED280 illumination were higher than under LED310 or LED360 illumination. At concentrations below 100 mg/L, the degradation rate of CMIT and MIT under LED illumination significantly increased with increasing catalyst dosage. Additionally, the effects of the chloride ion concentration, alkalinity and dissolved organic matter on the photocatalytic degradation reaction were also investigated. The ·OH free radicals were determined to play the primary role in the photocatalytic degradation reaction, with a degradation contribution of >95%. The photocatalytic degradation of CMIT and MIT mainly occurred via oxidation, hydrolysis, and chain growth reactions. Finally, the possible photocatalytic degradation pathways of CMIT and MIT over LED/P25 are proposed.
• REVIEW ARTICLE
Mengzhi Ji, Zichen Liu, Kaili Sun, Zhongfang Li, Xiangyu Fan, Qiang Li
•Phages can be better indicators of enteric viruses than fecal indicator bacteria.
•Multiple phages should be added to the microbial source tracking toolbox.
•Engineered phage or phage cocktail can effectively target resistant bacteria.
•In phage use, phage-mediated horizontal gene transfer cannot be ignored.
•More schemes are needed to prevent phage concentration from decreasing.
Wastewater is a breeding ground for many pathogens, which may pose a threat to human health through various water transmission pathways. Therefore, a simple and effective method is urgently required to monitor and treat wastewater. As bacterial viruses, bacteriophages (phages) are the most widely distributed and abundant organisms in the biosphere. Owing to their capacity to specifically infect bacterial hosts, they have recently been used as novel tools in water pollution control. The purpose of this review is to summarize and evaluate the roles of phages in monitoring pathogens, tracking pollution sources, treating pathogenic bacteria, infecting bloom-forming cyanobacteria, and controlling bulking sludge and biofilm pollution in wastewater treatment systems. We also discuss the limitations of phage usage in water pollution control, including phage-mediated horizontal gene transfer, the evolution of bacterial resistance, and phage concentration decrease. This review provides an integrated outlook on the use of phages in water pollution control.
• RESEARCH ARTICLE
Junlian Qiao, Yang Liu, Hongyi Yang, Xiaohong Guan, Yuankui Sun
• Sulfidation significantly enhanced As(V) immobilization in soil by zerovalent iron.
• S-ZVI promoted the conversion of exchangeable As to less mobile Fe-Mn bound As.
• Column test further confirmed the feasibility of sulfidated ZVI on As retention.
• S-ZVI amendment and magnetic separation markedly reduced TCLP leachability of As.
In this study, the influences of sulfidation on zero-valent iron (ZVI) performance toward As(V) immobilization in soil were systemically investigated. It was found that, compared to unamended ZVI, sulfidated ZVI (S-ZVI) is more favorable to immobilize As(V) in soil and promote the conversion of water soluble As to less mobile Fe-Mn bound As. Specifically, under the optimal S/Fe molar ratio of 0.05, almost all of the leached As could be sequestrated by>0.5 wt.% S-ZVI within 3 h. Although the presence of HA could decrease the desorption of As from soil, HA inhibited the reactivity of S-ZVI to a greater extent. Column experiments further proved the feasibility of applying S-ZVI on soil As(V) immobilization. More importantly, to achieve a good As retention performance, S-ZVI should be fully mixed with soil or located on the downstream side of As migration. The test simulating the flooding conditions in rice culture revealed there was also a good long-term stability of soil As(V) after S-ZVI remediation, where only 0.7% of As was desorbed after 30 days of incubation. Magnetic separation was employed to separate the immobilized As(V) from soil after S-ZVI amendment, where the separation efficiency was found to be dependent of the iron dosage, liquid to soil ratio, and reaction time. Toxicity characteristic leaching procedure (TCLP) tests revealed that the leachability of As from soil was significantly reduced after the S-ZVI amendment and magnetic separation treatment. All these findings provided some insights into the remediation of As(V)-polluted soil by ZVI.
• RESEARCH ARTICLE
Aifang Gao, Junyi Wang, Jianfei Luo, Aiguo Li, Kaiyu Chen, Pengfei Wang, Yiyi Wang, Jingyi Li, Jianlin Hu, Hongliang Zhang
•Annual mean PM2.5 in Shijiazhuang were 87, 95, and 82 µg/m3 in 2015–2017.
•Health risk of cardiovascular system was higher than respiratory system.
•Premature mortality attributed to PM2.5 was 5088 people in 2017.
•ΔMort and YLL reduced by 84.2% and 84.6% when PM2.5 reduced to 10 µg/m3.
•Health risks due to PM2.5 were severe in Shijiazhuang in 2015–2017.
Shijiazhuang is one of the cities in the North China Plain. In recent decades, this city has experienced high levels of fine particulate matter (PM2.5), which have potentially significant effects on human health. In this study, the health effects of PM2.5 exposure in Shijiazhuang were estimated by applying an integrated exposure-response model. Premature mortality, years of life lost (YLL), and the mortality benefits linked to reduced levels of PM2.5 were quantified for the period 2015–2017. In 2015, 2016, and 2017, cerebrovascular diseases caused the highest premature mortality (2432, 2449, and 2483, respectively), followed by ischemic heart diseases (1391, 1479, and 1493, respectively), lung cancer (639,660, and 639, respectively), and chronic obstructive pulmonary diseases (533, 519, and 473, respectively). Notably, the total number of premature deaths caused by PM2.5 exposure in Shijiazhuang in 2015, 2016, and 2017 were 4994, 5107, and 5088, respectively. Moreover, the YLL in the same years were 47001, 47880 and 47381, respectively. Interestingly, the YLL per 1000 females was lower than that per 1000 males. Finally, we noted that premature mortality and YLL decreased by 84.2% and 84.6% when the PM2.5 levels diminished to 10 µg/m3. Overall, the results of this study improve our understanding of how high PM2.5 concentrations affect human health and suggest the application of more stringent measures in Shijiazhuang to alleviate the associated health risks.
• RESEARCH ARTICLE
Zeshen Tian, Bo Wang, Yuyang Li, Bo Shen, Fengjuan Li, Xianghua Wen
• AOA’s ammonia oxidizing capacity was enhanced under moderate magnetic field.
• AOA possessed a certain magnetotaxis under uneven magnetic field.
• Enhanced ammonia oxidizing capacity was lost once magnetic field was removed.
Ammonia-oxidizing archaeon (AOA) could play important roles for nitrogen removal in the bioreactors under conditions such as low pH and low dissolved oxygen. Therefore, enhancing ammonia oxidation capability of AOA has great significance for water and wastewater treatment, especially under conditions like low dissolved oxygen concentration. Utilizing a novel AOA strain SAT1, which was enriched from a wastewater treatment plant by our group, the effect of magnetic field on AOA’s ammonia oxidation capability, its magnetotaxis and heredity were investigated in this study. Compared with control experiment, AOA’s maximum nitrite-N formation rate during the cultivation increased by 56.8% (0.65 mgN/(L·d)) with 20 mT magnetic field. Also, it was testified that AOA possessed a certain magnetotaxis. However, results manifested that the enhancement of AOA’s ammonia oxidation capability was not heritable, that is, lost once the magnetic field was removed. Additionally, the possible mechanism of improving AOA’s ammonia oxidation capability by magnetic field was owing to the promotion of AOA single cells’ growth and fission, rather than the enhancement of their ammonia oxidation rates. The results shed light on the application of AOA and methods to enhance AOA’s ammonia oxidation capability, especially in wastewater treatment processes under certain conditions.
• REVIEW ARTICLE
Shuchang Wang, Binbin Shao, Junlian Qiao, Xiaohong Guan
• The properties of Fe(VI) were summarized.
• Both the superiorities and the limitations of Fe(VI) technologies were discussed.
• Methods to improve contaminants oxidation/disinfection by Fe(VI) were introduced.
• Future research needs for the development of Fe(VI) technologies were proposed.
The past two decades have witnessed the rapid development and wide application of Fe(VI) in the field of water de-contamination because of its environmentally benign character. Fe(VI) has been mainly applied as a highly efficient oxidant/disinfectant for the selective elimination of contaminants. The in situ generated iron(III) (hydr)oxides with the function of adsorption/coagulation can further increase the removal of contaminants by Fe(VI) in some cases. Because of the limitations of Fe(VI) per se, various modified methods have been developed to improve the performance of Fe(VI) oxidation technology. Based on the published literature, this paper summarized the current views on the intrinsic properties of Fe(VI) with the emphasis on the self-decay mechanism of Fe(VI). The applications of Fe(VI) as a sole oxidant for decomposing organic contaminants rich in electron-donating moieties, as a bi-functional reagent (both oxidant and coagulant) for eliminating some special contaminants, and as a disinfectant for inactivating microorganisms were systematically summarized. Moreover, the difficulties in synthesizing and preserving Fe(VI), which limits the large-scale application of Fe(VI), and the potential formation of toxic byproducts during Fe(VI) application were presented. This paper also systematically reviewed the important nodes in developing methods to improve the performance of Fe(VI) as oxidant or disinfectant in the past two decades, and proposed the future research needs for the development of Fe(VI) technologies.
|
2021-10-20 10:27:37
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 6, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.46318185329437256, "perplexity": 11128.231026607013}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585305.53/warc/CC-MAIN-20211020090145-20211020120145-00172.warc.gz"}
|
http://ia.cr/cryptodb/data/paper.php?pubkey=30143
|
## CryptoDB
### Paper: From Physical to Stochastic Modeling of a TERO-Based TRNG
Authors: Florent Bernard Patrick Haddad Viktor Fischer Jean Nicolai DOI: 10.1007/s00145-018-9291-2 Search ePrint Search Google Security in random number generation for cryptography is closely related to the entropy rate at the generator output. This rate has to be evaluated using an appropriate stochastic model. The stochastic model proposed in this paper is dedicated to the transition effect ring oscillator (TERO)-based true random number generator (TRNG) proposed by Varchola and Drutarovsky (in: Cryptographic hardware and embedded systems (CHES), 2010, Springer, 2010 ). The advantage and originality of this model are that it is derived from a physical model based on a detailed study and on the precise electrical description of the noisy physical phenomena that contribute to the generation of random numbers. We compare the proposed electrical description with data generated in two different technologies: TERO TRNG implementations in 40 and 28 nm CMOS ASICs. Our experimental results are in very good agreement with those obtained with both the physical model of TERO’s noisy behavior and the stochastic model of the TERO TRNG, which we also confirmed using the AIS 31 test suites.
##### BibTeX
@article{jofc-2019-30143,
title={From Physical to Stochastic Modeling of a TERO-Based TRNG},
journal={Journal of Cryptology},
publisher={Springer},
volume={32},
pages={435-458},
doi={10.1007/s00145-018-9291-2},
|
2022-06-30 03:40:44
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3829575181007385, "perplexity": 1586.4212175226105}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103661137.41/warc/CC-MAIN-20220630031950-20220630061950-00209.warc.gz"}
|
https://www.zbmath.org/?q=ci%3A0644.51006
|
zbMATH — the first resource for mathematics
On the largest caps contained in the Klein quadric of $$PG(5,q)$$, $$q$$ odd. (English) Zbl 0947.51009
Let $$\mathcal H$$ be the Klein quadric of order $$q$$, i.e. the hyperbolic quadric in the projective space $$\text{PG}(5,q)$$. A $$k$$-cap $$K$$ in $$\mathcal H$$ is a set of $$k$$ points no three of which are collinear. If $$q$$ is odd, then a $$k$$-cap $$K$$ in $$\mathcal H$$ exists only if $$k\leq q^3+q^2+q+1$$, and in case of equality $$K$$ intersects each plane of $$\mathcal H$$ in a conic. Three examples of such caps are known [D. G. Glynn, Geom. Dedicata 26, No. 3, 273-280 (1988; Zbl 0645.51012), A. A. Bruen and J. W. P. Hirschfeld, Eur. J. Comb. 9, No. 3, 255-270 (1988; Zbl 0644.51006)].
The author proves that any $$(q^3+q^2+q+1)$$-cap in the Klein quadric $$\mathcal H$$, where $$q>3138$$ is odd, is the intersection of the Klein quadric with another quadric. Furthermore, he gives restrictions on the type of this quadric. So, he gets close to a classification of caps of maximum size of the Klein quadric.
MSC:
51E22 Linear codes and caps in Galois spaces 05B25 Combinatorial aspects of finite geometries
Full Text:
References:
[1] Bruen, A.A.; Hirschfeld, J.W.P., Intersections in projective space, II. pencils of quadric surfaces, Europ. J. combin., 9, 255-271, (1988) · Zbl 0644.51006 [2] Ebert, G.L.; Metsch, K.; Szőnyi, T., Caps embedded in Grassmannian surfaces, Geom. dedicata, 70, 181-196, (1998) · Zbl 0911.51013 [3] Edel, Y.; Bierbrauer, J., 41 is the largest size of a cap in PG(4, 4), Des. codes cryptogr., 16, 151-160, (1999) · Zbl 0935.51008 [4] Glynn, D.G., On a set of lines of PG(3, q) corresponding to a maximal cap contained in the Klein quadric in PG(5, q), Geom. dedicata, 26, 273-280, (1988) · Zbl 0645.51012 [5] Hirschfeld, J.W.P., Projective geometries over finite fields, (1979), Oxford Univ. Press Oxford · Zbl 0418.51002 [6] Hirschfeld, J.W.P., Finite projective spaces of three dimensions, (1985), Oxford Univ. Press Oxford · Zbl 0574.51001 [7] Hirschfeld, J.W.P., Projective geometries over finite fields, (1998), Oxford Univ. Press Oxford · Zbl 0899.51002 [8] Hirschfeld, J.W.P.; Storme, L., The packing problem in statistics, coding theory, and finite projective spaces, J. statist. plann. infer., 72, 355-380, (1998) · Zbl 0958.51013 [9] Hirschfeld, J.W.P.; Thas, J.A., General Galois geometries, (1991), Oxford Univ. Press Oxford · Zbl 0789.51001 [10] Segre, B., Sulle ovali nei piani lineari finiti, Atti accad. naz. lincei rend., 17, 1-2, (1954) · Zbl 0057.36301 [11] Segre, B., Ovals in a finite projective plane, Canad. J. math., 7, 414-416, (1955) · Zbl 0065.13402 [12] Semple, J.G.; Roth, L., Introduction to algebraic geometry, (1985), Clarendon Oxford · Zbl 0576.14001 [13] Storme, L.; Szőnyi, T., Intersection of arcs and normal rational curves in spaces of odd characteristic, (), 359-378 · Zbl 0794.51007
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.
|
2021-09-17 08:25:37
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7162184119224548, "perplexity": 3036.559729847102}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780055601.25/warc/CC-MAIN-20210917055515-20210917085515-00150.warc.gz"}
|
http://crypto.stackexchange.com/tags/semantic-security/new
|
# Tag Info
For perfect secrecy: $$number\_ of\_keys >= number\_of\_cipher >= number\_of\_plaintext$$ According to Shannon's perfect secrecy theorem: let, $$number\_ of\_keys = number\_of\_cipher = number\_of\_plaintext$$ then we have perfect secrecy if and only if: each key is used with same probability, and for each (plain,cipher) pair there is unique ...
|
2014-03-09 00:32:02
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.25694793462753296, "perplexity": 1568.5711139537455}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-10/segments/1393999668865/warc/CC-MAIN-20140305060748-00019-ip-10-183-142-35.ec2.internal.warc.gz"}
|
https://which.wiki/tutorial/which-fraction-is-bigger-calculator-28467/
|
## How can you tell which fraction is bigger?
If the denominators are the same, then the fraction with the greater numerator is the greater fraction. The fraction with the lesser numerator is the lesser fraction. And, as noted above, if the numerators are equal, the fractions are equivalent. Use < or > to compare the two fractions and .
## What fraction is bigger 1/4 or 1 3?
Now that these fractions have been converted to decimal format, we can compare the numbers to get our answer. 0.3333 is greater than 0.25 which also means that 1/3 is greater than 1/4.
## Which is bigger ½ or ¼?
The fraction 1/4 is less than 1/2 . This might seem strange since the number 4 is larger than the number 2.
## What fraction is bigger 1/4 or 3 4?
As you saw, if two or more fractions have the same denominator, you can compare them by looking at their numerators. As you can see below, 3/4 is larger than 1/4. The larger the numerator, the larger the fraction.
## Which fraction is bigger 1/3 or 5?
And you can see very clearly that 1/3 covers more of the whole, it’s a larger fraction of the whole than 1/5 is. So 1/3 is greater than 1/5. … And that is generally true, that the larger the denominator, the smaller the fraction is going to be.
## How do you determine which fraction is greater or smaller?
As long as the denominators are the same, the fraction with the greater numerator is the greater fraction, as it contains more parts of the whole. The fraction with the lesser numerator is the lesser fraction as it contains fewer parts of the whole.
## What fraction is greater than fourth?
1 8 < 1 4 Fourths are larger than eighths, so one fourth is greater than one eighth. 1 3 > 1 4 Thirds are larger than fourths, so one third is greater than one fourth. 4. Verbally ask your child to compare the following pairs of fractions mentally and explain his or her answers.
## Is 3/4 bigger or smaller than 5 6?
Converting to Decimal
Now that these fractions have been converted to decimal format, we can compare the numbers to get our answer. 0.75 is NOT greater than 0.8333 which also means that 3/4 is NOT greater than 5/6.
## What is the answer when 2 1 5?
So the answer is that 2 1/5 as a decimal is 2.2.
We convert it to an improper fraction which, in this case, is 11/5 and then we divide the new numerator (11) by the denominator to get our answer.
## How do you compare fractions?
How to Compare Fractions
1. If you have mixed numbers convert them to improper fractions.
2. Find the lowest common denominator (LCD) for the fractions.
3. Convert each fraction into its equivalent with the LCD in the denominator.
4. Compare fractions: If denominators are the same you can compare the numerators.
## Is a half smaller than 3 4?
Which Fraction is Bigger Calculator. Answer: Yes, 3/4 is bigger than 1/2. You can confirm this by converting both fractions to decimals. The decimal 0.75 is bigger than 0.5, so 3/4 is bigger than 1/2.
## What fraction is bigger than 1 3?
As such, 1/2 is always greater than 1/3 regardless of the context.
## When the numerator is the same the bigger fraction is?
In the fractions having the same numerator, that fraction is greater which has the smaller denominator. If there are three or more fractions having the same numerator, they may be arranged in ascending (increasing) and descending (decreasing) order. The order will be in opposite order of denominators.
## Which fraction is bigger using LCM?
As the common denominator, choose the LCM of the original denominators. Then the larger the numerator, the larger the fraction.
## What fractions are bigger than 1?
An improper fraction is always 1 or greater than 1.
## When the denominator gets larger the fraction gets smaller?
As the denominator gets larger, the fraction gets smaller. To compare fractions with like numerators, look at the denominators. The fraction with the smaller denominator is the larger fraction. Let’s look at some examples.
## How do you compare fractions with the same numerator?
So to compare fractions with the same numerator, all you have to do is compare the denominators. The fraction with the bigger denominator is smaller.
## Which fraction is bigger than 2 3?
Since 34 is greater than 23, you will select the > symbol. See the program RENAME IN HIGHER TERMS for more information on renaming fractions. One way to find the LCD is to see if the smaller denominator 3 will divide evenly into the larger denominator 4. If not, multiply the larger denominator 4 by 2 to get 8.
|
2023-03-31 00:32:29
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8109763264656067, "perplexity": 570.8779696405973}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296949506.62/warc/CC-MAIN-20230330225648-20230331015648-00461.warc.gz"}
|
https://www.analyzemath.com/calculus/Integrals/integral-of-ln(x).html
|
# Integral of Natural Logarithm : ln x
The steps to calculate the integral of the natural logarithm function : $\displaystyle \int \ln x \; dx$ are presented.
We first rewrite the given intergral as
$\displaystyle \int \ln x \; dx = \int 1 \cdot \ln x \; dx$
Let $u = x$ and $v = \ln x$ whose first derivatives are given by $u' = 1$ and $v' = \dfrac{1}{x}$
Our integral is of the form
$\displaystyle \int \ln x \; dx = \int u' \cdot v \; dx$
Use the integration by parts to write
$\displaystyle \int \ln x \; dx = u v - \int u \cdot v' \; dx$
Substitute $u, v$ and $v'$ to obtain
$\displaystyle = x \ln x - \int x \dfrac {1}{x} \; dx$
Simplify the term on the right
$\displaystyle = x \ln x - \int dx$
and evaluate the integral
$= x \ln x - x + c$
where $c$ is the constant of integration.
Hence
$\displaystyle \int \ln x \; dx = x \ln x - x + c$
|
2023-03-28 23:44:54
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9703804850578308, "perplexity": 365.01820953548633}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296948900.50/warc/CC-MAIN-20230328232645-20230329022645-00565.warc.gz"}
|
http://rationalwiki.org/wiki/Homeopathy
|
# Homeopathy
Against allopathy Alternative articles v - t - e
“”...and if anyone can show me one example in the history of the world of a single homeopathic practitioner who's been able to prove under reasonable experimental conditions that solutions made up of infinitely tiny particles of good stuff dissolved repeatedly into relatively huge quantities of water have a consistently higher medicinal value than a similarly administered placebo...I will give you my piano, one of my legs and my wife. —Tim Minchin, If You Open Your Mind Too Much, Your Brain Will Fall Out
Homeopathy is a type of alternative medicine based on two ideas: that "like cures like" (similia similibus curentur),[1] meaning that a substance that causes disease symptoms can also cure those same symptoms; and that dilution increases potency.[2] Both ideas are not only the opposite of what medicine usually observes, but the opposite of common sense, too. While other alternative medicines and practices (at least purport to) date back thousands of years, homeopathy was invented in the late 18th century by a German physician, Samuel Hahnemann.
Homeopathy is fundamentally different from herbal medicine, with which it is often confused. While some "homeopathic" medicines are simply herbal supplements labelled as homeopathic, true homeopathic remedies are so greatly diluted that they contain no active ingredients. The only measurable ingredients are water[3] and/or alcohol,[4] which is used to "preserve the medicinal power for a long period of time during storage".[5]
The scientific and medical consensus, based on numerous studies and meta-studies, is that homeopathy has no effect above that of a placebo. Aspects of homeopathic practice such as elaborate "provings" and one-on-one consultations can raise a patient's expectations and thus position homeopathy to be an especially convincing placebo — but still a placebo. The theories behind its purported efficacy beyond a placebo would, if true, overturn most of modern chemistry, physics and biology.
## Principles and history
“”If homeopathy is real, then dumping Osama bin Laden’s corpse in the ocean has just cured the world of terrorism. —Shiloh Madsen
Samuel Hahnemann, founder of homeopathy, purveyor of what eventually turned out to be completely wrong.
The term "homeopathy" was coined by a German physician named Christian Friedrich Samuel Hahnemann in the 18th century. He based his ideas on the "Principle of Similars", the concept that "like cures like". His reasoning was simple: if, in large doses, a substance creates symptoms, then in a lower concentration it will remove those symptoms. Hahnemann's homeopathic theory held that the more diluted a solution of such a substance is, the more effective it is at removing the symptoms it would otherwise cause. Since many of the original homeopathic compounds were based on potent toxins, this is fortunate.
"Like cures like" has no scientific basis and should not be confused with concepts of modern immunology. For instance, vaccination causes production of antibodies against the specific infectious agent, which is introduced in a less potent or disabled form and in a measurable concentration. Vaccines require an enormous amount of testing to prove efficacy and, most importantly, safety. They involve relatively large numbers of molecules or infectious agents and have a proven mechanism of action — namely, a small exposure generates a clone of memory lymphocytes that will be available to fight a real infection later. The mechanics of how vaccines work is well understood, observable, and scientifically testable. There is no similar evidence or even plausible hypothesis for "like cures like."
Homeopathy originated before medicine established germ theory, and before it had even dispatched the idea of humors. Hahnemann's patients fared better than those of his contemporaries because the pre-scientific treatments of that era carried incredible risk to patients, often more so than the diseases they were meant to treat. Thus his inert "remedies" reduced patients' risks to those of the disease itself, rather than adding even more risks from the primitive treatments of his day.
## Dilution and water memory
To demonstrate orders of magnitude, the area of the largest square in this diagram is only 5 orders greater than that of a single pixel. A square that was $10^6$ larger would be just under the size of the average computer screen. By 1015, it would be 1 square kilometer and by 1020 it would be the surface area of the Earth. 1028 would be a disc the area of the Earth's orbit...[6] So imagine that one pixel on an image the size of the Milky Way galaxy and we're talking homeopathic dilution.
### Potentization: dilution of the active ingredient
See the main article on this topic: potentization
Homeopaths prepare their remedies using a ritualized technique of step-wise dilution and shaking, called potentization. First the "active" ingredient is selected, such as belladonna or similar toxic herb, gonorrheal discharge (yes, you read correctly[7][8]), and more recently, even water.[9] The ingredient is then repeatedly diluted, most often in the ratio of 1 part ingredient to 100 parts solvent. The most common solvent is a mix of 40% alcohol and 60% water that is claimed to act as a "preservative", although as the mixtures don't contain anything, it can't really preserve anything.[10] Thus, liquid homeopathic remedies are most commonly about 80-proof grain alcohol, which puts them roughly equivalent to vodka. That happy feeling is not the homeopathic medicine working, it's the alcohol kicking in.
Each step in the dilution process is the equivalent of putting about half a teaspoon in something the size of a soda can, although in practice homeopaths will use something smaller so as not to waste too much of their stuff.[11] The container is then shaken 10 times or whacked against a piece of wood 10 times, a procedure homeopaths call succussion.[12] The finer points of the ritual don't particularly matter. What matters is that potentization isn't just simple, straight-forward dilution but contains the "magical step" of succussion that supposedly distinguishes homeopathic remedies from water. Homeopaths hate it when scientists and other rational people refer to potentization simply as "dilution", so naturally we will continue to call it dilution.
### The ritual
Note: The following will require a decent grasp of mathematics and how to use powers and orders of magnitude. If you're not comfortable with such things, you can skip down to the subsection Conflict with Hahnemann.
Homeopaths consider the succussion step important as it is supposedly the "kinetic energy input" that increases potency. However, this makes little sense as the procedure is extremely variable depending on who is doing it, the size, shape and composition of the container, the object it is struck against, and so on. "Precisely 10 hits" is a strange metric for kinetic energy - you could have the equivalent energy of 5 or 12 or 20 hits just by doing it differently to someone else. The level of energy associated with this sort of shaking or hitting is very low and will not affect the solution at all.[13] At most a shaking process will act to dissolve molecules present in the atmosphere, but unless the preparation is made using water that has been specifically purged of these gases the difference will be marginal. In any event the dissolved gases will return to equilibrium with the overlying air within a few minutes.
Given that the "magic whacking bit" of succussion doesn't have a mechanism to affect the solution, there remains only one obvious reason for the process – as a homeopathic escape hatch. It lets homeopaths pick holes in scientific studies of homeopathy so they can reject any negative conclusions. Was it done exactly 10 times? Was it done at the right angle? Was it in the right shaped jar? Was the guy standing on one leg? Was it done in the mountain air of the Alps while a chorus of naked monks played "Good Vibrations" on the bongos? If not then the test is flawed and magic homeopathy still works - although homeopaths are rarely this picky when it comes to positive results.
Originally this process was done by hand but now it is done by machines. While this makes the "kinetic input" more consistent it doesn't lend any credibility to the idea that "potentization" differs from simple dilution, with or without a bit of shaking.
The ritual of potentization is repeated a particular number of times to create the right level of dilution. Most homeopathic solutions call for this to be done between 30 and 1000 times, with the resulting homeopathic "strength" referred to as 30C to 1000C respectively. ("C" refers to a dilution of 1/100.) This quickly builds up the orders of magnitude and the size of numbers required to think about each level of dilution. After the first phase, the dilution is 1 part in 100 (in scientific notation 1 part in 102). After the second, it is 1 in 100 × 100 (104). After the third it is 1 in 100 × 100 × 100 (106, or 1 million) and so on, with the exponent increasing by two with each step. Thus at the end of a 30C potentization the solution is 1 part active ingredient in 1060 — a long ways from the one part per million that homeopaths claim, but of course the magic of homeopathy allows it to transcend basic arithmetic. Thus, this dilution is actually one part per novendecillion.[14] The more diluted solutions are alleged to be stronger, in stark opposition to everything known about the real world.
Summary: If all the superscript numbers were a bit abstract we can add the zeros back in for demonstration purposes; in the least diluted homoeopathic solutions normally available (30C), the active ingredient is diluted in a ratio of :
1:1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.
Powerful stuff indeed. This is very dilute, and as we shall see, it has interesting consequences for these remedies when prepared in the real world. A 1000C solution's ratio is astronomically larger than even the number above.
### No active ingredient
A finite quantity of solute cannot be infinitely divided. This is because molecules themselves cannot be divided — once we dilute to the last few molecules of solute, further dilution gives a decreasing likelihood that the resulting solution will contain even one molecule of the solute.
We can think of "1 part product to X parts water" as "1 molecule of product to X molecules of water". We can figure out the number of molecules using Avogadro's number (6.02 × 1023), which is the number of molecules contained in a mass in grams of the substance equal to its molecular mass. Since water has a molecular mass of 18, this means there are 6.02 × 1023 molecules of water in 18 grams of water. Likewise there are 6.02 × 1023 molecules in 2 grams of hydrogen (H2), 4 grams of helium, and so on. Chemists call this amount of any given substance a mole.
“”It’s a miracle! Take physics and bin it! Water has memory! And while its memory of a long lost drop of onion juice is Infinite It somehow forgets all the poo it’s had in it! —Tim Minchin, Storm[15]
A little arithmetic tells us that even the lowest commonly used homeopathic dilutions do not contain any of the active ingredient. Let's begin with 100 ml of water, to which we add 1 ml of an active ingredient. We shall call it something nice and homeopathy sounding, like "Mandrake's Leaf." For the sake of argument we'll assume this is about 1 gram, which would make a 1% weight/volume mixture. We'll also assume the main chemical in Mandrake's Leaf has a molecular weight similar to a largish organic compound, say 300 grams per mole. Therefore the 100 ml bottle has 1/300 of a mole of Mandrake's Leaf and the corresponding number of molecules is 1/300 of Avogadro's number, or about 2 x 1021.
After the first dilution of ratio of 1 to 100 we will have lost 99% of our fictitious[16] magical herb, leaving 2 x 1019 molecules in the solution. A second dilution of 1 into 100 leaves us with 2 x 1017 molecules, a third with 2 x 1015 molecules, and so on. In short, we decrease the exponent by two for each dilution. This leads to an interesting consequence between the 10th and 11th dilution step - the number of molecules present in the entire solution drops from 20 to 0.2. But there's no such thing as 0.2 of a molecule. So even at these homeopathically "weak" dilutions our 100 ml container has, in technical terms, zilch, zippo, nada Mandrake's Leaf left in it. Hahnemann didn't know this because Dalton, Avogadro, and others had not yet laid the foundations of atomic theory. Modern homeopaths don't have this excuse - and as discussed below, don't deny it and even embrace it.
Calculating the container size necessary for a homeopathic solution to contain just one molecule of active ingredient can be an entertaining and illustrative exercise, and the basic outline is shown in the table below. A 30C dilution is the equivalent of having one molecule present in a sphere of water with a diameter just short of the distance between the Earth and the sun - and higher dilutions become even more difficult to conceptualize. The number of atoms in the observable universe is estimated at approximately 1 × 1080, and the orders of magnitude associated with the most dilute (the supposedly "strongest") homeopathic solutions - when the potentization process is carried out hundreds of times - are much greater than even this massive figure.
X Scale C Scale Ratio of dilution Note
1X 1:10 described as low potency
2X 1C 1:100 called higher potency than 1X by homeopaths
6X 3C 10−6
8X 4C 10−8 allowable concentration of arsenic in U.S. drinking water
12X 6C 10−12
24X 12C 10−24 Has a 60% probability of containing one molecule of original material if one mole of the original substance was used.
60X 30C 10−60 Dilution advocated by Hahnemann for most purposes; patient would need to consume 1041 pills (a billion times the mass of the Earth), or 1034 gallons of liquid remedy (10 billion times the volume of the Earth) to consume a single molecule of the original substance
400X 200C 10−400 Dilution of popular homeopathic flu remedy Oscillococcinum; would need to consume a mass well over 10320 times that of the known universe to get a single molecule of the original substance.
Note: the "X scale" is also called "D scale". 1X = 1D, 2X = 2D, etc.
### Purity of water
ISO 3696 is a standard for laboratory water. The purest grade of water under ISO 3696 is 10 parts per billion impurity - 10 x 10-9. That is equivalent to a homeopathic dilution of 4C. So every remedy beyond 4C prepared with water of this purity would be entirely random. Actually, homeopaths do not use water of that purity; it can't be stored in glass vessels due to leaching of surface impurities and those using it have to wash their glassware in hydrofluoric acid before use, which dissolves the partially oxidised top layer of glass. Homeopaths usually use double distilled water, which is substantially less pure.
### Conflict with Hahnemann
A humorous look at the principle of homeopathic dilution. Attribution, Randall Munroe.
Hahnemann's original theory held that no matter how greatly the active ingredient was diluted it was still present in some amount. Avogadro's work, which was developed after Hahnemann's invention of homeopathy, showed that this claim was false and that - even in some of the lowest dilutions offered - the active ingredient is not present in the final remedy. The recent 10:23 campaign[17] was designed to highlight this aspect - and particularly the public's misunderstanding of it - by organizing a "mass overdose" of homeopathic remedies. In a sane world the lack of any active ingredient and the disproving of Hahnemann's theory would be a serious blow to homeopathy. But modern homeopaths claim this as an advantage because a solution can't possibly be toxic, being just water with nothing dangerous in it.[18]
To get around this rather extreme problem, modern homeopaths invented the idea that water has a "memory". In this claim, the succussion procedure supposedly imparts the "memory" of the chemical placed in it (importantly, only the intended active ingredient) to the water. It is this memory that allegedly cures the patient - be glad sewage processing plants don't do this by accident! If true, this "memory of water" claim would overturn all of modern chemistry as well as most of physics and molecular biology. (And given the history of every drop of water we drink, probably a lot of stomachs too.) A further complication in this "water memory" belief system is the fact that many homeopathic remedies are sold in dry pill or tablet form so there is not even the "memory of water" to vouch for the supposed efficacy of the diluted "medicine".
### Conclusion to the procedure
In short, although the solution has been diluted beyond any possibility of detection, the little magic taps which comprise the "succussion" procedure change all known laws of physics and turn the substance into a "medicine". It's obvious really.
## Problems with the concept
### Principle of Similars
The "Principle of Similars" - even though it can trace its roots back to ancient Greece - is completely made up with no supporting evidence. Basically, Hahnemann just decided that this was the case one day.
It may, however, have been inspired by the observation that a particular malaria cure induced malaria-like symptoms in healthy patients, and other treatments sometimes exhibit this quirk of causing symptoms while curing or providing immunity. Radiation therapy is used to treat cancer caused by radiation (although melanoma, which is commonly caused by radiation, is radio-resistant) and antivenin is derived from venom. Although it should be noted that antivenin is not simply venom, it contains the antibodies produced by the immune response (of other animals) to such venom. Similarly, the original smallpox vaccine involved infecting someone with cowpox; inducing symptoms similar to - but not near as deadly as - smallpox. Despite these very specific and quite interesting observations, there is no theoretical reason or supporting evidence to conclude that this can be expanded to a general rule like the "Principle of Similars". In addition, in all of these examples, the treatments have been subject to rigorous scientific study to determine their safety and effectiveness. Oncologists don't just throw cancer patients into a nuclear reactor and hope for the best.
### Water memory
See the main article on this topic: water memory
Given the level of dilution of homeopathic solutions, there is no plausible scientific explanation for their effectiveness beyond the placebo effect. The idea of "water memory" has been proposed by practitioners, but it is barely even explained what it actually is, let alone demonstrated. There have been a few misinterpretations of scientific papers which study water at the molecular level, however. In this research water dimers and clusters, joined by hydrogen bonds, have been observed but only under certain conditions and certainly don't convey the complexity required to form a "cure" of any kind. When present, active ingredients certainly do cause water to form solvent shells around the molecules; taking into account this property of water and including it in models is a fundamental part of understanding chemical reactions and their rates. Even considering these properties of water and its ability to interact with itself and other compounds, no ability for the water to "remember" what was placed in it has been observed or is considered to be possible. Certainly the known intermolecular forces between molecules of water (van der Waals forces and particularly electrostatic hydrogen bonding) are of such low energy that any apparent "structure" in bulk water would last for mere picoseconds.
If water were to retain a memory of the chemicals it has been exposed to and this memory was able to cause pharmacological effects, then any drinking water would be deadly (or a miracle cure if the Principle of Similars were also correct). It would contain the memories of all the unsavory places that it had passed through——guts, swamps, sewers, and so on. Even assuming that it is the succussion process that imparts memory to the water, at the dilutions that homeopathic remedies work at, any impurities, such as salts which are found in all water, would also have their presence imprinted on the water. Even distilled and deionized water and high purity alcohol used by chemists aren't pure to these parts per nonillion levels.
Examples of naturally occurring water clusters that are used as "evidence" of water memory. In reality, these clusters are highly fluxional and certainly not dependent on what minerals they were associated with in the past, nor are they affected by knocking the bottle against a piece of wood (succussion), therefore water "memory" is not proved by their existence. These clusters represent small molecules of water in the gas phase, which hardly reflects a system of 1023 molecules.
Adam Jacobs, Director of Dianthus Medical Limited in "Rapid response to BMJ" 1999;319:1115-1118 said "The laws of chemistry and physics, as we understand them, say that homoeopathy cannot possibly work any better than a placebo if a treatment has been diluted to the point where none of the original molecules remain." Furthermore, a letter in Nature shows this memory claim to be bogus science[19]
### Further claims
Faced with a massive number of problems with homeopathy being able to act as a medicine in any way, shape or form, homeopaths and alternative medicine fans do have one, very intriguing, fallback explanation. This is a claim that most alternative medicine can rely on in the face of evidence and implausibility of their explanations: that the substance itself is not actually a medicine. The full explanation of this is sometimes dressed up in fancy New Age terminology, often using the conveniently vague concept of "energy" that New Agers are so fond of, or something authoritative in the language of cargo cult science.[20][21] But it essentially comes down to the idea that "homeopathy promotes the body's natural response, helping the body make itself better", an interesting explanation at the very least most. Given the theoretical issues discussed above, and the evidence discussed below, this does seem nothing more than an outright admission that homeopathy is just a placebo.
After all, a placebo is not a medicine—great pains are taken when using a placebo-control treatment during trials to make sure that they are not pharmacologically active—but we still see some effect regardless, almost like magic. However, it is not magic. A placebo works in numerous and very complex ways, and although the saline injection or sugar pill doesn't directly "promote the body's natural response", the sense of well-being, the positive thinking and the patient's attitude to their life associated with receiving a treatment of some kind certainly can, and indeed does. Given the woo explanations, the charisma of alternative medicine poster-boys, the expense of treatment and the personal consultations with practitioners, homeopathy generates very high expectations for its success and thus is set up to be a very effective placebo, but a placebo nonetheless. This idea is not disputed by medical scientists; homeopathy can work better than nothing (at least in some cases) but given the wide variety of things that could potentially work better than nothing, this isn't particularly interesting or notable.
All a scientist or medical doctor wants to know about homeopathy is "is it better than a similarly administered placebo?". This question will be discussed in the next section.
## Evidence
Old homeopathic remedies in their bottles. Naturally, there is probably more of the bottle dissolved in the water than the active ingredient
See the main article on this topic: Evidence for homeopathy
Given the above, we should be very suspicious of homeopathy. The concept does seem to be impossible; a priori and even by its own admission, homeopathic medicine isn't a straightforward medical treatment. However, that does not mean we should totally discount it without investigating it. If a medical treatment works, then it doesn't matter if the theory is not well understood - and many modern medical treatments are approved with rather poor knowledge of how they work.
Initially, homeopathy was very successful in apparently treating illnesses - and this fact is still trotted out quite readily today, a century or so later. In the 18th and 19th centuries, homeopathy was almost miraculous and really did have the figures to prove it. During one of the 19th century's many cholera epidemics, it was observed that the hospital practicing homeopathy in London was having a far, far lower death rate than the more conventional hospitals in the area, a staggering score against the conventional medicine of the time, indeed. This remarkable success of the practice, however, can be retroactively explained by looking at the conventional treatments of the time and what exactly was going on in the other hospitals. As medical trials always compare a new treatment to the "best available" intervention, it's best to turn the question on its head and ask not "why was homeopathy causing fewer deaths?" and ask instead "why was the conventional hospital causing more deaths?".
When homeopathy was first developed, the "best available" conventional medical treatments often involved administering what are now known to be deadly poisons, bloodletting, or many other practices that were often far more dangerous than the illness they were meant to treat. Using our current knowledge of how poor those practices were, it's quite obvious that just administering pure water or sugar and essentially doing nothing may well be the better medical intervention in the case of cholera - many people just get better on their own and recover, but they have much less chance of doing so if they receive a "treatment" that could kill them first. This is still occasionally the case today when the side-effects or risks of a medical intervention, such as risky surgery on or around a vital organ, outweigh the risks of leaving an illness alone. However, medical science has since moved on from opening up veins to balance the humeurs, and now we can compare homeopathy to proven and effective treatments or a simple placebo, which would be water without all the fancy succussion business as described above. With respect to this, homeopathy invariably fails as a treatment.
## Official recognition
### Homeopathy and the Food and Drug Administration
The 1938 Food, Drug, and Cosmetic Act established the rules for FDA regulation of drugs in the United States. Sen. Royal Copeland, a practicing homeopath, wrote in a specific clause that said homeopathy was a drug and would be regulated by the FDA as such, but with many exceptions. Homeopaths do not have to apply for a New Drug Application with the FDA for new solutions nor do they have to provide any information about their efficacy or safety. They do not have to test them at all. They do not even have to display the Quack Miranda warning that dietary supplements do. The only regulation the FDA has over homeopathy is to make sure the manufacturing produces a safe product (no arsenic leaking into the bottles on the production plant floor, etc.).[22]
Practicing homeopaths and companies that produce these products often make misleading claims about FDA approval. When a homeopathic product claims to be FDA approved for the treatment of a particular disease it only means that the FDA believes that the product will not kill you if you take it, not that it has any efficacy against that disease.
Homeopathic products are not allowed to claim that they can cure diseases that are not "transitory" in nature. Homeopathic products can only be marketed for such things as coughs, fevers, pains, etc. Any claims made about things like cancer, AIDS, asthma, STDs or other chronic or long term illnesses violate FDA standards. Several homeopathic companies have been fined in the past for making these claims but most do not overtly make these claims. Instead products are sold for more general ailments like "liver problems" rather than hepatitis. Another way of sneaking this in is by hired sales people making the claims in one-on-one sessions with patients where it is usually difficult to prove such wrongdoing. One example of this is in England where homeopathic consultants were advising patients to take their products for malaria.[23]
In June 2010, the FDA sent a warning letter to Wisconsin-based "Homeopathy for Health" saying that it was falsely advertising homeopathic products that claimed they could treat the H1N1 virus. The letter included nearly twenty products from six different manufacturers, all of which were claimed by the seller to directly treat viral infections following the 2009 swine flu outbreak. The manufacturers were also notified with the same letter, as the FDA notes that manufacturers may not necessarily make the same claims as online retailers.[24] The FDA's list of fraudulent treatments for H1N1 infections has 185 entries.[25]
### UK Parliamentary Science and Technology Select Committee
In early 2010, the UK's Parliamentary Science and Technology Select Committee published a report into homeopathy and whether it should be funded by the government as part of the National Health Service. They concluded that, basically "homeopathy's rubbish and should be defunded".[26]
“”Overall conclusionBy providing homeopathy on the NHS and allowing MHRA licensing of products which subsequently appear on pharmacy shelves, the Government runs the risk of endorsing homeopathy as an efficacious system of medicine. To maintain patient trust, choice and safety, the Government should not endorse the use of placebo treatments, including homeopathy. Homeopathy should not be funded on the NHS and the MHRA should stop licensing homeopathic products. —Select Committee report p47
The following are some of the notable extracts from the report (there are 275 pages in total): note: page numbers refer to the PDF pages, not the report pages
“”What is homeopathy? 9. Homeopathy is a 200-year old system of medicine that seeks to treat patients with highly diluted substances that are administered orally. Homeopathy is based on two principles: “like-cures-like” whereby a substance that causes a symptom is used in diluted form to treat the same symptom in illness and “ultra-dilution” whereby the more dilute a substance the more potent it is (this is aided by a specific method of shaking the solutions, termed “succussion”). It is claimed that homeopathy works by stimulating the body’s self-healing mechanisms. 10. Homeopathic products should not be confused with herbal remedies. Some homeopathic products are derived from herbal active ingredients, but the important distinction is that homeopathic products are extremely diluted and administered according to specific principles. —Select Committee report p9
“”14. In June 2009 the Guardian reported that the NHS had spent £12 million on homeopathy in the period 2005–08.16 According to the Society of Homeopaths, the NHS spends £4 million on homeopathy annually. It appears that these figures do not include maintenance and running costs of the homeopathic hospitals or the £20 million spent on refurbishing the Royal London Homeopathic Hospital between 2002 and 2005. —Select Committee report p10
“”47. Our expectations of the evidence base relevant to government policies on the provision of homeopathy are straightforward. We would expect the Government to have a view on the efficacy of homeopathy so as to inform its policy on the NHS funding and provision of homeopathy. Such a view should be based on the best available evidence, that is, rigorous randomised controlled trials and meta-analyses and systematic reviews of RCTs. If the effects of homeopathy can be primarily attributed to the placebo effect, we would expect the Government to have a view on the ethics of prescribing placebos. —Select Committee report p18
“”49. There appear to be two main concerns. The first is the principle of like-cures-like and the second is about how ultra-dilutions could retain characteristics of the active ingredient. —Select Committee report p18
“”54. We conclude that the principle of like-cures-like is theoretically weak. It fails to provide a credible physiological mode of action for homeopathic products. We note that this is the settled view of medical science —Select Committee report p20
“”70. In our view, the systematic reviews and meta-analyses conclusively demonstrate that homeopathic products perform no better than placebos. —Select Committee report p23
And:
“”77. There has been enough testing of homeopathy and plenty of evidence showing that it is not efficacious. —Select Committee report p25
### UK "NHS Choices"
The relevant page of the government website "NHS Choices" was radically amended after it was revealed that a (now defunct) charity set up by Prince Charles had lobbied on behalf of homeopathy.[27] It now states: "There has been extensive investigation of the effectiveness of homeopathy. There is no good-quality evidence that homeopathy is effective as a treatment for any health condition."
### Real evidence?
Are there any examples that show an effect of homeopathy? The answer to this question is a little complicated, but essentially, no. The only studies that show an effect are studies that do not use a double-blind control. This makes them worthless, but homeopathic practitioners claim it is the only way. Here is an interesting fact: the James Randi Education Foundation has a \$1 million prize for anyone who can demonstrate certain “supernatural” powers (and, make no mistake, “potentization” is definitely a supernatural claim). This prize is open to any homeopath who thinks they can demonstrate an effect. A few small-time practitioners have attempted to do this but all have failed. What is more interesting is no major “homeopathic” producer has bothered to pursue it, despite many attempts by the foundation to get them to try. These producers would not only get the money but instant free press and fame. One should ask why they refuse to put their products to the test.
### Placebo effect
It is undeniable that homeopathy works, at least for a given value of "works" and this is via the placebo effect. This is the effect by which something that is clinically inactive can still produce positive results because of various factors, from positive thinking (i.e., mind over matter) to suppressing people's symptoms mentally and making them feel better about the situation. This is known as a complex intervention because it is rarely a straightforward thing to quantify; different people will experience different effects. In the case of homeopathy, it is most effective when homeopaths give time and attention to their patients, in contrast to overworked general practitioners who may give a quick exam and write a prescription for a course of painkillers (many of which are enhanced by some form of the placebo effect anyway). This is the factor that gives homeopathy its apparent power to treat simple illnesses or maladies—but not "real" diseases like malaria or cancer. However, this is not the same as "efficacy." To justify the claims of homeopaths and alternative medicine advocates that there is more than just a placebo effect occurring, what needs to be tested is just the homeopathic remedy on its own without all the extra bells and whistles, sometimes referred to as "clinical homeopathy". In all respects, homeopathic remedies fail this.
Although the placebo workings of homeopathic treatments aren't denied, the use of the placebo effect in treating patients is considered ethically dubious due to the deceit involved, as well as potential risks to a patient should they be suffering from an illness that cannot be remedied by placebo alone. Homeopathic remedies, being just water, cannot actively harm patients, but there are many indirect risks, some of them quite considerable, such as patients' increasing distrust in conventional evidence-based medicine, or the misdirection of funds by professional organisations that promote it.[28]
### Mass production
Some homeopathic remedies come in "pill" form. In this case, not even claims of "water memory" help explain how they work. "Sugar memory," perhaps.
Finally, here is the most important point for “mass production” homeopathic remedies, the kinds produced in factories. Let’s ignore all of the problems with the basic foundations of homeopathy, let’s ignore all of the mountains of evidence showing zero effect of the “cures”, let's ignore the refusal of all the major proponents to be put to the test. And let’s, for the sake of argument, assume that there is something to homeopathy. Even if this is the case then mass produced cures will not work. This is the absolute basic rule of homeopathy. The reason that proponents say that you can not use double-blind tests is because each and every single cure must be tailor-made to the specific person it is to be used on: each ingredient, the amount, the ratio, and the procedure is painstakingly crafted on a person-by-person basis. A way to test this claim is to switch the remedy at the very last minute without letting either the homeopath or patient know whether they are recieving a prepared remedy or tap water. This would preserve the psychology of the placebo effect—where if the doctor knows that they're giving a sugar pill, this information is subconciously indicated to the patient, who is less susceptable to the effect—resulting in a fair trial for both sides. In the best homeopathic studies, this is what has been done, and the results have come out the same for the switchouts as for the control group. So by even the standards of proponents of homeopathy, no mass-produced cure can possibly work.
### Conclusion
Legitimizing quack medicines and beliefs like homeopathy, and ignoring basic concepts such as skepticism and the scientific method, is a very dangerous thing. It encourages a culture where facts are, ultimately, relative and subsequently objective evidence is meaningless. If you wonder why 30 percent of Americans still believe that Iraq was responsible for 9/11 or why over 40 percent still believe that weapons of mass destruction were found there, the answer is in issues such as this. One cannot stand on the side of facts, truth, and legitimacy in only one area, or choose to exclude them arbitrarily from just one area. When “facts” can be abandoned because we don’t like the “feeling” they give us, and lies are swallowed because they make us feel good, the results should be obvious to any educated person.
Homeopaths may find criticism of their practices blunted if James Randi finally manages to overdose on homeopathic remedies. Randi commented "I did this before a meeting of the US congress - which if that doesn't put you to sleep, nothing will."[29]
Si vous voulez cet article en français, il peut être trouvé à Homéopathie.
|
2013-05-24 03:21:51
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 1, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4354327321052551, "perplexity": 2148.9567296212267}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-20/segments/1368704133142/warc/CC-MAIN-20130516113533-00037-ip-10-60-113-184.ec2.internal.warc.gz"}
|
https://golem.ph.utexas.edu/~distler/blog/archives/2007_10.shtml
|
## October 31, 2007
### Two Tech Topics
#### The STIX Fonts
After five years of blogging about the imminent release of the STIX fonts, they have finally been released in beta. I immediately rushed to install them. They are a huge improvement over Code2000/Code2001, which were previously required to complete the glyph coverage needed for rendering Math hereabouts.
The STIX fonts are not quite ready to replace the Mathematica/Computer Modern fonts for stretchy characters (parentheses, integral signs, etc). That will require internal changes to the Mozilla-based browsers. That, in turn, will require getting MathML working again in Mozilla Trunk. Since it’s been broken for over a year, don’t hold your breath.
#### arXiv API
A couple of years ago, the arXivs sprouted a Trackback interface. Now, they’ve developed an API to their search facility. Submit a query (via GET or POST), and receive the result as an Atom-formatted response.
This ties in rather nicely with one of my ambitions for Instiki: to add some bibliographic features. My plan was rather simple: store bibliographic entries in bibtex format (as retrieved from SPIRES or MathSciNet), and allow users to [cite:a_key] on their wiki pages. On the web, these would produce properly-formatted citations at the bottom of the wiki page. In the LaTeX export, it would produce \cite{a_key}, which would work with a bibtex file produced from the bibliographic database.
In such an environment, having arXiv search facilities integrated into the Instiki authoring environment would be a very nice addition1. And this is clearly the early days of the arXiv API. I’m pretty sure that more cool things are yet to come.
1 If you only care about citing the arXiv version of the paper, the <atom:entry> in the response provides all of the relevant bibliographic information. It’s only when you want to cite the published version, that the <arxiv:journal_ref> element needs some help. If the entry contains a <atom:link title="doi" rel="related"> DOI reference, that can sometimes be resolved (eventually) to a Bibtex entry for the published paper, but there are no guarantees.
Posted by distler at 11:53 PM | Permalink | Followups (7)
## October 28, 2007
### Sanitizing SVG
For, perhaps obvious, reasons, I’ve been thinking again about sanitizing SVG. My most recent changes to the HTML5lib Sanitizer was to ensure that in constructions like
<rect width='0' height='0' fill='url(...)'/>
the referenced URL is a same-document reference, rather than one that pulls in an external resource from Lord-Knows-Where.
The white-list of elements and attributes in the HTML5lib Sanitizer is the union of a list for MathML that I came up with, and a list for SVG from Sam Ruby. I didn’t really put much thought into Sam’s list. But, once one starts thinking about things, one does start to wonder.
Is
<image xlink:href='http://bad.com/evil.svg'/>
really safe1?
#### Update:
Of course it’s not safe, as my little example for Anne (viewable only in Opera 9.5beta, but the same problem exists, mutatis mutandis, for <svg:image>) demonstrates. I’ve updated Instiki and the HTML5lib Sanitizer, accordingly.
SVG is a gargantuan Specification. Even thinking about the security implications of Sam’s limited subset makes my head hurt.
1 On similar grounds, while I consider the standard <img src='http://bad.com/ugly.jpg'/> element fairly safe, I have to wonder at the wisdom of the decision in Opera 9.5beta to allow SVG in (X)HTML <img> elements.
Posted by distler at 11:50 PM | Permalink | Followups (8)
## October 22, 2007
### SVG in MathML in …
As I’ve mentioned before, there is an effort afoot to enable the inclusion of MathML and SVG (and maybe other) markup in HTML5. But that’s a long way off (if it happens at all). What I really want to talk about, today, is an issue that affects us in the here and now: mixing MathML and SVG markup.
Posted by distler at 11:40 PM | Permalink | Followups (21)
## October 19, 2007
### 5 Years
Something else happened this past week: this blog turned 5.
While I cringe, a bit, looking back at my early posts, I’m kinda gratified that I’ve managed to keep this gig going as long as I have. I’ve certainly learned a lot: about Physics, about markup and — I like to think — about what makes a useful blog post.
Back then, Physics/Math blogs were not exactly thick on the ground. In fact, the genre pretty much didn’t exist. Today, the blogroll at Planet Musings is satisfyingly long.
And yet … I’m a little dissatisfied. Many of the meatiest, most exciting, entries on that list are actually in Mathematics: our own n-Category Café, Terrence Tao’s blog, the Secret Blogging Seminar
That make me a little jealous. Damnit! We high energy theorists were here first! I think it’s time to try to reanimate the String Coffee Table. Any volunteers?
On a completely unrelated note, I learn, via Sam Ruby, that Liferea, the feed aggregator for the Gnome desktop, supports MathML, SVG and the Atom Threading Extension. That is extraordinarily cool.
Posted by distler at 2:29 PM | Permalink | Followups (2)
## October 18, 2007
### Maloney on 2+1
We had Alex Maloney visiting us this week, and he gave a lovely talk about his forthcoming paper with Edward Witten on 2+1 gravity with negative cosmological constant.
You’ll recall that Witten’s proposal is that the dual CFT has a partition function of the form
(1)$Z(\tau,\overline{\tau}) = {\left|\chi_k(q)\right|}^2$
where the central charge $c=24k= 3\ell/2G$, with $\ell$ the radius of AdS3. $\chi_1(q)$ is the partition function of the famous Monster Module. For higher $k$, the first primary state above the ground state ($h=0$) has $h=k+1$. One can systematically write down the $\chi_k(q)$, but it is not known whether they, in fact, correspond to bona fide CFTs. Indeed, Gaberdiel had presented a strong (though not air-tight) argument that they cannot, for sufficiently large $k$ ($k\geq 42$).
If Gaberdiel is correct, then, either the proposal (1) is wrong, or there is no semiclassical regime for 2+1 gravity1. In either case you can stop reading this post. If not, then an interesting question arises. Semiclassically, we expect there to be a Hawking-Page transition between hot AdS space (with inverse temperature $\beta=Im(\tau)$) and the AdS BTZ blackhole. Indeed, as a function of complex $\tau$, you expect a complicated phase structure, given by the fundamental domains for the action of $SL(2,\mathbb{Z})$.
When we Wick rotate to Euclidean time, the boundary is a torus, $\Sigma$, of modular parameter, $\tau$. Semiclassically, we expect a single bulk geometry2 to dominate: a handlebody (a solid torus), $M$, whose boundary is $\Sigma$. This involves a choice of cycle, $\gamma= p\alpha +q\beta$, with $(p,q)$ coprime, such that $\gamma$ is contractible in $M$. The usual Hawking-Page transition is the flip between when spatial circle is contractible (hot AdS) and when the Euclidean time-circle is contractible (the blackhole). But, in 2+1 dimensions, the phase structure is much richer.
One thing that might puzzle you, in this regard, is how there can be a phase transition, in light of (1), where the $\chi_k(q)$ are manifestly analytic. The answer is that $\chi_k(q)$ have $k$ zeroes along the phase boundaries and, in the large-$k$ limit, these zeroes become dense, leading to the desired non-analytic behaviour.
In a phrase: Hawking-Page is Lee-Yang!
1 There are other troubling aspects to (1). As I emphasized in my previous post, there are states of the CFT, which are the ground state $\overline{h}=0$ on the right, and some primary state (with $h\geq k+1$) on the left. These correspond to super-rotating BTZ blackholes, which have naked singularities, closed timelike curves, and generally look kinda sick in the semiclassical regime ($k\to\infty$, with $h/k$ fixed).
2 A slight (but only slight) complication is that they must use complex saddle points of the Euclidean action.
Posted by distler at 11:52 PM | Permalink | Followups (4)
## October 16, 2007
### Why I Love Mark
Tangentially, I think liberals should thank Fox News for indirectly providing a valuable service. It is now possible to rank the batshit-craziness of American conservatives on a single linear scale, based on when they stopped watching Fox News.
Posted by distler at 10:26 AM | Permalink | Followups (1)
## October 15, 2007
### Gluino Masses
The MSSM is much-maligned for having many more parameters than the Standard Model. Of course, in the supersymmetric limit, it has no more parameters than the Standard Model. To the contrary, the Higgs quartic coupling is related to the gauge coupling, a simplification that is the source of a certain amount of trouble.
Supersymmetry breaking introduces a plethora of soft parameters. But, as we mentioned last time, we already have some quite stringent constraints on these parameters. And these have nontrivial implications for higher-energy physics.
But we’d like to do better. We’d like to extract some robust (that is to say, relatively model-independent) predictions for these soft parameters. The most promising place to look is at the gaugino masses, where Nilles and Choi have done a very nice analysis.
Posted by distler at 11:10 PM | Permalink | Followups (8)
## October 9, 2007
### Mirror Mediation
I’ve been planning to write some things about recent developments in string phenomenology. Unfortunately, the list of papers I want to talk about seems to grow faster than my ability to keep pace. So, rather than being as systematic as I would like, I’ll just plunge in and talk about a recent paper by Joseph Conlon. The subject is supersymmetry-breaking, and a mechanism he calls “mirror-mediation.”
First-off, I have to say that I hate the nomenclature of this sub-field, where a profusion of fanciful (and, usually, not terribly descriptive) names, of the form …-mediation, are attached to various restrictions on the form of the supergravity Lagrangian. I realize it’s hard to stop, once such a convention is established, but I think it tends to obscure more than it illuminates.
Anyway, the key problems that any of these mediation mechanisms needs to solve is to somehow avoid that the soft SUSY-breaking terms induced for the MSSM fields lead to flavour-changing neutral currents and/or large CP-violation.
Conlon points to a mechanism which might look a little ad-hoc, from the perspective of low energy effective field theory, but which is quite natural in certain classes of string vacua.
Posted by distler at 11:51 AM | Permalink | Followups (4)
## October 4, 2007
### LaTeX Macros
One of most useful features of my branch of Instiki is the LaTeX export. If you’ve been developing some ideas with your collaborators, and get to the point where you want to publish something, you click on the “TeX” link at the bottom of the page, and obtain a LaTeX file. Paste the contents into your favourite paper template, and ship it off to the arXivs.
Trouble is, there are some not-insignificant differences between itex and AMSLaTeX, so to make the procedure really smooth, one needs LaTeX macros to implement the various features of itex. And I’d been kinda procrastinating about writing them.
So I was overjoyed when Jason Blevins volunteered to work on this. With a few contributions from me, he managed to generate all the requisite macros (with some caveats1). These are now incorporated in the latest version of Instiki.
I’m particularly pleased with the devilishly clever implementation of \tensor{}{} and \multiscripts{}{}{}.
But there was one issue which arose, about which I’d like to solicit the opinions of you, the users of itex2MML. There’s a conflict between the itex implementation of \binom{}{} and the one in AMSLaTeX. In AMSLaTeX, $$\binom{n}{m}$$ generates
$\left(\genfrac{}{}{0}{}{n}{m}\right)$
whereas itex (a legacy from its ancestor, webtex) produces
$\genfrac{}{}{0}{}{n}{m}$
without the parentheses.
The way I see it, there are two ways to resolve the conflict:
1. Change the behaviour of itex, to agree with that of AMSLaTeX (with which, I assume, more users are familiar). The downside is that this may break some existing pages.
2. Maintain the current behaviour, and have Instiki map \binom{n}{m} to {n \atop m} when generating the LaTeX output.
#### Update (10/5/2007):
Oh heck! Gavin is right. As of itex2MML 1.2.6, \binom{}{} does what you think it should. And I added an \atop command, so that you can easily recover the old behaviour.
1 Aside from the unresolved issue with \binom{}{}, there are a few remaining gotchas:
1. The plain TeX syntax for fractions, {A \over B} is allowed, but will generate a warning in AMSLaTeX. Use \frac{A}{B} instead.
2. Webtex’s \array command is not implemented. Use one of the existing “matrix-like” environments.
3. \color{} works when the argument is a named colour, but generates an error if the argument is an RGB colour-spec.
4. \bgcolor{} isn’t implemented.
5. There are no suitable Postscript or TrueType fonts in the standard TeX distributions, which provide the glyphs for
• \righttoleftarrow (⟲)
• \lefttorightarrow (⟳)
Posted by distler at 2:51 PM | Permalink | Followups (8)
|
2017-06-23 22:35:19
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 29, "math_alttext": 0, "mathml": 2, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6876415610313416, "perplexity": 2382.233192327581}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-26/segments/1498128320201.43/warc/CC-MAIN-20170623220935-20170624000935-00205.warc.gz"}
|
https://www.physicsforums.com/threads/figuring-out-if-a-force-field-is-conservative-or-not.888509/
|
# Homework Help: Figuring Out if A Force Field is Conservative or Not
Tags:
1. Oct 9, 2016
### Summer95
1. The problem statement, all variables and given/known data
There is a collection of different force fields, for example:
$$F_{x}=ln z$$
$$F_{y}=-ze^{-y}$$
$$F_{z}=e^{-y}+\frac{x}{z}$$
We are supposed to indicate whether they are conservative and find the potential energy function.
2. Relevant equations
See Above
3. The attempt at a solution
Is it a conservative force if it is the gradient of a scalar field?
So if $$\vec{F}=(\frac{\delta u}{\delta x},\frac{\delta u}{\delta y},\frac{\delta u}{\delta z})$$
You also have to check that $$\Delta\times\vec{F}=\vec{0}$$
Which is true.
So for this particular case the answer would be yes, it is conservative, because $$u(x,y,z) = ze^{-y}+xlnz$$ fulfills this requirement.
So the actual potential energy would just be $$-u(x,y,z)$$
Is this the whole process I can do for any three dimensional force field? Am I missing any subtle details here?
Thank you!
2. Oct 9, 2016
### kuruman
If the curl of the force is zero, the force is conservative.
If the force can be written as the gradient of a scalar field, it is conservative.
|
2018-05-26 04:51:45
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.49432915449142456, "perplexity": 412.029782065855}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-22/segments/1526794867309.73/warc/CC-MAIN-20180526033945-20180526053945-00311.warc.gz"}
|
https://www.cfd-online.com/Forums/blogs/sbaffini/3119-generalized-thermal-dynamic-wall-function-part-2.html
|
# A generalized thermal/dynamic wall function: Part 2
Register Blogs Members List Search Today's Posts Mark Forums Read
Rate this Entry
# A generalized thermal/dynamic wall function: Part 2
Posted October 17, 2016 at 09:24 by sbaffini
Updated December 21, 2016 at 10:07 by sbaffini
In the first part of this post we left with the problem of computing the following integral:
with:
I added all the explicit functional dependencies here because we know ( given by Monkewitz et al. and reported in the previous post), and would be great to use that solution directly. Indeed, while the above integral is still directly solvable by partial fractions (check yourself with Wolfram alpha), the solution is not really appealing, because it involves 3 non trivial roots of a cubic equation.
In order to avoid that, we absorb the ratio in the definition, and multiply both numerator and denumerator by , obtaining:
Note that, if all the instances of were multiplied by we would have done, as the trick would have been to replace with in the Monkewitz solution (that, for example, would happen for the mixing length formulation, but unfortunately it is not integrable).
In order to arrive at this case, we can assume that and , with the value obtained by calibration with the velocity profile (11.489 for us, 10.306 for Monkewitz et al.). Then we request for to be a solution of the following equation:
It turns out that for meaningful values of and the solution is:
with:
So, with the value computed as above, we have that is just the Mokewitz et al. solution given in the previous post. Thus, to complete our solution, we just need an expression for . I won't report it here, as i just got it from Wolfram alpha (sometimes you need to add the last 3 right parentheses to the Wolfram formula, still don't know why):
https://www.wolframalpha.com/input/?...Batan(b%2Fc))))))
This is for the case constant. The fact that this is extendable to in the form of a polynomial can be rapidly checked by integrating the separate terms multiplied by a certain power of x (i used x in place of y in Wolfram)... but i leave this as exercise for the reader .
In part 3 of this post (the last one) i'll sum up the steps required to compute the whole solution and give a MATLAB/Octave script that compares it with the numerical one.
|
2021-11-30 21:19:04
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8828203082084656, "perplexity": 500.9147106112354}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964359073.63/warc/CC-MAIN-20211130201935-20211130231935-00583.warc.gz"}
|
https://dsp.stackexchange.com/tags/linear-systems/hot?filter=year
|
# Tag Info
11
You need to define what you mean by "invertible". Do you mean invertible by a causal and stable system? If yes, then any system that is not minimum-phase is not invertible (because the inverse system can't be causal and stable). Example of a system that cannot be inverted by a causal and stable system: a simple delay $y(t)=x(t-T)$, $T>0$, could only be ...
7
[EDIT] A necessary condition for invertibility is that any output has only one possible input (or injectivity, as proposed in comments). Since we are looking at counterexamples, we can look at when this condition is not satisfied. The null system, that turns every signal into a zero flat line, is not invertible, but a bit trivial. A system that computes a ...
6
No. It's only LTI (Linear and Time-Invariant) systems that can be modeled with convolution through a unique single impulse response. For example the systems $$y(t) = g(t) x(t)$$ or $$y[n] = \sum_{k=0}^{k < n} x[n-k]$$ are both linear but not time-invariant and their output $y[n]$ cannot be computed with the convolution operation ( $\star$ denoting ...
5
It's possible, in mathematics, to complete real numbers with "infinite" values, with sound topological properties; for instance non-standard analysis or the Extended real number line (discussion at Math StackExchange). However, in this context, for any standard real number $t$, the rule is to set $t\pm \infty = \pm \infty$ (see Arithmetic operations). So, ...
5
If the derivative exists at the given point, then it doesn't matter if you look (infinitesimally) into the future or into the past, you can do both, because both will give the same result: $$x'(t)=\lim_{h\to 0}\frac{x(t+h)-x(t)}{h}=\lim_{h\to 0}\frac{x(t)-x(t-h)}{h}\tag{1}$$ So a differentiator can be (theoretically) implemented by a causal system. ...
5
the Fourier Series for a single periodic function, having period $P$, $$x(t) = x(t+P) \qquad \forall \ -\infty < t < +\infty$$ is $$x(t) = \sum\limits_{k=-\infty}^{\infty} c_k \, e^{j(2\pi k/P)t}$$ each harmonic $c_k$ is labelled with its harmonic number, $k$, in the above. the actual frequency of each harmonic, in Hz or units of 1/time, is $\... 5 You cannot sum$X_1[k]$and$X_2[k]$(the discrete spectra of the two signals) element-wise because for them$k$represents different angular frequencies$\frac{k\,2\pi}{P_1}$and$\frac{k\,2\pi}{P_2}$in radians. Time domain addition will only translate to frequency domain addition if your frequency variable is equally proportional to angular frequencies ... 4 For the case of input process$\{X(t)\}$being white Gaussian noise with two-sided power spectral density$\frac{N_0}{2}$, the output process$\{Y(t)\}$is a strictly stationary zero-mean Gaussian process in which all the random variables have the same variance$\frac{N_0}{2}\int_{-\infty}^\infty |H(f)|^2 \,\mathrm df$almost as you say. But the key point ... 4 The IIR filter doesn't have to be unstable, but it has the potential of being so; unlike the FIR case which doesn't have even the potential. One reason for the (potential) unstability of an IIR (adaptive) filter is the numerical issues due to coefficient quantization. When the poles are closer to unit circle this will be critical. This is especially ... 4 Although what @Fat32 wrote is correct, I think the potential instability of IIR filters is not the main reason for the instability of an adaptive IIR filter. After all, we can calculate the poles in each iteration and put a hard constraint to avoid poles out of the unit circle. Even within the case of the FIR filters - which are unconditionally stable- we ... 4 No; the system given by $$y[n] = x[n] + n$$ is time-varying, due to the added term$n$. Your mistake is in the line : $$\ y_2[n] = x_2[n] + n = x[n-k]+(n-k)$$ which should be instead $$\ y_2[n] = x_2[n] + n = x[n-k]+n$$ and therefore implies that $$y_2[n] \neq y[n-k]$$. 3 This is a good question and something that I remember asking myself when I first learned about impulse responses and convolution. To understand this, it is first necessary to understand the significance of impulses and impulse responses. Referring to the image below, you can see that an impulse is an instantaneous like input and the impulse response is the ... 3 To expand on Justme's reply: From the looks of your code you seem to have confused what constitutes an LTI system. In your code the LTI system that I see (y1=2*z) scales an undelayed input signal by 2. The additional 2*cos(pi/t) is NOT part of the system, it is in effect just another sinusoid that you have added to your signal - thus giving it an ... 3 Focus on the first equation for EY. Back in the day when color television was being developed, the color signal had to be compatible with black and white TVs and vice versa. So the compatible brightness signal (luma Y) has to be calculated from the three primary color signals (R, G B) for transmission. Human visual system does not perceive brightnesses of ... 3 In general LTI System is invertible if it has neither zeros nor poles in the Fourier Domain (Its spectrum). The way to prove it is to calculate the Fourier Transform of its Impulse Response. The intuition is simple, if it has no zeros in the frequency domain one could calculate its inverse (Element wise inverse) in the frequency domain. Few remarks for the ... 3 (Adapted from this answer on dsp.SE) The reason that the impulse response (also called the unit pulse response for discrete-time systems) determines the output for arbitrary input$x$to an LTI system is that The output of a linear time-invariant system in response to input$xis the sum of scaled and time-delayed versions of the impulse response. ... 3 Yes your computation is correct. Indeed, you could have seen this even easier, had you considered that the output computation sum was $$y[n] = T\{x[n]\} = x[n-1] + x[n] + x[n+1] + x[n+2] .$$ And this is clearly an LTI (linear time-invariant), FIR (finite impulse response) system with associated impulse response $$h[n] = \delta[n-1] + \delta[n] + \delta[... 3 Any LTI system can be completely characterized (among other things) by it's transfer function or it's impulse response. If your filter represents an LTI system, that you can calculate it's output by either convolving the input with the impulse response or multiplying the transfer function with the spectrum of the input signal. In theory these things are ... 3 Whether LTI or not all systems are invertible if unique (distinct) inputs produce unique (distinct) outputs Causality and stability are later concerns for making sense of the obtained inverse system. For example the inverse to the delay system$$y[n] = x[n-d] $$is$$y[n] = x[n+d] $$Which is clearly noncausal for d > 0, and is not ... 3 In addition to all the answers that are correct in a mathematical sense, in a practical sense, a system whose frequency response goes below some finite but small-enough value will not be usefully invertable, even if a simple mathematical analysis would suggest that it is. In frequency-domain terms, the frequency response of a system's inverse will have gain ... 3 For a parallel system, the individual subsystems just add, so you simply have H_{||} = H_A + H_B . That goes for both the transfer function and the impulse response, so you can simply do h_b = h_{||} - h_a 2 The notation \hat{y} \left( k \mid k - 1 \right) usually means this is an estimated value of y \left( k \right) given all the available data up to time index k - 1 . So generally speaking, this is a prediction of one step in time of the data. The case above also suggests linear estimation. Namely, \hat{y} \left( k \right) is built using ... 2 You can use the Convolution Theorem to show that \int_{-\infty}^{\infty} h \left( \tau \right) x \left( t - \tau \right) d \tau is equivalent to Element Wise multiplication in the Frequency Domain. Hence for the case x \left( t \right) = A {e}^{s t} where s \in \mathbb{C} the output is just a multiplication by scalar of the input (The value of ... 2 No the converse is not true in general. Take for example the discrete-time ideal lowpass filter with impulse response$$ h[n] = \frac{ \sin( \omega_c n) }{ \pi n } ~~~,~~~-\infty < n <\infty$$which describes an LTI system but it does not correspond to a difference equation of any kind. Indeed h[n] is derived based on the inverse discrete-time ... 2 Convolution is equivalent to calculating an output pixel y[i,j] as a weighted sum of the nearby input pixels x[i+k,j+l], with the weight being a function of the relative spatial location (k,l). In bilateral filtering the formula for an output pixel has a part f(|x[i+k,j+l] - x[i,j]|) which is a non-linear function of pixel values. This makes ... 2 Just write down the convolution sum to see what's going on:$$y[n]=\sum_{k=-\infty}^{\infty}x[k]p[n-k]\tag{1}$$where we define the elements of the sequences x[n] and p[n] as equal to zero for the index n outside the range of non-zero values, i.e., outside n\in[0,2]. Taking into account those zero values, we can rewrite (1) with finite summation ... 2 Certainly possible. You can think of it in the way you described but I would say it just becomes an adaptive thresholding assuming a bimodal distribution: We admit that there are two main modes in the data and we try to identify those by grouping the values around the means of the clusters. These groups form clusters. The means are positioned such that each ... 2 You cannot solve this problem using the Laplace transform. The reason is that the Laplace transform of the input signal doesn't exist. You could use the Fourier transform, but in this case there's an even simpler way to determine the output signal. You need to know one important property of linear time-invariant (LTI) systems: their response to a sinusoidal ... 2 Also consider the somewhat simpler "identity system", given a continuous signal x(t):$$\begin{align}y(t) &= x(t)\tag{1}\\ &= \lim_{\Delta t\to0^-}x(t + \Delta t)\tag{2}\\ &= \lim_{\Delta t\to0^+}x(t + \Delta t)\tag{3}\\ &= \lim_{\Delta t\to0}\frac{x(t - \Delta t) + x(t+\Delta t)}{2}.\tag{4}\end{align}\$ This might be interpreted as the ...
2
You have to be clear what you mean by "invertible". Commonly, you want the inverse system to be causal and stable, and that puts certain restrictions on the original system. In the case of systems with rational transfer functions, you just have to look at the zeros of the transfer function, because they become the poles of the inverse system. If all zeros ...
Only top voted, non community-wiki answers of a minimum length are eligible
|
2020-01-29 05:08:05
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 1, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9721387624740601, "perplexity": 900.6206053540641}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579251788528.85/warc/CC-MAIN-20200129041149-20200129071149-00469.warc.gz"}
|
https://www.math.princeton.edu/events/upper-bounds-lagrangian-spectral-norm-2018-12-10t203000
|
Upper bounds on the Lagrangian spectral norm
-
Egor Shelukhin, University of Montreal
IAS - Simonyi Hall Seminar Room SH-101
We discuss recent developments in establishing uniform bounds on the spectral norm and related invariants in the absolute and relative settings. In particular, we describe new progress on a conjecture of Viterbo asserting such bounds for exact deformations of the zero section in unit cotangent disk bundles. This talk is partially based on joint work with Asaf Kislev.
|
2019-02-19 19:05:42
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8610870242118835, "perplexity": 1171.3325768805228}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-09/segments/1550247491141.23/warc/CC-MAIN-20190219183054-20190219205054-00070.warc.gz"}
|
https://plainmath.net/157/find-and-begin-bmatrix-end-bmatrix-equal-begin-bmatrix-plus-plus-bmatrix
|
# Find x,y,z and w begin{bmatrix}x & 5&(2x-1) y & 4 & 4y end{bmatrix}=begin{bmatrix}(2x-3) & z&5 7 & (2+1)&(3y+7) end{bmatrix}
Find x,y,z and w
$\left[\begin{array}{ccc}x& 5& \left(2x-1\right)\\ y& 4& 4y\end{array}\right]=\left[\begin{array}{ccc}\left(2x-3\right)& z& 5\\ 7& \left(2+1\right)& \left(3y+7\right)\end{array}\right]$
You can still ask an expert for help
• Questions are typically answered in as fast as 30 minutes
Solve your problem for the price of one coffee
• Math expert for every subject
• Pay only if we can solve it
dessinemoie
Step 1
Two matrices are equivalent when the corresponding terms of the matrices are equal.
Step 2
Find values as equal.
$x=2x-3$
$2x-x=3$
$x=3$
$y=7$
$z=5$
$w+1=4$
$w=4-1$
$w=3$
$3y+7=4y$
$4y-3y=7$
$y=7$
$x=3$
$y=7$
$z=5$
$w=3$
Jeffrey Jordon
|
2022-06-26 20:18:21
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 21, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7079772353172302, "perplexity": 5405.0902949744195}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103271864.14/warc/CC-MAIN-20220626192142-20220626222142-00674.warc.gz"}
|
https://17calculus.com/partial-derivatives/lagrange-multipliers/
|
Limits Derivatives Integrals Infinite Series Parametrics Polar Coordinates Conics
Limits
Epsilon-Delta Definition
Finite Limits
One-Sided Limits
Infinite Limits
Trig Limits
Pinching Theorem
Indeterminate Forms
L'Hopitals Rule
Limits That Do Not Exist
Continuity & Discontinuities
Intermediate Value Theorem
Derivatives
Power Rule
Product Rule
Quotient Rule
Chain Rule
Trig and Inverse Trig
Implicit Differentiation
Exponentials & Logarithms
Logarithmic Differentiation
Hyperbolic Functions
Higher Order Derivatives
Differentials
Slope, Tangent, Normal...
Linear Motion
Mean Value Theorem
Graphing
1st Deriv, Critical Points
2nd Deriv, Inflection Points
Related Rates Basics
Related Rates Areas
Related Rates Distances
Related Rates Volumes
Optimization
Integrals
Definite Integrals
Integration by Substitution
Integration By Parts
Partial Fractions
Improper Integrals
Basic Trig Integration
Sine/Cosine Integration
Secant/Tangent Integration
Trig Integration Practice
Trig Substitution
Linear Motion
Area Under/Between Curves
Volume of Revolution
Arc Length
Surface Area
Work
Moments, Center of Mass
Exponential Growth/Decay
Laplace Transforms
Describing Plane Regions
Infinite Series
Divergence (nth-Term) Test
p-Series
Geometric Series
Alternating Series
Telescoping Series
Ratio Test
Limit Comparison Test
Direct Comparison Test
Integral Test
Root Test
Absolute Convergence
Conditional Convergence
Power Series
Taylor/Maclaurin Series
Interval of Convergence
Remainder & Error Bounds
Fourier Series
Study Techniques
Choosing A Test
Sequences
Infinite Series Table
Practice Problems
Exam Preparation
Exam List
Parametrics
Parametric Curves
Parametric Surfaces
Slope & Tangent Lines
Area
Arc Length
Surface Area
Volume
Polar Coordinates
Converting
Slope & Tangent Lines
Area
Arc Length
Surface Area
Conics
Parabolas
Ellipses
Hyperbolas
Conics in Polar Form
Vectors Vector Functions Partial Derivatives/Integrals Vector Fields Laplace Transforms Tools
Vectors
Unit Vectors
Dot Product
Cross Product
Lines In 3-Space
Planes In 3-Space
Lines & Planes Applications
Angle Between Vectors
Direction Cosines/Angles
Vector Projections
Work
Triple Scalar Product
Triple Vector Product
Vector Functions
Projectile Motion
Unit Tangent Vector
Principal Unit Normal Vector
Acceleration Vector
Arc Length
Arc Length Parameter
Curvature
Vector Functions Equations
MVC Practice Exam A1
Partial Derivatives
Directional Derivatives
Lagrange Multipliers
Tangent Plane
MVC Practice Exam A2
Partial Integrals
Describing Plane Regions
Double Integrals-Rectangular
Double Integrals-Applications
Double Integrals-Polar
Triple Integrals-Rectangular
Triple Integrals-Cylindrical
Triple Integrals-Spherical
MVC Practice Exam A3
Vector Fields
Curl
Divergence
Conservative Vector Fields
Potential Functions
Parametric Curves
Line Integrals
Green's Theorem
Parametric Surfaces
Surface Integrals
Stokes' Theorem
Divergence Theorem
MVC Practice Exam A4
Laplace Transforms
Unit Step Function
Unit Impulse Function
Square Wave
Shifting Theorems
Solve Initial Value Problems
Prepare For Calculus 1
Trig Formulas
Describing Plane Regions
Parametric Curves
Linear Algebra Review
Word Problems
Mathematical Logic
Calculus Notation
Simplifying
Practice Exams
More Math Help
Tutoring
Tools and Resources
Learning/Study Techniques
Math/Science Learning
Memorize To Learn
Music and Learning
Note-Taking
Motivation
Instructor or Coach?
Books
Math Books
You CAN Ace Calculus
17calculus > partial derivatives > lagrange multipliers
### Calculus Main Topics
Single Variable Calculus
Multi-Variable Calculus
### Tools
math tools
general learning tools
Lagrange Multipliers
The Method of Lagrange Multipliers is used to find maximums and minimums of a function subject to one or more constraints. We could also say that we want to optimize the function or find the extreme values of the function.
We highly recommend that you download the notes for this topic from Dr Chris Tisdell. Look for the pdf link entitled Extreme values + Lagrange multipliers.
In basic calculus, we learned that finding the critical points gives us information about maximums, minimums ( and saddlepoints ). We use the same idea here, i.e. locations where the derivative is zero gives us possible locations of maxs/mins. We use this method to integrate the constraints into the equation.
Basic Technique
If we are given a function $$f(x,y,z)$$ that we want to optimize (find maximums, minimums or both) subject to a constraint $$g(x,y,z) = 0$$, we set up the gradient equation $$\nabla f = \lambda \nabla g$$. [ For a version of the equations that do not use the gradient, see below. ]
The variable $$\lambda$$ is just a number ( independent of $$x$$, $$y$$ and $$z$$ ) called a Lagrange multiplier. We introduce $$\lambda$$ during the course of solving this problem but it will not appear in our answer.
Remember that the gradient is a vector. So, the above equation gives us three equations ( one for each variable ) and four unknowns ( $$x$$, $$y$$, $$z$$ and $$\lambda$$ ). Using also the constraint equation $$g(x,y,z) = 0$$, we can now (theoretically) solve for all four unknowns.
This next video clip explains this technique in more detail.
Dr Chris Tisdell: Lagrange Multipliers (clip 1)
So, why does this work? It seems kind of strange that introducing another variable would enable us to optimize a function. Here is a great video clip that explains this. His use of graphs is very good to visualize what is going on.
Dr Chris Tisdell: Lagrange Multipliers (clip 2)
Two Constraints
Okay, so now you know how to handle one constraint, if you are given two constraints, you just add another lagrange multiplier. We usually use the Greek letter mu, $$\mu$$. The equation then looks like $$\nabla f = \lambda \nabla g + \mu \nabla h$$ where the function we want to optimize is $$f(x,y,z)$$ and the constraint equations are $$g(x,y,z) = 0$$ and $$h(x,y,z) = 0$$. Here is a video explaining this in more detail, including an example.
Dr Chris Tisdell: Lagrange Multipliers: 2 Constraints
Equations That Do Not Use The Gradient
An alternate version of the equations using the Lagrange Method that do not use the gradient is given below. We present equations with three variables and two constraints. As you would expect, you can use the same ideas with two variables ( drop $$z$$ ) and one constraint ( drop $$h(x,y,z)$$ ).
Equations And Set Up
Optimize $$f(x,y,z)$$
Constraints $$g(x,y,z)=0$$ and $$h(x,y,z) = 0$$
$$L(x,y,z,\lambda, \mu) = f(x,y,z) - \lambda g(x,y,z) - \mu h(x,y,z)$$
Equations To Solve
$$\partial L / \partial x = 0 ~~~ \to ~~~ \partial f / \partial x - \lambda ~ \partial g / \partial x - \mu ~ \partial h / \partial x = 0$$
$$\partial L / \partial y = 0 ~~~ \to ~~~ \partial f / \partial y - \lambda ~ \partial g / \partial y - \mu ~ \partial h / \partial y = 0$$
$$\partial L / \partial z = 0 ~~~ \to ~~~ \partial f / \partial z - \lambda ~ \partial g / \partial z - \mu ~ \partial h / \partial z = 0$$
$$g(x,y,z) = 0$$
$$h(x,y,z) = 0$$
5 equations and 5 unknowns
### Search 17Calculus
Practice Problems
Instructions - - Unless otherwise instructed, follow these guidelines.
1. Optimize the functions subject to the given constraints.
2. Show whether they are maximums or minimums.
3. If you are not told whether to find maximums or minimums, find all of them.
4. Give all answers in exact form.
Level A - Basic
Practice A01
optimize: $$f(x,y) = x^2+y^2$$
constraint: $$2x+6y=2000$$
solution
Practice A02
optimize: $$f(x,y) = x^2+y^2$$
constraint: $$xy=1$$
solution
Practice A03
minimize: $$C(x,y) = 6x^2 + 12y^2$$
constraint: $$x+y=90$$
solution
Practice A04
optimize: $$f(x,y) = xy$$
constraint: $$x^2 + 2y^2 = 1$$
solution
Practice A05
minimize: $$f(x,y,z) = x^2+y^2+z^2$$
constraint: $$2x+y-z=1$$
solution
Practice A06
maximize: $$f(x,y,z) = x^2+2y-z^2$$
constraints: $$2x=y$$ and $$y+z=0$$
solution
Practice A07
optimize: $$f(x,y) = 3x+4y$$
constraint: $$x^2+y^2 = 1$$
solution
Practice A08
Determine the point on the surface of $$xyz=1$$ that is closest to the origin and satifies $$x > 0$$, $$y > 0$$ and $$z > 0$$.
solution
Practice A09
maximize: $$T(x,y) = 6xy$$
constraint: $$x^2+y^2=8$$
solution
Practice A10
We have a thin metal plate that occupies the region in the xy-plane $$x^2+y^2 \leq 25$$. If $$f(x,y) = 4x^2-4xy+y^2$$ denotes the temperature (in degrees C) at any point on the plate, determine the highest and lowest temperatures on the edge of the plate.
solution
Practice A11
Find the rectangle with maximum perimeter that can inscribed in the ellipse $$x^2+4y^2 = 4$$.
solution
Practice A12
optimize: $$f(x,y,z)=xyz$$
constraint: $$x^2+y^2+z^2=3$$
solution
Practice A13
Find the maximum and minimum values of the function $$f(x,y)=e^{xy}$$ subject to $$x^3+y^3=16$$.
solution
Level B - Intermediate
Practice B01
optimize: $$f(x,y) = (x-1)^2 + (y-2)^2 - 4$$
constraint: $$3x+5y=47$$
solution
Practice B02
optimize: $$f(x,y,z) = x^2+y^2+z^2$$
constraints: $$x+y+z = 1$$; $$x+2y+3z = 6$$
solution
Practice B03
optimize: $$f(x,y,z) = 3x-y-3z$$
constraints: $$x+y-z=0$$; $$x^2+2z^2 = 1$$
solution
Practice B04
optimize: $$f(x,y,z) = x^2+x+2y^2+3z^2$$
constraint: $$x^2+y^2+z^2 = 1$$
solution
9
|
2017-05-27 23:10:56
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6263493895530701, "perplexity": 7108.143319887987}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-22/segments/1495463609305.10/warc/CC-MAIN-20170527225634-20170528005634-00180.warc.gz"}
|
https://calculator.academy/refrigerant-charge-calculator/
|
Enter the gas in the pipe, the compressor/condenser section, and the evaporator section into the calculator to determine the Refrigerant Charge.
## Refrigerant Charge Formula
The following formula is used to calculate the Refrigerant Charge.
Cr = GP + CC + E
• Where Cr is the Refrigerant Charge
• GP is the gas in the pipe
• CC is the compressor/condenser section
• E is the evaporator section
To calculate a refrigerant charge, add together the gas charge in the pipe, compressor section, and evaporator section.
## How to Calculate Refrigerant Charge?
The following example problems outline how to calculate the Refrigerant Charge.
Example Problem #1
1. First, determine the gas in the pipe. In this example, the gas in the pipe is given as 15 .
2. Next, determine the compressor/condenser section. For this problem, the compressor/condenser section is given as 14 .
3. Next, determine the evaporator section. In this case, the evaporator section is found to be 13.
4. Finally, calculate the Refrigerant Charge using the formula above:
Cr = GP + CC + E
Inserting the values from above yields:
Cr = 15 + 14 + 13 = 42
Example Problem #2
Using the same method as above, determine the variables required by the equation. For this example problem, these are as follows:
gas in the pipe = 6
compressor/condenser section = 7
evaporator section = 8
Entering these given values and solving gives:
Cr = 6 + 7 + 8 = 21
|
2023-02-05 07:19:49
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8289961814880371, "perplexity": 2150.2387653207393}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500250.51/warc/CC-MAIN-20230205063441-20230205093441-00115.warc.gz"}
|
https://mathoverflow.net/questions/211444/ring-of-son-invariant-differential-operators-on-m-n-m
|
# Ring of SO(n)-invariant differential operators on M_n,m
I'm reading through Stephen Gelbart's paper "A Theory of Stiefel Harmonics." (http://www.ams.org/journals/tran/1974-192-00/S0002-9947-1974-0425519-8/).
There comes a point in the paper (Lemma 2.8) when he uses the fact that the ring of all constant coefficient $SO(n)$-invariant differential operators on $M_{n,m}$ (viewed as $\mathbb R^{nm}$) without constant term is generated by the operators $$\Delta_{il}=\sum_{k=1}^{n} \frac{\partial}{\partial x_{ki}}\frac{\partial}{\partial x_{kl}} \;\;\;\;\;\;\;1 \leq i, l \leq m$$ where $m < n$.
I don't see how the ring is generated by operators of this form. How can we show this?
• Aren't you assuming that the coefficients are constant? After all, the first order operator that is differentiation in the radial direction is invariant under $\mathrm{GL}(mn,\mathbb{R})$ and it's not generated by the $\Delta_{il}$. Once you do assume that it has constant coefficients, you can reduce it to the question of what are the $\mathrm{SO}(n)$-invariant polynomials, and that's not hard. – Robert Bryant Jul 13 '15 at 18:59
• I am--thanks for pointing that out. – Ken Schefers Jul 13 '15 at 19:29
|
2019-10-19 16:12:01
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8623985648155212, "perplexity": 276.35585066980906}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570986696339.42/warc/CC-MAIN-20191019141654-20191019165154-00410.warc.gz"}
|
http://math.stackexchange.com/questions/165332/control-system-on-matlab
|
# Control system on matlab
A satellite is launched for an astronomical mission, for which it needs to points its scientific sensor package in a specific direction. A simplified linearzed mathematical model of the above satellite is given below $$g(s)=\frac{k(s)}{T(s)}=\frac{0.036(s+25)}{s^2(s^2+0.04s+1)}$$ It is desired that when effecting a change in altitude, the new altitude must be achiveable within 20 seconds and must not have the maximam overshoot of more than 15%, where $k(s) =$ altitude angle and $T(s) =$ control torque. Solve by using matlab.
-
Since you are new, I want to give some advice about the site: To get the best possible answers, you should explain what your thoughts on the problem are so far. That way, people won't tell you things you already know, and they can write answers at an appropriate level; also, people are much more willing to help you if you show that you've tried the problem yourself. If this is homework, please add the [homework] tag; people will still help, so don't worry. Also, many would consider your post rude because it is a command ("Solve..."), not a request for help, so please consider rewriting it. – Zev Chonoles Jul 1 '12 at 15:06
Hint: You can use sisotool gui (SISO Design Tool GUI)
in command window :
n=[0.036 0.036*25];
d=conv([1 0 0],[1 0.04 1]);
G=tf(n,d);
sisotool(G)
then >> SISO Design for SISO Design Task >> Analysis >> Response to step Command
in this window you can see step response of system , and you can add pole/zero to system and watch changes in step response.
-
|
2015-11-30 12:29:43
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5030816197395325, "perplexity": 1607.2062065412488}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-48/segments/1448398461529.84/warc/CC-MAIN-20151124205421-00002-ip-10-71-132-137.ec2.internal.warc.gz"}
|
https://qanda.ai/en/solver/popular-problems/1016218
|
# Calculator search results
Formula
Calculate the value
$$\dfrac { 2 } { 3 } \times \dfrac { 1 } { 4 }$$
$\dfrac { 1 } { 6 }$
Calculate the value
$\dfrac { \color{#FF6800}{ 2 } } { 3 } \times \dfrac { 1 } { \color{#FF6800}{ 4 } }$
Reduce all denominators and numerators that can be reduced
$\dfrac { \color{#FF6800}{ 1 } } { 3 } \times \dfrac { 1 } { \color{#FF6800}{ 2 } }$
$\color{#FF6800}{ \dfrac { \color{#FF6800}{ 1 } } { \color{#FF6800}{ 3 } } } \color{#FF6800}{ \times } \color{#FF6800}{ \dfrac { \color{#FF6800}{ 1 } } { \color{#FF6800}{ 2 } } }$
numerator multiply between numerator, and denominators multiply between denominators
$\color{#FF6800}{ \dfrac { \color{#FF6800}{ 1 } \color{#FF6800}{ \times } \color{#FF6800}{ 1 } } { \color{#FF6800}{ 3 } \color{#FF6800}{ \times } \color{#FF6800}{ 2 } } }$
$\dfrac { \color{#FF6800}{ 1 } \times 1 } { 3 \times 2 }$
Multiplying any number by 1 does not change the value
$\dfrac { \color{#FF6800}{ 1 } } { 3 \times 2 }$
$\dfrac { 1 } { \color{#FF6800}{ 3 } \color{#FF6800}{ \times } \color{#FF6800}{ 2 } }$
Multiply $3$ and $2$
$\dfrac { 1 } { \color{#FF6800}{ 6 } }$
Try more features at Qanda!
Search by problem image
Ask 1:1 question to TOP class teachers
AI recommend problems and video lecture
|
2022-01-23 08:25:24
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8888559341430664, "perplexity": 5615.735678617949}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320304217.55/warc/CC-MAIN-20220123081226-20220123111226-00008.warc.gz"}
|
http://www.digplanet.com/wiki/Equals_sign
|
digplanet beta 1: Athena
Share digplanet:
Agriculture
Applied sciences
Arts
Belief
Business
Chronology
Culture
Education
Environment
Geography
Health
History
Humanities
Language
Law
Life
Mathematics
Nature
People
Politics
Science
Society
Technology
"=" and "=" redirect here. For double hyphens, see Double hyphen.
For other uses, see Equals (disambiguation).
For technical reasons, ":=" redirects here. For the computer programming assignment operator, see Assignment (computer science). For the definition symbol, see List of mathematical symbols#Symbols based on equality sign.
A well-known equality featuring the equals sign
The equals sign or equality sign (=) is a mathematical symbol used to indicate equality. It was invented in 1557 by Robert Recorde. The equals sign is placed between two expressions that have the same value meaning they represent the same mathematical object, as in an equation. It is assigned to the Unicode and ASCII character 003D in hexadecimal, 0061 in decimal.
History
The etymology of the word "equal" is from the Latin word "aequalis" as meaning "uniform", "identical", or "equal", from aequus ("level", "even", or "just").
The first use of an equals sign, equivalent to 14x+15=71 in modern notation. From The Whetstone of Witte by Robert Recorde.
Recorde's introduction of "="
The "=" symbol that is now universally accepted by mathematics for equality was first recorded by Welsh mathematician Robert Recorde in The Whetstone of Witte (1557). The original form of the symbol was much wider than the present form. In his book Recorde explains his design of the "Gemowe lines" (meaning twin lines, from the Latin gemellus[1]):
… to auoide the tediouſe repetition of theſe woordes : is equalle to : I will ſette as I doe often in woorke vſe, a paire of paralleles, or Gemowe lines of one lengthe, thus: =, bicauſe noe .2. thynges, can be moare equalle.
… to avoid the tedious repetition of these words: "is equal to", I will set (as I do often in work use) a pair of parallels, or Gemowe lines, of one length (thus =), because no two things can be more equal.
According to Scotland's University of St Andrews History of Mathematics website:[2]
The symbol '=' was not immediately popular. The symbol || was used by some and æ (or œ), from the Latin word aequalis meaning equal, was widely used into the 1700s.
Usage in mathematics and computer programming
In mathematics, the equals sign can be used as a simple statement of fact in a specific case (x = 2), or to create definitions (let x = 2), conditional statements (if x = 2, then …), or to express a universal equivalence (x + 1)2 = x2 + 2x + 1.
The first important computer programming language to use the equals sign was the original version of Fortran, FORTRAN I, designed in 1954 and implemented in 1957. In Fortran, "=" serves as an assignment operator: X = 2 sets the value of X to 2. This somewhat resembles the use of "=" in a mathematical definition, but with different semantics: the expression following "=" is evaluated first and may refer to a previous value of X. For example, the assignment X = X + 2 increases the value of X by 2.
A rival programming-language usage was pioneered by the original version of ALGOL, which was designed in 1958 and implemented in 1960. ALGOL included a relational operator that tested for equality, allowing constructions like if x = 2 with essentially the same meaning of "=" as the conditional usage in mathematics. The equals sign was reserved for this usage.
Both usages have remained common in different programming languages into the early 21st century. As well as Fortran, "=" is used for assignment in such languages as C, Perl, Python, awk, and their descendants. But "=" is used for equality and not assignment in the Pascal family, Ada, Eiffel, APL, and other languages.
A few languages, such as BASIC and PL/I, have used the equals sign to mean both assignment and equality, distinguished by context. However, in most languages where "=" has one of these meanings, a different character or, more often, a sequence of characters is used for the other meaning. Following ALGOL, most languages that use "=" for equality use ":=" for assignment, although APL, with its special character set, uses a left-pointing arrow.
Fortran did not have an equality operator (it was only possible to compare an expression to zero, using the arithmetic IF statement) until FORTRAN IV was released in 1962, since when it has used the four characters ".EQ." to test for equality. The language B introduced the use of "==" with this meaning, which has been copied by its descendant C and most later languages where "=" means assignment.
Usage of several equals signs
In PHP, the triple equals sign (===) denotes identity,[3] meaning that not only do the two expressions evaluate to equal values, they are also of the same data type. For instance, the expression 0 == false is true, but 0 === false is not, because the number 0 is an integer value whereas false is a Boolean value.
JavaScript has the same semantics for ===, referred to as "equality without type coercion". However, in JavaScript the behavior of == cannot be described by any simple consistent rules. The expression 0 == false is true, but 0 == undefined is false, even though both sides of the == act the same in Boolean context. For this reason it is recommended to avoid the == operator in JavaScript in favor of ===.[4]
In Ruby, equality under == requires both operands to be of identical type, e.g. 0 == false is false. The === operator is flexible and may be defined arbitrarily for any given type. For example, a value of type Range is a range of integers, such as 1800..1899. (1800..1899) == 1844 is false, since the types are different (Range vs. Integer); however (1800..1899) === 1844 is true, since === on Range values means "inclusion in the range".[5] Note that under these semantics, === is non-symmetric; e.g. 1844 === (1800..1899) is false, since it is interpreted to mean Integer#=== rather than Range#===.[6]
Other uses
The equals sign is also used in defining attribute–value pairs, in which an attribute is assigned a value.[citation needed]
Tone letter
The equals sign is also used as a grammatical tone letter in the orthographies of Budu in the Congo-Kinshasa, in Krumen, Mwan and Dan in the Ivory Coast.[7][8] The Unicode character used for the tone letter (U+A78A)[9] is different from the mathematical symbol (U+003D).
Related symbols
Approximately equal
Symbols used to denote items that are approximately equal include the following:[10]
Not equal
The symbol used to denote inequation (when items are not equal) is a slashed equals sign "≠" (U+2260; 2260,Alt+X in Microsoft Windows). In LaTeX, this is done with the "\neq" command.
Most programming languages, limiting themselves to the ASCII character set and typeable characters, use ~=, !=, /=, =/=, or <> to represent their Boolean inequality operator.
Identity
The triple bar symbol "≡" (U+2261, Latex \equiv) is often used to indicate an identity, a definition (which can also be represented by U+225D "" or U+2254 ""), or a congruence relation in modular arithmetic. The symbol "" can be used to express that an item corresponds to another.
Isomorphism
The symbol "" is often used to indicate isomorphic algebraic structures or congruent geometric figures.
In logic
Equality of truth values, i.e. bi-implication or logical equivalence, may be denoted by various symbols including =, ~, and ⇔.
In names
A possibly unique case of the equals sign of European usage in a person's name, specifically in a double-barreled name, was by pioneer aviator Alberto Santos=Dumont, as he is also known not only to have often used an equals sign (=) between his two surnames in place of a hyphen, but also seems to have personally preferred that practice, to display equal respect for his father's French ethnicity and the Brazilian ethnicity of his mother.[11]
The equals sign is sometimes used in Japanese as a separator between names.
Other related symbols
Additional symbols in Unicode related to the equals sign include:[10]
• (U+224C all equal to)
• (U+2254 colon equals)
• (U+2255 equals colon)
• (U+2256 ring in equal to)
• (U+2257 ring equal to)
• (U+2259 estimates)
• (U+225A equiangular to)
• (U+225B star equals)
• (U+225C delta equal to)
• (U+225E measured by)
• (U+225F questioned equal to).
Incorrect usage
The equals sign is sometimes used incorrectly within a mathematical argument to connect math steps in a non-standard way, rather than to show equality (especially by early mathematics students).
For example, if one were finding the sum, step by step, of the numbers 1, 2, 3, 4, and 5, one might write
1 + 2 = 3 + 3 = 6 + 4 = 10 + 5 = 15.
Structurally, this is shorthand for
([(1 + 2 = 3) + 3 = 6] + 4 = 10) + 5 = 15,
but the notation is incorrect, because each part of the equality has a different value. If interpreted strictly as it says, it implies
3 = 6 = 10 = 15 = 15.
A correct version of the argument would be
1 + 2 = 3, 3 + 3 = 6, 6 + 4 = 10, 10 + 5 = 15.[12]
Notes
1. ^ See also geminus and Gemini.
2. ^ "Robert Recorde". MacTutor History of Mathematics archive. Retrieved 19 October 2013.
3. ^ "Comparison Operators". PHP.net. Retrieved 19 October 2013.
4. ^ Doug Crockford. "JavaScript: The Good Parts". YouTube. Retrieved 19 October 2013.
5. ^ why the lucky stiff. "5.1 This One’s For the Disenfranchised". why's (poignant) Guide to Ruby. Retrieved 19 October 2013.
6. ^ Brett Rasmussen (30 July 2009). "Don't Call it Case Equality". Retrieved 19 October 2013.
7. ^ Peter G. Constable; Lorna A. Priest (31 July 2006). Proposal to Encode Additional Orthographic and Modifier Characters (PDF). Retrieved 19 October 2013.
8. ^ Hartell, Rhonda L., ed. (1993). The Alphabets of Africa. Dakar: UNESCO and SIL. Retrieved 19 October 2013.
9. ^ "Unicode Latin Extended-D code chart" (PDF). Unicode.org. Retrieved 19 October 2013.
10. ^ a b "Mathematical Operators" (PDF). Unicode.org. Retrieved 19 October 2013.
11. ^ Gray, Carroll F. (November 2006). "The 1906 Santos=Dumont No. 14bis". World War I Aeroplanes. No. 194: 4.
12. ^ Capraro, Robert M.; Capraro, Mary Margaret; Yetkiner, Ebrar Z.; Corlu, Sencer M.; Ozel, Serkan; Ye, Sun; Kim, Hae Gyu (2011). "An International Perspective between Problem Types in Textbooks and Students' understanding of relational equality". Mediterranean Journal for Research in Mathematics Education 10 (1–2): 187–213. Retrieved 19 October 2013.
References
196799 videos foundNext >
The History of the Equals SignHow did the equal sign originate? We try to answer this question in 2 minutes or less, so learn more about it from this short history of the equality sign. IF you like ... Teaching the equals sign Equal means the sameThis is a very simple song that introduces students to the concept of "equal". In this song, students will hear the repetitive line, "Equal means the same" and the ... Equal, Greater or Less Thanhttp://www.mathsisfun.com/equal-less-greater.html As well as the familiar equals sign (=) it is also very useful to show if something is not equal to, greater than, ... Happy Equals SignAn Important Tip in Algebra is to Keep the Equals Sign Happy! ENTER is your Equals Sign TI 84 Calculator Introductionhttp://mcstutoring.com/ Private math tutoring and test preparation in Huntington Beach, CA. Subjects include ACT, SAT 1, algebra, geometry, and calculus. Comparing Decimals with Inequality and Equals Sign PHP Tutorial Video 6: More Variables, Numbers, and Plus Equals SignIn this PHP Tutorial, we'll look at numbers, and how to manipulate them with PHP. 1B CCSS 1 Understanding the Equals SignDr. Karlene Johnson, Greenville College, presents this topic as part of a series of lessons on the Common Core Standards for mathematics education. cuisenaire rods the way of zen 090 the equals signThe origin of the equals sign and its evolution towards "is equivalent to". This is for the benefit of young learners who will not fear mathematics. The music is one ...
196799 videos foundNext >
669 news items
Huffington Post If We're Winning the Battle for Equality, Why Do People Keep Yelling "Faggot?" Huffington Post Wed, 26 Aug 2015 14:00:00 -0700 The team gets requests for their team T-shirt, an outline of the state of Alabama with an equals sign. People no longer have to whisper that they support the team. "I'm pleased with how supportive Montgomery has been," she says. Already this year her ... Rochester Democrat and Chronicle How to survive your freshman year in college Rochester Democrat and Chronicle Fri, 14 Aug 2015 08:55:33 -0700 When considering your next living situation, think “choice equals better” not “choice equals cool equals sign lease on building that should be condemned.” 4. Eat calories, don't drink them. You will consume additional calories. Despite the myths ... BGR 8 awesome iPhone and iPad apps on sale for free for a limited time BGR Tue, 04 Aug 2015 07:10:35 -0700 Instant Calculation calculates the formula as you type, so you never have to use the equals sign. We spare you one unnecessary tap at a time. ## You can start your calculations on your iPhone, then Continue on your Apple Watch, and the other way around. ABC Online Are calculators killing our ability to work it out in our head? ABC Online Sun, 09 Aug 2015 15:52:30 -0700 The child can explore the pattern made by entering 11+11 and continuing to press the equals sign to see what happens to the pattern once you count beyond 99 by 11s. Calculators have great potential in concept development. For example, what happens ... Review: Nyko PS4 Type Pad Hardcore Gamer Thu, 13 Aug 2015 08:00:00 -0700 A number of the keys, such as the equals sign and greater than, have also been assigned to the top most letters (below the numbers) and only require the Shift key to be pushed to access them. While these are usable design changes, the shift key is ... Hacklet 70 – Calculator Projects Hackaday Fri, 14 Aug 2015 16:00:43 -0700 No equals sign needed here; [Joey] designed this calculator to work with Reverse Polish notation, just like many of HP's early machines. Stacks are pretty important for RPN calculators, and this one has plenty of space with dual 200 layer stacks. The ... The Australian Financial Review Apps to help calm your everyday stress and anxieties The Australian Financial Review Thu, 30 Jul 2015 20:41:26 -0700 To cope with anxiety and stress, Opa would pour himself a cognac, sit in his room and complete complicated maths equations. Balancing the figures on each side of the equals sign was calming and a feeling of fresh satisfaction settled on his shoulders ... The Gay UK 1000 Anti-Gay Marriage Billboards To Be Erected In The USA The Gay UK Mon, 03 Aug 2015 01:48:42 -0700 The 14 foot by 48 foot billboard, shows icons of 1 man and one woman with the word "Marriage" and the equals sign. Underneath the tagline reads, "Please, I need your help with this! -God." The Church said,. "This billboard is funded 100% by the your ...
Limit to books that you can completely read online Include partial books (book previews) .gsc-branding { display:block; }
Oops, we seem to be having trouble contacting Twitter
Support Wikipedia
A portion of the proceeds from advertising on Digplanet goes to supporting Wikipedia. Please add your support for Wikipedia!
Searchlight Group
Digplanet also receives support from Searchlight Group. Visit Searchlight
Copyright © 2009-2015 Digparty. All rights reserved.
|
2015-08-28 07:38:56
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4476526975631714, "perplexity": 3660.037629447381}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-35/segments/1440644062327.4/warc/CC-MAIN-20150827025422-00151-ip-10-171-96-226.ec2.internal.warc.gz"}
|
http://mathematica.stackexchange.com/questions/603/future-proofing-access-to-packed-array-tools
|
Most of the Mathematica users beyond beginner level will be aware of the phenomenon of Packed Arrays. The user-accessible functions related to packed arrays live in the Developercontext and have been there for quite some time. I wonder what this means for their future use.
Is Developer more stable than Experimental? Can we expect this functionality to move into the kernel and what calling strategies could we adopt to minimize the effects such a move would have?
-
I don't think that Developer is going to go away; there is too much (also internal) stuff depending on it. What I do at the beginning of a package:
pack = DeveloperToPackedArray;
packedQ = DeveloperPackedArrayQ;
then only use those; if anything changes then it's only one place I need to change it. On the other hand a re-factoring: of DeveloperToPackagedArray is not the end of the world.
Concerning moving this to the kernel: unlikely. It has not been done in the past (for probably good reasons), why should it happen now. I don't think there is generally a way to classify stability of packages; if it is in the kernel, it is more stable than if it is in a package that you have to explicitly load.
-
What would be nice if the Developer package would get loaded by default. Then it would not matter if people type DeveloperToPackedArray or ToPackedArray. Just like JLink these days (which did not load by default on startup until Mathematica 6). – Rolf Mertig Jan 24 '12 at 18:36
@RolfMertig, I'll mention that, but I have a feeling that this is not going to happen. – user21 Jan 24 '12 at 20:06
|
2014-09-20 20:04:35
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3803074359893799, "perplexity": 797.7027095099124}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-41/segments/1410657133564.63/warc/CC-MAIN-20140914011213-00004-ip-10-196-40-205.us-west-1.compute.internal.warc.gz"}
|
http://techtalks.tv/talks/extractors-for-circuit-sources/54707/
|
Please help transcribe this video using our simple transcription tool. You need to be logged in to do so.
## Description
We obtain the first deterministic extractors for sources generated (or sampled) by small circuits of bounded depth. Our main results are: (1) We extract $k (k/nd)^{O(1)}$ bits with exponentially small error from $n$-bit sources of min-entropy $k$ that are generated by functions $f : \{0,1\}^\ell \to \{0,1\}^n$ where each output bit depends on $\le d$ input bits. In particular, we extract from $NC^0$ sources, corresponding to $d = O(1)$. (2) We extract $k (k/n^{1+\gamma})^{O(1)}$ bits with super-polynomially small error from $n$-bit sources of min-entropy $k$ that are generated by $\poly(n)$-size $AC^0$ circuits, for any $\gamma > 0$. As our starting point, we revisit the connection by Trevisan and Vadhan (FOCS 2000) between circuit lower bounds and extractors for sources generated by circuits. We note that such extractors (with very weak parameters) are equivalent to lower bounds for generating distributions (FOCS 2010; with Lovett, CCC 2011). Building on those bounds, we prove that the sources in (1) and (2) are (close to) a convex combination of high-entropy bit-block'' sources. Introduced here, such sources are a special case of affine ones. As extractors for (1) and (2) one can use the extractor for low-weight affine sources by Rao (CCC 2009). Along the way, we exhibit an explicit boolean function $b : \{0,1\}^n \to \{0,1\}$ such that $\poly(n)$-size $AC^0$ circuits cannot generate the distribution $(x,b(x))$, solving a problem about the complexity of distributions. Independently, De and Watson (ECCC TR11-037) obtain a result similar to (1) in the special case $d = o(\lg n)$.
|
2019-07-20 03:21:05
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8845348358154297, "perplexity": 945.8633022043917}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195526408.59/warc/CC-MAIN-20190720024812-20190720050812-00342.warc.gz"}
|
https://andrewtarzia.github.io/posts/2021/11/poremapper-post/
|
# PoreMapper: Python package for mapping molecular pores
## Why?
I work mostly with metal-organic cages and, in that field, the pore is often visualised with a software called VOIDOO (see here), which makes very pretty images. I wanted to recreate that, quickly (just for visualisation) and in Python (to interface with an stk molecule). I initially planned on performing cheap dynamics on what I termed a Blob inside the cage, allowing it to mould to the interior surface. However, that was overcomplicating the issue. Instead, just inflate a balloon inside the pore!
An example usage that highlights “why” is available as part of my YouTube tutorials:
## How?
I will start by noting that a lot of the more frustrating parts of this code were taken directly for pyWindow, which was developed by Marcin Miklitz during his time in the Jelfs group. I thank him for saving me some time! Additionally, I must thank Austin Mroz, a postdoc in the Jelfs group, who shared with me the atomic radii from their recent work: STREUSEL (paper here). These radii are used for all Atoms in the Host class.
PoreMapper provides a Host class, which reads in XYZ coordinates and atom types: this is the cage of interest. The calculation is handled by the Inflater class, which takes only one argument: the bead_sigma or radius of the Beads that will be used to map the pore (i.e., resolution). The Inflater has two methods: get_inflated_blob and inflate_blob, which perform the same process, except get_inflated_blob only yields the final result, not each step.
The process begins with a Blob made up of Beads in an idealised spherical geometry with radius of 0.1 Angstrom and a number of beads defined by the size of the Host. The Blob is placed at the centroid of the Host. Over 100 steps, the position of each Bead in the Blob is translated outwards in small increments until the maximum diameter of the Host is reached. If at any point a Bead is within contact distance (bead radii + atom radii) of a Host atom, it is no longer moved in following steps and added to the Pore class (a subset of beads in the initial Blob). The output of the calculation is an InflationResult, which contains the Blob and Pore for futher analysis.
A Blob provides pathways out of the molecule, which we analyse, by clustering the points (MeanShift usage from sklearn), to find the windows of the Host. This process is currently limited (see below) and pyWindow is recommended! Regardless, the visualisation of the pathways, and collection of those coordinates, may be useful. This figure shows the inflation of the blob in CC3:
A Pore provides a visualisation of the inside of Host and the class provides analyses including get_mean/max_distance_to_com for pore radii, get_volume for pore volume and get_asphericity for pore shape. Again, the key for me was visualisation. This figure shows the inflation of the pore in CC3:
Most importantly, PoreMapper is easy to use in a Python project! Here is a code example of running an analysis of a host from an XYZ file:
import pore_mapper as pm
# Read in host from xyz file.
host = pm.Host.init_from_xyz_file(path=f'{name}.xyz')
host = host.with_centroid([0., 0., 0.])
# Define calculator object.
# Run calculator on host object, analysing output.
final_result = calculator.get_inflated_blob(host=host)
# Analysis.
windows = final_result.pore.get_windows()
print(f'windows: {windows}, pore_volume: {pore.get_volume()}')
# Write final structure.
host.write_xyz_file(f'{name}_final.xyz')
final_result.pore.get_blob().write_xyz_file(f'{name}_blob_final.xyz')
final_result.pore.write_xyz_file(f'{name}_pore_final.xyz')
## Examples and limitations.
A Blob provides pathways out of the molecule, and from these points, we provide window clustering/detection. However, the window calculation is the most costly part currently, and is not perfect. The figure below shows a metal-organic cage with four windows, where PoreMapper detects two. Additionally, you can see (black arrow) that the Pore has some imperfections based on beads being outside of the cavity.
The figure below shows some more examples of pores and blobs (purple on the right; all others have equivalent blobs and pores because there are no windows!) for multiple metal-organic cages. Importantly, to produce the coordinate files for this analysis takes a couple of seconds! Although I could spend ages making the figures pretty in pymol…
On the left, we see multiple cages with no windows, the one on the right is entirely nonporous. The volumes calculated for the first three are within ~200 Angstrom^3 of reported VOIDOO volumes (a paper on this), but I would suggest that changes in bead diameter and resolution could be the cause of this (warning of the sensitivity).
## What next?
It is available on GitHub and can be installed through pip!
A series of examples are provided here. This package is small and after spending a short amount of time writing it and being very happy with the outcome, for visualisation at least, I decided that merging it with pyWindow (more code from the Jelfs group: pyWindow) would be best. This would include rewrite/clean-up/improvements/bug-fixes to pyWindow, which I hope to report on soon!
Please, test it, use it, break it and send me feedback!
|
2022-06-25 07:36:49
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5344769358634949, "perplexity": 2198.9495832916446}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103034877.9/warc/CC-MAIN-20220625065404-20220625095404-00432.warc.gz"}
|
https://indico.cern.ch/event/751767/contributions/3775865/
|
# 10th International Conference on Hard and Electromagnetic Probes of High-Energy Nuclear Collisions
May 31, 2020 to June 5, 2020
Online
US/Central timezone
## Testbeam Results for the sPHENIX TPC Prototype
Jun 2, 2020, 7:30 AM
1h 20m
Online
#### Online
Poster New Experimental Developments
### Speaker
Henry Klest (Stony Brook University)
### Description
A Time Projection Chamber (TPC) will be the central tracking detector in the sPHENIX experiment. Its main task is to provide a high tracking efficiency and excellent momentum resolution for precise upsilon spectroscopy and jet measurements. The TPC will cover the full azimuth and a pseudorapidity range of up to $\pm$ 1.1.
A small scale prototype TPC with a radial extension of 40 cm and a similar drift length has been manufactured which can accommodate a full size amplification module as for the sPHENIX TPC.
The prototype has been exposed to a 120 GeV proton beam at the Fermilab Test Beam Facility (FTBF). The results of the test-beam campaigns including SAMPA readout electronics will be presented.
Track New Experimental Developments Poster sPHENIX
### Primary author
Marzia Rosati (Iowa State University)
### Presentation materials
HP2020 Klest.pdf HP2020 Klest.pptx Klest_Poster_Video.mp4 Zoom Link
|
2023-03-24 13:26:47
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.36402374505996704, "perplexity": 12982.239276385435}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296945282.33/warc/CC-MAIN-20230324113500-20230324143500-00409.warc.gz"}
|
http://crypto.stackexchange.com/tags/dictionary-attack/hot?filter=year
|
# Tag Info
Suppose the server did not include $v$ in the computation of $B$. In such case the following events have happened: The server has sent a salt value $s$ to the client. We might assume it is authentic (because it is easy for the fake server to get it from the real server). The client re-calculates its long term private key $x$ such that $v = g^x$. The client ...
|
2014-04-21 14:48:13
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4527665376663208, "perplexity": 642.9279440182852}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-15/segments/1397609540626.47/warc/CC-MAIN-20140416005220-00575-ip-10-147-4-33.ec2.internal.warc.gz"}
|
https://piping-designer.com/index.php/properties/electrodynamics/2773-lightening-strike-distance
|
# Lightning Strike Distance
on . Posted in Electromagnetism
## Lightning Strike Distance Formula
$$\large{ d = a \; t }$$
### Where:
Units English Metric $$\large{ d }$$ = lightning strike distance $$\large{mi}$$ $$\large{km}$$ $$\large{ a }$$ = speed of sound $$\large{\frac{ft}{sec}}$$ $$\large{\frac{m}{s}}$$ $$\large{ t }$$ = elapsed time between seeing the flash and hearing thunder $$sec$$ $$s$$
|
2023-04-01 20:06:49
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3176807761192322, "perplexity": 3494.8002023374565}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296950247.65/warc/CC-MAIN-20230401191131-20230401221131-00313.warc.gz"}
|
https://electronics.stackexchange.com/questions/398524/3-3v-zener-diode-shunt-voltage-regulator-giving-a-4-3v-output
|
# 3.3v Zener Diode Shunt Voltage Regulator giving a 4.3v output
We are trying to use a zener diode shunt circuit to develop a voltage regulator.
• Our input voltage is 5v.
• Our desired output voltage is 3.3v.
• The average load current is 80mA.
• The peak load current is 150mA.
We assumed the load current to be 150mA.
We used a Zener diode of 3.3v and 0.5W. Based on this, we concluded that the current through the Zener diode is 150mA.
Thus, the total current is 300mA.
Based on this, we calculated the current limiting resistor value to be 5.6 ohms and 0.5W.
When we actually connected the circuit, we noticed that the output voltage across the Zener diode was coming out to be 4.3v instead of 3.3v and it starts to heat up gradually. Why is this happening?
We then replaced the 5.6 ohm resistor with a 220 ohm resistor and noted that the output voltage was now 3.3v but the current was insufficient (as expected). We then replaced the 220 ohm resistor with two 5.6 ohm resistors in series and found the output voltage to be around 4v. Similarly, with three 5.6 ohm resistors in series and found the output voltage to be around 3.7v.
Questions:
• Are our calculations correct?
• Our assumption is that the voltage across the Zener diode is independent of the current limiting resistor. Why is there an apparent dependence?
• Are there any fundamental errors that we are making?
• Welcome to EE.SE. There is a CircuitLab schematic button on the editor toolbar. Add in the schematic so that we're all clear about how it is wired. Please also add a link to the Zener datasheet. – Transistor Sep 29 '18 at 9:11
• Data sheet link for the zener in question? – Spehro Pefhany Sep 29 '18 at 9:11
• As with any diode, because of the silicon region outside of the "junction" having non-zero resistance, at high currents the Ohms Law voltage will be significant. You found that region. – analogsystemsrf Sep 29 '18 at 17:31
Zener diodes are fairly imperfect devices; they are rated to produce their nominal output voltage at a certain current range and are about ten times better than just using a potential divider to create a regulated voltage but, as always, you must read the small print on the device and that is typically centred around using them for low power applications.
If you put too much current into them their terminal voltage will rise beyond their rated nominal output level so, you must use them as their data sheet defines or expect bad results. Here's a picture of what the output voltage can look like with varying current passing into the device: -
Picture source. As you can see the zener voltage does depend on current that flows into the device and you should not look at pictures like the one below and assume that it produces a constant output voltage: -
The picture above gives a false impression of perfect regulation once a certain current is exceeded.
I would say that your application requires a 3-terminal linear voltage regulator.
You have a fundamental misconception about how a shunt regulator works.
The key idea is that you size the series resistance for the peak load current by itself. Then, whenever the load does not actually draw that peak current, the Zener diode "shunts" the excess current to ground. In other words, when the load current goes up, the Zener current goes down, and vice-versa. The Zener dissipates the maximum power when the load is drawing its minimum current.
|
2019-11-15 17:29:21
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5638590455055237, "perplexity": 861.0375638307795}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-47/segments/1573496668699.77/warc/CC-MAIN-20191115171915-20191115195915-00280.warc.gz"}
|
https://math.stackexchange.com/questions/1643222/find-the-percent-of-boys-and-girls
|
# Find the percent of boys and girls
I have a basic school academic question which despite of trying very hard I was unable to find a solution -
Average score of girls is an exam is $67$ and that of boys is $62$. Find the percentage of girls and boys?
I think the question is incomplete - cause average is nothing but addition of each student marks divided by total number of student - and I was never able to find the solution - is my understanding correct - does an answer exists?
|
2019-10-19 07:58:50
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4974381625652313, "perplexity": 373.661260316727}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570986692126.27/warc/CC-MAIN-20191019063516-20191019091016-00147.warc.gz"}
|
https://www.encyclopediaofmath.org/index.php/Lie_group,_derived
|
# Lie group, derived
The commutator subgroup of a Lie group. For any Lie group $G$ its derived Lie group $[G,G]$ is a normal (not necessarily closed) Lie subgroup of $G$. The corresponding ideal of the Lie algebra $\mathfrak g$ of the group $G$ coincides with the commutator algebra $[\mathfrak g,\mathfrak g]$ (also called the derived Lie algebra of $\mathfrak g$). The commutator subgroup of a simply-connected (or connected linear) Lie group $G$ is always closed in $G$.
|
2019-02-20 08:02:59
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7947283387184143, "perplexity": 103.30602882591724}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-09/segments/1550247494485.54/warc/CC-MAIN-20190220065052-20190220091052-00296.warc.gz"}
|
https://hktutorcenter.com/kroger-recall-rpik/phase-of-oscillation-formula-2fc746
|
# phase of oscillation formula
The image below shows a typical RC phase shift oscillator circuit with a BJT: RC phase shift oscillator with a transistor. First find the transmittance of the 3 RC blocks and the one of your amplifier. French give discontiunity as i showed u on the grpahs. Two new quadrature oscillator circuits using operational amplifiers are presented. By applying phase analysis methods, we showed that PV cells in the PFC exhibited robust phase-locked firing to high-frequency oscillations (100–250 Hz) and delta rhythms (1–4 Hz), but poor coupling to gamma (30–80 Hz) or theta (4–8 Hz) oscillations. When the preexisting jet is located more northward (southward), the induced dipole can have a low-over-high (high-over-low) structure and thus can make the center of the stationary wave anomaly shift southward (northward), which can be regarded as an initial state or embryo of a positive (negative) phase North Atlantic Oscillation (NAO). Fig. For example, in a transverse wave traveling along a string, each point in the string oscillates back and forth in the transverse direc-tion (not along the direction of the string). Formulas for Oscillations & Waves. A set of coupled adjoint equations for phase sensitivity functions, which characterize the phase response of the collective oscillation to small perturbations applied to individual elements, is derived. • The oscillator excess open-loop gain (which is necessary for initial oscillator build-up) should be minimized in order to prevent amplitude fluctuations from being converted into significant frequency fluctuations. The significance of using a Clapp oscillator over a colpitt oscillator is that the frequency stability of the Clapp oscillator is more. Then apply Barkhausen's criteria for phase shift: the sum of the phase shifts from the two transmittance must be equal to zero for an oscillation to exist. Mechanical oscillations - Phase of harmonic oscillations: φ - phase , ν - frequency , t - time Let's start by the Limit Cycle . So, x corresponds to q. While the phase shift network of the clapp oscillator consists of three capacitor and one inductor. • Figure illustrates an oscillator with a small amount of damping. • The decrease in amplitude is called damping and the motion is called damped oscillation. Both oscillations waggle back and forth and we will assume that both do it at the same frequency. Acceleration – we can calculate the acceleration of the object at any point in it’s oscillation using the equation below. Phase of oscillation March 4, 2014 The concept of the phase is a way of comparing two oscillations which are occuring at the same time. Under forced oscillation, the phase of harmonic motion of the particle differs from the phase of the driving force. Moreover, the feedback factor gets affected in Colpitts oscillator. For a block of mass m oscillating with frequency ω 0 , the equation is: d t 2 d 2 x + ω 0 2 x = 0 Here, ω 0 = m k , and k is the spring constant. The frequency of oscillation is given by and the phase shift is 180 o. The Phase shift oscillator can be made as variable phase shift oscillator which can produce a wide range of frequencies depending on the pre-set value determined. 3.1.3 Loading Effect . One of the conditions for oscillation is that the (regenerative) feedback loop must provide a 180 degree phase shift. Figure 16.10: Operational amplifier phase-shift oscillator The feedback portion of the oscillator can be derived by applying Kirchhoff’s current law at node a and node b respectively. The frequency of the oscillation (in hertz) is , and the period is . Similarity between electrical and mechanical oscillations - definition The LC oscillation is similar to the mechanical oscillation of a blocka ttached to a spring. An important question is the asymptotic (for $\epsilon \rightarrow 0$) calculation of the phase trajectory of the relaxation oscillation of the system (1), and the establishment of asymptotic formulas for the characteristics of this oscillation — its period, amplitude, etc. This thing only gets as big as .2, so it's easy though. So, let's say our amplitude for a particular simple harmonic oscillator happened to be .2 meters, that would mean that this here, I can represent this here with .2 meters, this doesn't even make it to one. However, we still have little understanding of how some cells can exhibit calcium oscillations with a period of less than a second, whereas other cells have oscillations with a period of hundreds of seconds. Example W3 The equation of a transverse sinusoidal wave is given by: . But derviations according to Vibration and Waves by A.P. The proper way to derive the oscillation frequency from this oscillator is to go back to Barkhausen's oscillation criteria. But they do not identically track each other. The second order differential equation describing the damped oscillations in a series $$RLC$$-circuit we got above can be written as Its circuit is shown in Fig. Both proposed quadrature oscillators are based on third-order characteristic equations. Answer W2. However, in this case the time constant (inverse of the oscillation frequency) is identical to the first formula as given by you (involving SQRT[3]). Find the phase difference between a point 0.3m from the peak of a wave and another point 0.7m further along from the same peak. The time for one oscillation is called the period (T) it is measured in seconds. If you look at the above equations for phase shift and output frequency, it should be obvious that there is a complex nonlinear relationship between these two values. This is due to the fact that, for a regenerative effect, the signal must undergo n*360 degrees phase shift: 180 from the amplifier and another 180 from the feedback network. For each pair-wise relation between ROIs for each subject, a PLV was calculated for each frequency of interest (1–49 Hz in 1-Hz intervals). Resulting in a total phase-shift of 360° or 0° which is the required condition for oscillation. This formula is called the Thomson formula in honor of British physicist William Thomson $$\left(1824-1907\right)$$, who derived it theoretically in $$1853.$$ Damped Oscillations in Series $$RLC$$-Circuit. This is due to the presence of an extra capacitor. Damped oscillations • Real-world systems have some dissipative forces that decrease the amplitude. As an example, … Oscillations David Morin, morin@physics.harvard.edu A wave is a correlated collection of oscillations. The variable $$\omega$$ is called the circular or cyclic frequency of oscillation. Oscillations in the concentration of free cytosolic calcium are an important control mechanism in many cell types. 3.1.1 High Pass Fig. How on earth could be phase angle not only discontinuous but also negative. A phase-shift oscillator is a linear electronic oscillator circuit that produces a sine wave output. The frequency (f) of an oscillation is measure in hertz (Hz) it is the number of oscillations per second. The negative gain of the amplifier stage (-K) will add another 180° phase-shift. 16.10. The Van der Pol oscillator can be represented by the following differential equations: \begin{aligned} \dot{x}&=y \\ \dot{y}&=\mu(1-x^2)y-x\end{aligned} where \mu is a scalar parameter indicating the damping strength. • The mechanical energy of a damped oscillator decreases continuously. In this tutorial, we will learn how to draw the phase portrait of Van-Der-Pol oscillator in LaTeX using TikZ and Pgfplots. 4.1 Phase-shift Oscillator using Op-Amp: The op-amp is used in the inverting mode; therefore, any signal that appears at the inverting terminal is shifted by 180° at the output. Thus, the phase of theta band oscillations may be critical for the coordination of neural activity [22,27]. • Know relevant formulae for the frequency of oscillation. [See Equations -.] General Equation of sine wave - Phase Difference, Wave speed, How to prepare Oscillations & Waves. grounded base oscillator rather than the Colpitts oscillator. • Describe the advantages of buffered phase shift oscillators. Outputs of two sinusoidal signals with 90° phase difference are available in each circuit configuration. Oscillation occurs at the frequency where the total phase shift through the 3 RC circuits is 180°. It is related to the period of oscillation $$T$$ by the formula The key contributions are: (1) to predict the phase noise correctly using the large signal time domain calculations (Bessel functions) and nonlinear CAD simulators and derive a set of algebraic equations for the noise calculations (many The operational amplifier phase-shift oscillator is another oscillator type that meets the principles of oscillator design. This formula is only applicable if the phase shift network uses same Resistance and capacitance value, that means R1 = R2 and C1 = C2 = C3. When solving questions for both these topics always keep in mind that your concepts should be clear. The frequency and period of the oscillation are both determined by the constant , which appears in the simple harmonic oscillator equation, whereas the amplitude, , and phase angle, , are determined by the initial conditions. In these formulas, $$A$$ means the amplitude of oscillation, $${\omega t + {\varphi _0}}$$ is the phase of oscillation, $${{\varphi _0}}$$ is the initial phase at time $$t = 0.$$ Figure 2. So, if I just left this as cosine, that would say this thing's gonna get as big as one at some point in time and that's a lie. \$\endgroup\$ – LvW Apr 22 '14 at 14:34 add a comment | At least his equations give discontinuity. Oscillations. Using the phase sensitivity functions, collective oscillation of the network under weak perturbation can be described approximately by a one-dimensional phase equation. Time period for spring oscillator, Time period for simple pendulum, Waves. 3.1.2 Three Cascaded High Pass Filters Fig. One has its maximum excursion at a different time than the other for example. ... Phase-locking calculation. It would physically mean the mass-spring system is oscillating BEFORE driving force. Extra capacitor will learn How to prepare oscillations & Waves wave output 3 RC circuits is 180° weak can... Functions, collective oscillation of the conditions for oscillation is that the ( ). Different time than the other for example the image below shows a typical RC phase shift is 180.. Give discontiunity as i showed u on the grpahs, so it easy... Is 180 o we will assume that both do it at the of. W3 the equation of a wave and another point 0.7m further along from the peak of a transverse sinusoidal is. Of a damped oscillator decreases continuously affected in Colpitts oscillator • Figure illustrates an oscillator with a BJT: phase... A transverse sinusoidal wave is given by: feedback loop must provide a 180 degree shift. Image below shows a typical RC phase shift oscillator circuit that produces a sine wave output always keep in that... Your amplifier which is the number of oscillations per second showed u on the grpahs to 's! Two new quadrature oscillator circuits using operational amplifiers are presented is called damping and the of! Coordination of neural activity [ 22,27 ] of your amplifier of Van-Der-Pol oscillator in LaTeX using and. The presence of an oscillation is measure in hertz ( Hz ) it is measured in seconds in many types! Motion is called damped oscillation will learn How to draw the phase shift oscillator with transistor... Linear electronic oscillator circuit that produces a sine wave - phase difference, wave speed, How prepare. Amount of damping will assume that both do it at the frequency f. Signals with 90° phase difference are available in each circuit configuration the Clapp oscillator is.. These topics always keep in mind that your concepts should be clear period of oscillation \ \omega\. Of using a Clapp oscillator consists of three capacitor and one inductor gets affected in Colpitts oscillator acceleration the... Circuit configuration derive the oscillation frequency from this oscillator is more give discontiunity as i showed u the! Shift oscillator circuit with a BJT: RC phase shift oscillator with a BJT: RC phase is. A sine wave output total phase-shift of 360° or 0° which is the required for. - phase difference between a point 0.3m from the same peak RC circuits is 180° the total phase oscillator! Oscillations waggle back and forth and we will learn How to prepare oscillations & Waves, oscillation. A point 0.3m from the peak of a blocka ttached to a spring point in it ’ s using. One oscillation is measure in hertz ( Hz ) it is related to the of... T ) it is the number of oscillations per second called the circular or cyclic of. Of oscillation a 180 degree phase shift oscillator with a small amount of damping ) is called the of. The mechanical energy of a damped oscillator decreases continuously 0° which is the number of oscillations per second the is... According to Vibration and Waves by A.P gain of the object at any point in it ’ s using... Wave - phase difference are available in each circuit configuration wave is given by: oscillator... Calcium are an important control mechanism in many cell types and one inductor oscillator... Activity [ 22,27 ] peak of a blocka ttached to a spring over colpitt! Coordination of neural activity [ 22,27 ] ( Hz ) it is the of. Pendulum, Waves of a damped oscillator decreases continuously add another 180° phase-shift this oscillator another... ( regenerative ) feedback loop must provide a 180 degree phase shift network the! Is more while the phase shift – we can calculate the acceleration of the object at any point it! ) of an extra capacitor circuits using operational amplifiers are presented of buffered phase shift oscillator that! The acceleration of the Clapp oscillator consists of three capacitor and one inductor a oscillator. Is measure in hertz ( Hz ) it is the required condition for oscillation the acceleration of conditions. Frequency of oscillation is measure in hertz ( Hz ) it is the condition! The grpahs must provide a 180 degree phase shift oscillator with a BJT RC... Figure illustrates an oscillator with a transistor principles of oscillator design collective oscillation of blocka. Oscillation \ ( \omega\ ) is called the period of oscillation is given by: oscillating driving! Prepare oscillations & Waves, Waves i showed u on the grpahs phase oscillators. In each circuit configuration 0.3m from the same peak the advantages of buffered phase is! Its maximum excursion at a different time than the other for example amplifier stage ( -K ) will another! Know relevant formulae for the frequency where the total phase shift oscillator circuit with a small amount of.. Gets affected in Colpitts oscillator first find the phase shift oscillator circuit that produces phase of oscillation formula sine -. The peak of a transverse sinusoidal wave is given by and the motion is called damping the! Equation below as i showed u on the grpahs measure in hertz ( ). Oscillator type that meets the principles of oscillator design band oscillations may be critical for the coordination of activity... Has its maximum excursion at a different time than the other for example illustrates. And forth and we will assume that both do it at the same peak mechanism in cell! 180 o oscillation of the Clapp oscillator is a linear electronic oscillator circuit that produces a sine output. Same frequency acceleration of the amplifier stage ( -K ) will add another 180° phase-shift wave and point... Easy though a total phase-shift of 360° or 0° which is the required for. Be clear excursion at a different time than the other for example Clapp oscillator another! Functions, collective oscillation of the amplifier stage ( -K ) will add another 180°.... Your concepts should be clear are presented the required condition for oscillation is given by.! By A.P a blocka ttached to a spring to go back to Barkhausen 's oscillation criteria transverse wave. Is related to the presence of an oscillation is given by and the of... Motion is called damped oscillation this oscillator is more a typical RC phase shift is 180 o of the RC! The negative gain of the amplifier stage ( -K ) will add another 180° phase-shift shows a typical RC shift. Electronic oscillator circuit with a small amount of damping new quadrature oscillator circuits using operational amplifiers are..
|
2021-03-01 01:21:24
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8363360166549683, "perplexity": 1088.6767381411432}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178361808.18/warc/CC-MAIN-20210228235852-20210301025852-00071.warc.gz"}
|
http://perso.astrophy.u-bordeaux.fr/~jleconte/exo_k-doc/autoapi/exo_k/cia_table/index.html
|
# exo_k.cia_table¶
@author: jeremy leconte
A class to handle continuum absorption (CIA)
## Module Contents¶
class Cia_table(*filename_filters, filename=None, molecule_pair=None, search_path=None, mks=False, remove_zeros=False, old_cia_unit='cm^5')[source]
A class to handle CIA opacity data tables.
Initialization for Cia_tables.
Parameters
• filename (str, optional) – Relative or absolute name of the file to be loaded.
• filename_filters (sequence of string) – As many strings as necessary to uniquely define a file in the global search path defined with exo_k.settings.Settings.set_cia_search_path(). This path will be searched for a file with all the filename_filters in the name. The filename_filters can contain ‘*’.
• molecule_pair (list of size 2, optional) – The molecule pair we want to consider, specified as an array with two strings (like [‘H2’,’H2’] or [‘N2’,’H2O’]). The order of the molecules in the pair is irrelevant.
Other Parameters
• old_cia_unit (str, optional) – String to specify the current cia unit if it is unspecified or if you have reasons to believe it is wrong (e.g. you just read a file where you know that the cia grid and the cia unit do not correspond). Available units are: ‘cm^5’, ‘cm^2’ that stand for cm^2/amagat, and ‘cm^-1’ that stand for cm^-1/amagat^2.
• remove_zeros (boolean, optional) –
If True, the zeros in the kdata table are replaced by
a value 10 orders of magnitude smaller than the smallest positive value
• search_path (str, optional) – If search_path is provided, it locally overrides the global search path defined with exo_k.settings.Settings.set_cia_search_path() and only files in search_path are returned.
read_hitran_cia(self, filename, old_cia_unit='cm^5')[source]
Reads hitran cia files and load temperature, wavenumber, and absorption coefficient grid.
Parameters
• filename (str) – Name of the file to be read.
• old_cia_unit (str, optional) – Units found in the file.
read_hdf5(self, filename)[source]
Reads hdf5 cia files and load temperature, wavenumber, and absorption coefficient grid.
Parameters
filename (str) – Name of the file to be read.
write_hdf5(self, filename)[source]
Writes hdf5 cia files.
Parameters
filename (str) – Name of the file to be written.
sample(self, wngrid, remove_zeros=False, use_grid_filter=False, **kwargs)[source]
Method to re sample a cia table to a new grid of wavenumbers (inplace).
Parameters
• wngrid (array) – new wavenumber grid (cm-1)
• use_grid_filter (boolean, optional) – If true, the table is sampled only within the boundaries of its current wavenumber grid. The coefficients are set to zero elswere (except if remove_zeros is set to True). If false, the values at the boundaries are used when sampling outside the grid.
sample_cp(self, wngrid, **kwargs)[source]
Creates a copy of the object before resampling it.
Parameters
sample method for details. (See) –
Returns
the re-sampled Cia_table
Return type
Cia_table object
interpolate_cia(self, t_array=None, log_interp=None, wngrid_limit=None)[source]
interpolate_cia interpolates the kdata at on a given temperature profile.
Parameters
• t_array (float or array) – Temperature array to interpolate to. If a float is given, it is interpreted as an array of size 1.
• wngrid_limit (array, optional) – If an array is given, interpolates only within this array.
• log_interp (bool, optional) – Whether the interpolation is linear in kdata or in log(kdata).
Returns
The interpolated kdata.
Return type
array of shape (logp_array.size, self.Nw)
equivalent_xsec(self, logP, T, x_mol2, wngrid_limit=None)[source]
Computes the cross section due to CIA in area per molecule of type 1.
effective_cross_section(self, logP, T, x_mol1, x_mol2, wngrid_limit=None)[source]
Computes the total cross section for a molecule pair (in m^2 per total number of molecules; assumes data in MKS).
Parameters
• logP (float or array) – Log10 of the pressure (Pa).
• T (float or array) – Temperature (K).
• x_mol1/2 (float or array) – Volume mixing ratio of the 1st and 2nd molecule of the pair.
• wngrid_limit (array, optional) – If an array is given, interpolates only within this array.
Returns
total cross section for the molecule pair in m^2 per total number of molecules.
Return type
float or array
plot_spectrum(self, ax, t=200.0, x_axis='wls', xscale=None, yscale=None, **kwarg)[source]
Plot the spectrum for a given point
Parameters
• ax (pyplot.Axes) – A pyplot axes instance where to put the plot.
• t (float) – temperature(K)
• x_axis (str, optional) – If ‘wls’, x axis is wavelength. Wavenumber otherwise.
• x/yscale (str, optional) – If ‘log’ log axes are used.
convert_abs_coeff_unit(self, abs_coeff_unit='unspecified', old_abs_coeff_unit='unspecified')[source]
Converts abs_coeff to a new unit (inplace).
Parameters
• abs_coeff_unit (str) – String to identify the units to convert to. Accepts ‘cm^5’, ‘m^5’. or any length^5 unit recognized by the astropy.units library. If =’unspecified’, no conversion is done.
• old_abs_coeff_unit (str, optional) – String to specify the current kdata unit if it is unspecified or if you have reasons to believe it is wrong (e.g. you just read a file where you know that the kdata grid and the kdata unit do not correspond)
convert_to_mks(self)[source]
Converts units to MKS
remove_zeros(self, deltalog_min_value=0.0)[source]
Finds zeros in the abs_coeff and set them to (10.^-deltalog_min_value) times the minimum positive value in the table (inplace). This is to be able to work in logspace.
copy(self)[source]
Creates a new instance of CIA_table object and (deep) copies data into it
read_CKD_cia(self, filename, old_cia_unit='cm^2')[source]
Reads hitran cia files and load temperature, wavenumber, and absorption coefficient grid.
Parameters
filename (str) – Name of the file to be read.
effective_cross_section2(self, logP, T, x_mol1, x_mol2, wngrid_limit=None)[source]
Obsolete.
Computes the total cross section for a molecule pair (in m^2 per total number of molecules; assumes data in MKS).
|
2021-02-26 03:37:51
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2752365171909332, "perplexity": 11785.108717799854}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178356140.5/warc/CC-MAIN-20210226030728-20210226060728-00517.warc.gz"}
|
http://bakoma-tex.com/menu/wish-comments.php?topic=20160601185850.txt
|
True WYSIWYG LaTeX System
### Feature Request Comments
2016/06/01 18:58:50 UTC
Baris Ay
Update the document date
Sometimes I use Bakoma for days, continuously on the same document. When I generate the pdf file, however, it shows the date I first opened the document. Bakoma should update the document's date to the day of the most recent change.
2016/06/10 10:12:24 UTC
Brian Cowan
Presumably you mean the date specified by the LaTeX command \date{\today}. In that case the problem is with LaTeX rather than with BaKoMaTeX.
### You can add own comment by below form:
To add comment you must be signed at Support page.
Go to see all requests
|
2017-03-29 05:20:54
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8586202263832092, "perplexity": 4183.666545920315}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-13/segments/1490218190183.80/warc/CC-MAIN-20170322212950-00437-ip-10-233-31-227.ec2.internal.warc.gz"}
|
https://stats.stackexchange.com/questions/206075/how-to-proceed-with-building-an-ensemble-classifier-using-naive-bayes-tan-and-l
|
# How to proceed with building an ensemble classifier using Naive Bayes, TAN and Logistic Regression in R
I'm relatively new to machine learning (started about 5 months ago), and I'm looking at potentially implementing an ensemble classifier as part of my research.
I have built 3 models that I use to classify whether sales data is going to win or lose. Each model produces the probability of the sale winning or losing, and then I apply thresholds to those to classify them as either a "Win", "Loss" or "Borderline Loss". There are 25 variables, all of which are discrete.
The three models are Naive Bayes, Tree Augmented Naive Bayes (TAN) and Logistic Regression. I am using the bnlearn package for the bayesian classifiers, and a simple glm for the Logistic Regression. All models have high accuracy performances when tested on unseen data:
Naive Bayes Accuracy: 88%
TAN Accuracy: 91%
Logistic Regression Accuracy: 92%
I want to try implementing an ensemble classifier to see if I can get the best possible accuracy across all three models. My question is, how do I go about implementing something like this? I can't find too many examples online, at least not with these models for implementing one. From what I have read, one way to do it is to have a voting system, where if the 2 models predict the sale will win, but 1 predicts with will lose, then it is classified as a win. But what happens in this case if all 3 models had different predictions? I have all my prediction data ready, as in I have all the test data and each models prediction for each sale, my question so is, how would I proceed from here?
If someone knows of any available resources or tutorials that may help, I would greatly appreciate it!
• What does TAN mean?
– Sycorax
Apr 7 '16 at 15:27
• Tree Augmented Naive Bayes. Sorry I'll edit the post to make that clearer
– Eoin
Apr 7 '16 at 15:30
You're discarding information by taking continuous predictions and making them into categories. I would strongly advise against taking that path. Instead, you could (1) average or (2) stack the models. Averaging is straightfoward and requires no additional tuning; on the other hand, all models are weighted equally which might be suboptimal. Stacking adds another layer of learning to train the model on the model outputs against unseen data outcomes.
• What exactly do you mean by discarding information? All the variables I am using are categorical and discrete. I don't see how making them into categories would discard information on them? By averaging, do you mean averaging the actual accuracies? Or averaging the predictions of each individual sale opportunity?
– Eoin
Apr 7 '16 at 15:53
• Instead of knowing $p(\text{win}),$ the categories only tell you if $p(\text{win})>c$ where $c$ is your threshold. The degree of correctness is important, because it captures the difference between 0.9 and 0.51. If c=0.5, then both are treated the same.
– Sycorax
Apr 7 '16 at 15:56
• I'm not sure I follow what you mean. For example take the Naive Bayes classifier. I can get the associated probabilities of Win and Lose for each opportunity. So I then take that probability and apply my thresholds to them like so predictions <- ifelse(naiveprob$Won >= .8, "WIN", ifelse(naiveprob$Won >=.4, "BORDERLINE LOSS", "LOSS")) . The reason I have to do this is because at my job they have a fourth model which categorizes each opportunity into those 3 categories, and I do the same so they are easily comparable, and I can say that my new model performs better than their current one
– Eoin
Apr 7 '16 at 16:04
• My overall goal would be to try and generate an ensemble classifier of the 3 models I have built, and then be able to compare the results of that ensemble to the already existing model my workplace uses. That is why I need to categorize the results into 3 categories
– Eoin
Apr 7 '16 at 16:05
• Yeah, I understand what thresholding means. My point is that it's poor practice because it pretends that 0.81 and 0.99 are the same (both are "wins") even though the difference between 0.81 and 0.99 is sizable. This is an improper scoring rule, and will usually pick the wrong model. This paper provides some more context on why accuracy isn't great pages.cs.wisc.edu/~shavlik/roc.pdf It's better to use a proper scoring rule like Brier score, log-loss, c-statistic, etc depending on what your goal is. If your firm is committed to this procedure, though... who cares what best practice is...
– Sycorax
Apr 7 '16 at 16:09
|
2021-10-17 07:00:58
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4201734960079193, "perplexity": 642.2052153111533}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585121.30/warc/CC-MAIN-20211017052025-20211017082025-00091.warc.gz"}
|
https://nrich.maths.org/public/leg.php?code=-68&cl=2&cldcmpid=2318
|
Search by Topic
Filter by: Content type:
Stage:
Challenge level:
Seeing Squares
Stage: 1 and 2 Challenge Level:
Players take it in turns to choose a dot on the grid. The winner is the first to have four dots that can be joined to form a square.
Paper Partners
Stage: 1 Challenge Level:
Can you describe a piece of paper clearly enough for your partner to know which piece it is?
Paper Patchwork 2
Stage: 1 Challenge Level:
Have a go at making a few of these shapes from paper in different sizes. What patterns can you create?
Paper Patchwork 1
Stage: 1 Challenge Level:
Can you work out what shape is made when this piece of paper is folded up using the crease pattern shown?
Move Those Halves
Stage: 2 Challenge Level:
For this task, you'll need an A4 sheet and two A5 transparent sheets. Decide on a way of arranging the A5 sheets on top of the A4 sheet and explore ...
Circles, Circles
Stage: 1 and 2 Challenge Level:
Here are some arrangements of circles. How many circles would I need to make the next size up for each? Can you create your own arrangement and investigate the number of circles it needs?
How Would We Count?
Stage: 1 and 2 Challenge Level:
An activity centred around observations of dots and how we visualise number arrangement patterns.
Seven Squares
Stage: 3 Challenge Level:
Watch these videos to see how Phoebe, Alice and Luke chose to draw 7 squares. How would they draw 100?
Poly Plug Pattern
Stage: 1 Challenge Level:
Create a pattern on the left-hand grid. How could you extend your pattern on the right-hand grid?
Triple Cubes
Stage: 1 and 2 Challenge Level:
This challenge involves eight three-cube models made from interlocking cubes. Investigate different ways of putting the models together then compare your constructions.
Partly Painted Cube
Stage: 4 Challenge Level:
Jo made a cube from some smaller cubes, painted some of the faces of the large cube, and then took it apart again. 45 small cubes had no paint on them at all. How many small cubes did Jo use?
Mystic Rose
Stage: 4 Challenge Level:
Use the animation to help you work out how many lines are needed to draw mystic roses of different sizes.
Christmas Chocolates
Stage: 3 Challenge Level:
How could Penny, Tom and Matthew work out how many chocolates there are in different sized boxes?
Coded Hundred Square
Stage: 2 Challenge Level:
This 100 square jigsaw is written in code. It starts with 1 and ends with 100. Can you build it up?
Holes
Stage: 1 and 2 Challenge Level:
I've made some cubes and some cubes with holes in. This challenge invites you to explore the difference in the number of small cubes I've used. Can you see any patterns?
Baravelle
Stage: 2, 3 and 4 Challenge Level:
What can you see? What do you notice? What questions can you ask?
Cuboid Challenge
Stage: 3 Challenge Level:
What size square corners should be cut from a square piece of paper to make a box with the largest possible volume?
Eight Hidden Squares
Stage: 2 and 3 Challenge Level:
On the graph there are 28 marked points. These points all mark the vertices (corners) of eight hidden squares. Can you find the eight hidden squares?
Overlapping Again
Stage: 2 Challenge Level:
What shape is the overlap when you slide one of these shapes half way across another? Can you picture it in your head? Use the interactivity to check your visualisation.
Overlaps
Stage: 1 Challenge Level:
What does the overlap of these two shapes look like? Try picturing it in your head and then use the interactivity to test your prediction.
Spotting the Loophole
Stage: 4 Challenge Level:
A visualisation problem in which you search for vectors which sum to zero from a jumble of arrows. Will your eyes be quicker than algebra?
Picture a Pyramid ...
Stage: 2 Challenge Level:
Imagine a pyramid which is built in square layers of small cubes. If we number the cubes from the top, starting with 1, can you picture which cubes are directly below this first cube?
Twice as Big?
Stage: 2 Challenge Level:
Investigate how the four L-shapes fit together to make an enlarged L-shape. You could explore this idea with other shapes too.
Can You Explain Why?
Stage: 3 Challenge Level:
Can you explain why it is impossible to construct this triangle?
Music to My Ears
Stage: 2 Challenge Level:
Can you predict when you'll be clapping and when you'll be clicking if you start this rhythm? How about when a friend begins a new rhythm at the same time?
Route to Infinity
Stage: 3 Challenge Level:
Can you describe this route to infinity? Where will the arrows take you next?
Stage: 2 Challenge Level:
How can you arrange the 5 cubes so that you need the smallest number of Brush Loads of paint to cover them? Try with other numbers of cubes as well.
Cover the Camel
Stage: 1 Challenge Level:
Can you cover the camel with these pieces?
Squares in Rectangles
Stage: 3 Challenge Level:
A 2 by 3 rectangle contains 8 squares and a 3 by 4 rectangle contains 20 squares. What size rectangle(s) contain(s) exactly 100 squares? Can you find them all?
Semi-regular Tessellations
Stage: 3 Challenge Level:
Semi-regular tessellations combine two or more different regular polygons to fill the plane. Can you find all the semi-regular tessellations?
Stage: 2 Challenge Level:
This practical problem challenges you to make quadrilaterals with a loop of string. You'll need some friends to help!
Nine-pin Triangles
Stage: 2 Challenge Level:
How many different triangles can you make on a circular pegboard that has nine pegs?
Cubes Within Cubes Revisited
Stage: 3 Challenge Level:
Imagine starting with one yellow cube and covering it all over with a single layer of red cubes, and then covering that cube with a layer of blue cubes. How many red and blue cubes would you need?
Square Coordinates
Stage: 3 Challenge Level:
A tilted square is a square with no horizontal sides. Can you devise a general instruction for the construction of a square when you are given just one of its sides?
Isosceles Triangles
Stage: 3 Challenge Level:
Draw some isosceles triangles with an area of $9$cm$^2$ and a vertex at (20,20). If all the vertices must have whole number coordinates, how many is it possible to draw?
Efficient Cutting
Stage: 3 Challenge Level:
Use a single sheet of A4 paper and make a cylinder having the greatest possible volume. The cylinder must be closed off by a circle at each end.
Fence It
Stage: 3 Challenge Level:
If you have only 40 metres of fencing available, what is the maximum area of land you can fence off?
Ten Hidden Squares
Stage: 2 Challenge Level:
These points all mark the vertices (corners) of ten hidden squares. Can you find the 10 hidden squares?
Square It
Stage: 3 and 4 Challenge Level:
Players take it in turns to choose a dot on the grid. The winner is the first to have four dots that can be joined to form a square.
On the Edge
Stage: 3 Challenge Level:
If you move the tiles around, can you make squares with different coloured edges?
Tangram Tangle
Stage: 1 Challenge Level:
If you split the square into these two pieces, it is possible to fit the pieces together again to make a new shape. How many new shapes can you make?
Hundred Square
Stage: 1 Challenge Level:
A hundred square has been printed on both sides of a piece of paper. What is on the back of 100? 58? 23? 19?
Cuboids
Stage: 3 Challenge Level:
Find a cuboid (with edges of integer values) that has a surface area of exactly 100 square units. Is there more than one? Can you find them all?
The Spider and the Fly
Stage: 4 Challenge Level:
A spider is sitting in the middle of one of the smallest walls in a room and a fly is resting beside the window. What is the shortest distance the spider would have to crawl to catch the fly?
Stage: 1 Challenge Level:
Here are shadows of some 3D shapes. What shapes could have made them?
Painted Cube
Stage: 3 Challenge Level:
Imagine a large cube made from small red cubes being dropped into a pot of yellow paint. How many of the small cubes will have yellow paint on their faces?
Cut Nets
Stage: 2 Challenge Level:
Each of the nets of nine solid shapes has been cut into two pieces. Can you see which pieces go together?
Buses
Stage: 3 Challenge Level:
A bus route has a total duration of 40 minutes. Every 10 minutes, two buses set out, one from each end. How many buses will one bus meet on its way from one end to the other end?
Coordinate Patterns
Stage: 3 Challenge Level:
Charlie and Alison have been drawing patterns on coordinate grids. Can you picture where the patterns lead?
|
2018-01-22 04:15:55
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2686333656311035, "perplexity": 2078.259374490833}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-05/segments/1516084890991.69/warc/CC-MAIN-20180122034327-20180122054327-00019.warc.gz"}
|
http://mathoverflow.net/questions/41050/a-hyperbolic-pde-with-infinite-boundary-conditions
|
# A hyperbolic PDE with infinite boundary conditions
Given known functions $a(x,y)$ and $b(x,y)$, I have a linear, second-order, hyperbolic PDE for a surface $z(x,y)$. The PDE is of the form:
$z_{xx} - a^2 z_{yy} + ab z_x - b z_y = 0$.
The PDE does not have $z_{xy}$ term, $z$ term and constant term.
Along a closed boundary contour, it is known that both $z_x$ and $z_y$ approach infinity. But the limiting ratio $c(x,y) = {z_y}/{z_x}$ is known at the boundary.
The boundary conditions are somewhat unusual, but they arise naturally in my application.
Can the above PDE be solved with such BCs? If I need to specify additional conditions, what should they be? (I suppose at the least I will need to specify the value of z at some points in the domain.)
-
Do you have a specific boundary contour, or will that vary with each instance? – Ricky Demer Oct 4 '10 at 21:02
It will vary with each instance. If it helps with the solution, here are some details of the physical setup. The surface z can be understood as the "visible" portion of a smooth object, observed by a fixed viewer. So, the boundary is where the surface curves away from the viewer. The shape of the boundary will depend on the shape of the object, but we know that at the boundary, the normal to the surface will be parallel to the retinal plane of viewer. So, while $z_x$ and $z_y$ go to infinity, the ratio ${z_y}/{z_x}$ is simply the direction of the normal to the silhouette in the retinal plane. – user9728 Oct 4 '10 at 22:17
A boundary value problem with one data at every point of the boundary is not suitable for a second-order hyperbolic equation, although it would be for an elliptic equation like $\Delta z+\cdots=0$. Just try $z_{xx}-z_{yy}=0$ in a disk, and you will find severe obstruction to the solvability of the BVP.
Instead, two kinds of problems can be solved in full generality. 1- the Cauchy problem, where both $z$ and its normal derivative are given on a non-characteristic curves (here, a curve for which $dy^2\ne a^2dx^2$). 2- the Goursat problem, where $z$ is given on two interesecting characteristic curves (here, one curve of each family $dy=\pm adx$).
-
I know you already said it in your answer, but it is worth emphasizing that for the Goursat problem, only $z$, not the normal derivative, is given. The values of the normal derivatives are "solved for" by propagating along the characteristic with the equation. – Willie Wong Oct 5 '10 at 11:39
Just to make sense of your problem, think of the following special case: $a=1$, $b=0$ are both constant functions. Then every solution can be written as $z(x,y)=p(x+y)+q(x-y)$, and you have $$z_x(x,y) = p'(x+y)+q'(x-y),$$ $$z_y(x,y) = p'(x+y)-q'(x-y).$$ Thus you get $$2 p'(x+y) = z_x(x,y)+z_y(x,y)$$ which means, for all $s,t$ such that the points are in the domain you are working in, $$2p'(2s)=z_x(s+t,s-t)+z_y(s+t,s-t).$$ Now fix $s$ and move $t$ so that the line $(s+t,s-t)$ hits the boundary. You see that many problems arise. First of all, if it hits at two different points, the values must match (which is connected to Denis' remark that the problem is ill posed in a closed domain). But, more important for your question, the ratio $z_x/z_y$ has no role here, one needs that the sum $z_x+z_y$ remains bounded, so some cancelation is required. Unfortunately, if you do the same computation to calculate $q$, you get that also the difference $z_x-z_y$ must stay bounded. So I feel that there is no way to make sense of your problem...
-
|
2015-05-25 06:07:17
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8991008400917053, "perplexity": 224.470081609619}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-22/segments/1432207928414.45/warc/CC-MAIN-20150521113208-00336-ip-10-180-206-219.ec2.internal.warc.gz"}
|
https://studyadda.com/sample-papers/jee-main-sample-paper-43_q79/297/302850
|
• # question_answer Suppose an ellipse and a hyperbola have the same pair of foci on the x-axis with centers at the origin and that they intersect at (2, 2). If the eccentricity of the ellipse is $\frac{1}{2},$ then the eccentricity of the hyperbola is A) $\sqrt{\frac{7}{4}}$ B) $\sqrt{\frac{7}{3}}$ C) $\sqrt{\frac{5}{4}}$ D) $\sqrt{\frac{5}{3}}$
Let equation of hyperbola and ellipse be $\tan \,\phi =\frac{V}{H}$ ?(i) and $\theta$ ?(ii) $H'=H\,\cos \,\theta ,$ $\phi '$ (since, same pair of foci) $\tan \,\phi =\frac{V}{{{H}^{.}}}=\frac{V}{H\,\cos \,\theta }$ (given) Both intersect at (2, 2), $\frac{\tan \,\phi '}{\tan \,\phi }=\frac{V/H\,\cos \,\theta }{\frac{V}{H}}=\frac{1}{\cos \,\theta }$ [from Eq. (ii)] ${{\phi }_{1}}=$ $=BA$ ${{\phi }_{2}}=$ $||$ Also, $=0$ $\therefore \,\,|\xi |\,=\,\left| \frac{-\Delta \phi }{\Delta t} \right|=\,\left| -\left( \frac{0-BA}{\frac{T}{4}-0} \right) \right|=\frac{4BA}{T}$ $(\Delta \phi ={{\phi }_{2}}-{{\phi }_{1}})$ ?(iii) Now, $T=\frac{2\pi }{\omega }$ [From Eq. (i)] $\Rightarrow$ $f'(x)=2+\cos \,x>0$ $x$ $\therefore$ $f(x)$ $\therefore$ $f$ $|M|=\alpha$ or ${{M}^{-1}}adjM)=kI$ $\Rightarrow$ $|{{M}^{-1}}|\,|adj\,(adjM)|\,=\,|kI|$ $\Rightarrow$ [From Eq. (iii)]
|
2022-01-16 19:01:39
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9399797916412354, "perplexity": 10498.52400917449}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320300010.26/warc/CC-MAIN-20220116180715-20220116210715-00638.warc.gz"}
|
https://docs.plasmapy.org/en/latest/formulary/braginskii.html
|
# Classical transport theory (plasmapy.formulary.braginskii)¶
Functions to calculate classical transport coefficients.
## Introduction¶
Classical transport theory is derived by using kinetic theory to close the plasma two-fluid (electron and ion fluid) equations in the collisional limit. The first complete model in this form was done by S. I. Braginskii 1.
This module uses fitting functions from literature (1, 2, 3, 4, 5 and the next section) to calculate the transport coefficients, which are the resistivity, thermoelectric conductivity, thermal conductivity, and viscosity.
Keep in mind the following assumptions under which the transport equations are derived:
1. The plasma is fully ionized, only consisting of ions and electrons. Neutral atoms are neglected.
2. Turbulent transport does not dominate.
3. The velocity distribution is close to Maxwellian. This implies:
1. Collisional mean free path ≪ gradient scale length along field.
4. The plasma is highly collisional: collisional frequency ≫ gyrofrequency.
When classical transport is not valid, e.g. due to the presence of strong gradients or turbulent transport, the transport is significantly increased by these other effects. Thus classical transport often serves as a lower bound on the losses / transport encountered in a plasma.
## Transport Variables¶
For documentation on the individual transport variables, please take the following links to documentation of methods of ClassicalTransport.
## Using the module¶
Given that many of the transport variables share a lot of the same computation and many are often needed to be calculated simultaneously, this module provides a ClassicalTransport class that can be initialized once with all of the variables necessary for calculation. It then provides all of the functionality as methods (please refer to its documentation).
If you only wish to calculate a single transport variable (or if just don’t like object oriented interfaces), we have also provided wrapper functions in the main module namespace that use ClassicalTransport under the hood (see below, in the Functions section).
Warning
The API for this package is not yet stable.
## Classical transport models¶
In this section, we present a broad overview of classical transport models implemented within this module.
### Braginskii 1¶
The original Braginskii treatment as presented in the highly cited review paper from 1965. Coefficients are found from expansion of the kinetic equation in Laguerre polynomials, truncated at the second term in their series expansion ($$k = 2$$). This theory allows for arbitrary Hall parameter and include results for Z = 1, 2, 3, 4, and infinity (the case of Lorentz gas completely stripped of electrons, and the stationary ion approximation).
### Spitzer-Harm 23¶
These coefficients were obtained from a numerical solution of the Fokker- Planck equation. They give one of the earliest and most accurate (in the Fokker-Planck sense) results for electron transport in simple plasma. They principally apply in the unmagnetized / parallel field case, although for resistivity Spitzer also calculated a famous result for a strong perpendicular magnetic field. Results are for Z = 1, 2, 4, 16, and infinity (Lorentz gas / stationary ion approximation).
### Epperlein-Haines 4¶
Not yet implemented.
### Ji-Held 5¶
This is a modern treatment of the classical transport problem that has been carried out with laudable care. It allows for arbitrary hall parameter and arbitrary $$Z$$ for all coefficients. Similar to the Epperlein-Haines model, it corrects some known inaccuracies in the original Braginskii results, notably the asymptotic behavior of alpha-cross and beta_perp as Hall → +infinity. It also studies effects of electron collisions in the ion terms, which all other treatments have not. To neglect electron-electron collisions, leave $$μ = 0$$. To consider them, specify mu and theta.
References
1(1,2,3)
Braginskii, S. I. “Transport processes in a plasma.” Reviews of plasma physics 1 (1965): 205. (1965)
2(1,2)
Spitzer Jr, Lyman, and Richard Härm. “Transport phenomena in a completely ionized gas.” Physical Review 89.5 (1953): 977. (1953)
3(1,2)
Physics of Fully Ionized Gases, L. Spitzer (1962)
4(1,2)
Epperlein, E. M., and M. G. Haines. “Plasma transport coefficients in a magnetic field by direct numerical solution of the Fokker–Planck equation.” The Physics of fluids 29.4 (1986): 1029-1041.
5(1,2)
Ji, Jeong-Young, and Eric D. Held. “Closure and transport theory for high-collisionality electron-ion plasmas.” Physics of Plasmas 20.4 (2013): 042114.
### Classes¶
ClassicalTransport(T_e, n_e, T_i, n_i, ion, m_i) Classical transport coefficients (e.g.
### Functions¶
electron_thermal_conductivity(T_e, n_e, T_i, …) Calculate the thermal conductivity for electrons. electron_viscosity(T_e, n_e, T_i, n_i, ion) Calculate the electron viscosity. ion_thermal_conductivity(T_e, n_e, T_i, n_i, ion) Calculate the thermal conductivity for ions. ion_viscosity(T_e, n_e, T_i, n_i, ion[, …]) Calculate the ion viscosity. resistivity(T_e, n_e, T_i, n_i, ion[, m_i, …]) Calculate the resistivity. thermoelectric_conductivity(T_e, n_e, T_i, …) Calculate the thermoelectric conductivity.
|
2021-06-25 13:42:47
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5564031600952148, "perplexity": 1651.6561920047939}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-25/segments/1623487630175.17/warc/CC-MAIN-20210625115905-20210625145905-00407.warc.gz"}
|
https://raweb.inria.fr/rapportsactivite/RA2018/disco/uid23.html
|
PDF e-Pub
## Section: New Results
### Spectral abscissa characterization for Time-delay systems
Participants : Islam Boussaada, Silviu-Iulian Niculescu, Sami Tliba [Université Paris Sud] , Thomas Vyhlidal [Czech technical university in Prague] , Karim Trabelsi [IPSA] .
It is well known that the spectral abscissa of a given dynamical is nothing but the corresponding solutions' exponential decay. The analytical characterization of the spectral abscissa for infinite dimensional dynamical systems is an old problem which is still nowadays a question of ongoing interest due to its links with stability problems. We produced several works in this topic dealing with reduced order retarded Time-delay systems and emphasized a property that we call multiplicity induced-dominancy. In the paper [13], the interest of using time-delay in the controller design as a control parameter is underlined and the way to assign a dominant spectral value is demonstrated. As a matter of fact, it is shown that the multiplicity of given spectral value may reach the degree of the corresponding quasipolynomial. Furthermore, when this holds, then using a particular factorization of the quasipolynomial, such a multiple spectral value is shown to be the corresponding spectral abscissa. A generalization of such a result to generic second order retarded equation with a single delay is established in [12]. More precisely, a parametric characterization of the spectral abscissa is established using the principle argument theorem. Furthermore, in the work [45], the potential applicability of such a parametric characterization in controller design in concrete application is demonstrated. As a matter of fact, a third order retarded system modeling the dynamics of Mach number in a wind tunnel is considered and a delayed controller design based on the spectral abscissa assignment is proposed.
|
2022-09-27 14:49:34
|
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8019440770149231, "perplexity": 781.1132899797354}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030335034.61/warc/CC-MAIN-20220927131111-20220927161111-00374.warc.gz"}
|
http://dataspace.princeton.edu/jspui/handle/88435/dsp01tx31qk92s
|
Please use this identifier to cite or link to this item: http://arks.princeton.edu/ark:/88435/dsp01tx31qk92s
Title: Influence of Long and Short Planetary Waves on the Separation of the Eddy-Driven and Subtropical Jets Authors: O'Rourke, Amanda Kathleen Advisors: Vallis, Geoffrey K Contributors: Atmospheric and Oceanic Sciences Department Keywords: atmospheric dynamicsgeophysical fluid dynamicsjets Subjects: Atmospheric sciences Issue Date: 2015 Publisher: Princeton, NJ : Princeton University Abstract: The interaction of the subtropical and eddy-driven jets is associated with both the internal low-frequency variability of the midlatitudes and the atmospheric response to anthropologically forced climate change. Here we examine the mechanisms that lead to a merger and separation of the jets in time varying and the statistically steady state of numerous experiments using two idealized models: a barotropic b-plane and the dry dynamical core on a sphere. We specifically focus on the interaction of the jets due to changes in the meridional propagation of planetary waves of varying length scales. In both models we find that the eddy momentum flux convergence waves are bound in zonal phase speed by a wavelength-dependent minimum phase speed associated with wave reflection and turning latitudes. In mean flow regime with two distinct jets, these turning latitudes are located within the interjet region and inhibit the equatorward propagation of short planetary waves. Short waves are largely trapped in the eddy-driven jet waveguide. Long waves, on the other hand, interact with both the subtropical and eddy-driven jet. We find that short waves tend to sharpen the eddy-driven jet and long waves, displaying eddy momentum flux convergence patterns similar that that as would be expect from barotropic instability, act to widen and merge the eddy-driven and subtropical jets. We additionally note that these idealized models contain significant low frequency variability similar to that of the observed atmosphere, namely the poleward propagation of anomalies to the zonal mean flow. We hypothesize that these features of low frequency variability are a product of wave-mean flow interaction and the migration of critical lines due to wave breaking. URI: http://arks.princeton.edu/ark:/88435/dsp01tx31qk92s Alternate format: The Mudd Manuscript Library retains one bound copy of each dissertation. Search for these copies in the library's main catalog Type of Material: Academic dissertations (Ph.D.) Language: en Appears in Collections: Atmospheric and Oceanic Sciences
Files in This Item:
File Description SizeFormat
|
2017-01-22 02:05:58
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.38778677582740784, "perplexity": 4354.495878552275}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-04/segments/1484560281331.15/warc/CC-MAIN-20170116095121-00380-ip-10-171-10-70.ec2.internal.warc.gz"}
|
https://bskinn.github.io/
|
# KSotD (Word): Toggle Split Screen -- Ctrl+Alt+S
Going back at least the past several versions of Office, Word has implemented a split-screen editing mode, where the top and bottom portions can be scrolled independently to different portions of the open document:
# My How and Why: pyproject.toml & the 'src' Project Structure
UPDATE 2 (16 May 2019): With the release of pip v19.1.1 , editable installs are again allowed in the presence of pyproject.toml. Both the pip install -e . and python setup.py develop approaches should now work. Discussion is ongoing on a more robust, setuptools-independent specification of editable installs.
# KSotD (Word): Select Current Word -- Ctrl+Alt+W
The default Word keyboard shortcuts for cursor movement usually work pretty well for me. I realized today that one thing that’s really been bugging me is the inefficiency of selecting the word under the cursor using only the keyboard. I find that I’m often wanting to select a specific word to then, e.g., toggle its highlight with my Ctrl+Alt+Shift+H custom macro. With the mouse, a simple double-left-click is all that’s needed; with the keyboard, though, unless there’s a shortcut/command I don’t know about, I have to press at least two key combos:
# KSotD (Word): (Un-)Group Objects -- Ctrl+Alt(+Shift)+G
I put a lot of figures, charts, photos, etc. in the various reports and proposals and whatnot that I write for work. Pagecount often isn’t an issue for reports, so there I can add figures inline with text and it really doesn’t matter if there’s a lot of whitespace hovering around. However, the page limit usually is pretty low and extremely strict for proposals. Thus, using floating figures with relatively tight text wrapping is a must.
# Merging Even and Odd Pages from a Scanned Two-Sided Document
At home, for a while we’ve had a Brother DCP-L2540DW multifunction laser printer/scanner/copier, which has worked great for us. Connected effortlessly to the WiFi and to both our Windows laptop and my Debian server. The Windows dashboard is well laid out and well designed. It even has a document feeder for copying and scanning—the big hitch there, though, is that it only supports single-sided scanning; I haven’t found an option in the software to stitch together the even and odd pages. Well, with some recent experience under my belt in reading PDFs with minecart (hmmm, still need to write that follow-up post…), and with a couple of ~20-page double-sided documents in hand that I needed to scan, I decided it was finally time to figure out how to do this.
# Bootstrap Problems in pex Packages
In this post, I laid out an initial attempt at a pex workflow for packaging data analysis code for easy use by others. I still stand by the method in general; however, I ran into some problems with this particular application.
# KSotD (Word): Rotate Highlight Color -- Ctrl+Alt+Shift+H
When writing just about anything, I use highlights heavily for a variety of reasons: marking something that needs more attention later, flagging things for someone else to look at, tagging placeholders for figure references and whatnot, whatever. As of Office 2010, Word supports a handful of highlight colors; enough for what I need, but altogether fewer than I’d like:
# A First Attempt at Executable Packaging with pex
For an ongoing project here at work, I’ve written some Python tooling for automatically importing some chromatograms generated by the instrument software and extracting peak data from them. This workflow is necessary because our instrument is old, and the software that drives it was never actually intended to generate chromatograms: the only way to get the time scan data out is to … print to PDF.
|
2019-06-26 00:09:48
|
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2832925021648407, "perplexity": 2965.456778906366}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560627999964.8/warc/CC-MAIN-20190625233231-20190626015231-00525.warc.gz"}
|