Mode of #cas

denominator

Gives the factored denominator of a rational expression brought to one fraction, with the conditions of the identity.

#cas [denominator] e
gives the denominator D of the fraction N/D that together makes of the rational expression e, with the conditions under which N/D equals e.

denominator puts a rational expression over a common denominator and gives you that denominator. The theorem is the one of together, so what is proved is the whole identity e=N/D.

The denominator stays factored as far as the input factors it. The conditions come from the divisors of the input: Lean’s division is total (1/0=0), so e=N/D can fail where a divisor vanishes, and the theorem has the hypothesis that none of them does.

Details and Options

  • The theorem is that of #cas [together] e: ∀x1,…,xn,d1≠0→…→dk≠0→e=N/D, over the divisors d1,…,dk of e as written.
  • D is a product of powers of pairwise coprime polynomials obtained from the divisors by gcds. When no divisor of e has a variable, D is a number.
  • The input is a rational expression as for together: real variables and rational numbers combined by +, -, *, / and natural powers, with polynomial divisors.
  • numerator gives N, and apart splits a fraction over the factors of its denominator.
  • There are no options.

Examples (10)#

Basic Examples (2)

A difference of two reciprocals:

In[1]:=
#cas [denominator] (1/(x-1) - 1/(x+1))
Out[1]=

denominator

(x - 1)*(x + 1)
Input (rational function)
(1/(x-1) - 1/(x+1))
Conditions
x−1≠0, x+1≠0

Checked by Lean’s kernel: Identity with the common-denominator form

∀ (x : ℝ), x - 1 ≠ 0 → x + 1 ≠ 0 → 1 / (x - 1) - 1 / (x + 1) = 2 / ((x - 1) * (x + 1))
The certificate: 1 checked step
  1. Identity with the common-denominator form

    ∀ (x : ℝ), x - 1 ≠ 0 → x + 1 ≠ 0 → 1 / (x - 1) - 1 / (x + 1) = 2 / ((x - 1) * (x + 1))

    Checked by Lean’s kernel


With numbers as divisors, the denominator is a number and there is no condition:

In[2]:=
#cas [denominator] (x/2 + y/3)
Out[2]=

denominator

6
Input (rational function)
(x/2 + y/3)

Checked by Lean’s kernel: Identity with the common-denominator form

∀ (x y : ℝ), x / 2 + y / 3 = (3 * x + 2 * y) / 6
The certificate: 1 checked step
  1. Identity with the common-denominator form

    ∀ (x y : ℝ), x / 2 + y / 3 = (3 * x + 2 * y) / 6

    Checked by Lean’s kernel

Scope (2)

The denominator is not the product of the divisors. Here x2−1 and x−1 share the factor x−1, which appears once:

In[3]:=
#cas [denominator] (1/(x^2-1) + 1/(x-1))
Out[3]=

denominator

(x - 1)*(x + 1)
Input (rational function)
(1/(x^2-1) + 1/(x-1))
Conditions
x2−1≠0, x−1≠0

Checked by Lean’s kernel: Identity with the common-denominator form

∀ (x : ℝ),
  x ^ 2 - 1 ≠ 0 → x - 1 ≠ 0 → 1 / (x ^ 2 - 1) + 1 / (x - 1) = (x + 2) / ((x - 1) * (x + 1))
The certificate: 1 checked step
  1. Identity with the common-denominator form

    ∀ (x : ℝ),
      x ^ 2 - 1 ≠ 0 → x - 1 ≠ 0 → 1 / (x ^ 2 - 1) + 1 / (x - 1) = (x + 2) / ((x - 1) * (x + 1))

    Checked by Lean’s kernel


The gcd x+1 of the two divisors splits x2−1, so the denominator is a product of x−1 and x+1:

In[4]:=
#cas [denominator] (x/(x^2 - 1) + 1/(x + 1))
Out[4]=

denominator

(x + 1)*(x - 1)
Input (rational function)
(x/(x^2 - 1) + 1/(x + 1))
Conditions
x2−1≠0, x+1≠0

Checked by Lean’s kernel: Identity with the common-denominator form

∀ (x : ℝ),
  x ^ 2 - 1 ≠ 0 → x + 1 ≠ 0 → x / (x ^ 2 - 1) + 1 / (x + 1) = (2 * x - 1) / ((x + 1) * (x - 1))
The certificate: 1 checked step
  1. Identity with the common-denominator form

    ∀ (x : ℝ),
      x ^ 2 - 1 ≠ 0 → x + 1 ≠ 0 → x / (x ^ 2 - 1) + 1 / (x + 1) = (2 * x - 1) / ((x + 1) * (x - 1))

    Checked by Lean’s kernel

Applications (1)

The first example as a theorem, with a hypothesis for each divisor. Only the three standard axioms are used:

In[5]:=
theorem difference_of_reciprocals (x : ℝ) (h₁ : x - 1 ≠ 0) (h₂ : x + 1 ≠ 0) :
    1 / (x - 1) - 1 / (x + 1) = 2 / ((x - 1) * (x + 1)) := by
  cas

#print axioms difference_of_reciprocals
Out[5]=

difference_of_reciprocals depends on the axioms propext, Classical.choice, Quot.sound.

Properties and Relations (3)

numerator gives the other part of the same fraction:

In[6]:=
#cas [numerator] (1/(x-1) - 1/(x+1))
Out[6]=

numerator

2
Input (rational function)
(1/(x-1) - 1/(x+1))
Conditions
x−1≠0, x+1≠0

Checked by Lean’s kernel: Identity with the common-denominator form

∀ (x : ℝ), x - 1 ≠ 0 → x + 1 ≠ 0 → 1 / (x - 1) - 1 / (x + 1) = 2 / ((x - 1) * (x + 1))
The certificate: 1 checked step
  1. Identity with the common-denominator form

    ∀ (x : ℝ), x - 1 ≠ 0 → x + 1 ≠ 0 → 1 / (x - 1) - 1 / (x + 1) = 2 / ((x - 1) * (x + 1))

    Checked by Lean’s kernel


together prints the whole fraction:

In[7]:=
#cas [together] (x/2 + y/3)
Out[7]=

common denominator

3x+2y6
(3*x + 2*y)/6
Input (rational function)
(x/2 + y/3)

Checked by Lean’s kernel: Identity with the common-denominator form

∀ (x y : ℝ), x / 2 + y / 3 = (3 * x + 2 * y) / 6
The certificate: 1 checked step
  1. Identity with the common-denominator form

    ∀ (x y : ℝ), x / 2 + y / 3 = (3 * x + 2 * y) / 6

    Checked by Lean’s kernel


apart goes back to partial fractions over the factors of the denominator:

In[8]:=
#cas [apart] (1/((x - 1)*(x + 1)))
Out[8]=

partial fractions

12(x−1)−12(x+1)
1/(2*(x - 1)) - 1/(2*(x + 1))
Input (rational function)
(1/((x - 1)*(x + 1)))
Conditions
(x−1)(x+1)≠0

Checked by Lean’s kernel: Identity with the partial fraction decomposition

∀ (x : ℝ), (x - 1) * (x + 1) ≠ 0 → 1 / ((x - 1) * (x + 1)) = 1 / (2 * (x - 1)) - 1 / (2 * (x + 1))
The certificate: 1 checked step
  1. Identity with the partial fraction decomposition

    ∀ (x : ℝ), (x - 1) * (x + 1) ≠ 0 → 1 / ((x - 1) * (x + 1)) = 1 / (2 * (x - 1)) - 1 / (2 * (x + 1))

    Checked by Lean’s kernel

Possible Issues (2)

A divisor must be a polynomial. Multiply the inner fraction out first. For x≠0 the expression is x/(x+1):

In[9]:=
#cas [denominator] (1/(1 + 1/x))
Out[9]=

Error

denominator: a divisor is itself a quotient; write the expression with polynomial divisors

Functions other than the field operations are refused:

In[10]:=
#cas [denominator] (sin x / x)
Out[10]=

Error

denominator: the expression is not a rational function: it has a function other than the field operations and natural powers

See Also

numerator · together · apart