:: Formalization of Wallis Infinite Product Formula for $\pi$ and the Wallis
:: Integral
:: by Yasushige Watase
::
:: Received September 17, 2025
:: Copyright (c) 2025-2026 Association of Mizar Users
:: (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: This code can be distributed under the GNU General Public Licence
:: version 3.0 or later, or the Creative Commons Attribution-ShareAlike
:: License version 4.0 or later, subject to the binding interpretation
:: detailed in file COPYING.interpretation.
:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
:: licenses, or see http://www.gnu.org/licenses/gpl.html and
:: http://creativecommons.org/licenses/by-sa/4.0/.
environ
vocabularies NUMBERS, SUBSET_1, REAL_1, INTEGRA1, FINSEQ_1, ORDINAL4, CARD_3,
ARYTM_1, ARYTM_3, RELAT_1, FUNCT_1, XXREAL_0, NAT_1, XBOOLE_0, VALUED_1,
TARSKI, XXREAL_2, ORDINAL2, CARD_1, FDIFF_1, XXREAL_1, RCOMP_1, INTEGRA5,
MEASURE5, SIN_COS, GROUP_1, FUNCT_2, FUNCSDOM, XCMPLX_0, SEQ_2, QC_LANG1,
NEWTON, RLVECT_1, SUPINF_2, FUNCOP_1, MESFUNC1, BINOP_1, INTEGRA7, POWER,
PARTFUN3, SEQ_1, COMPLEX1, ASYMPT_1, SQUARE_1, REALSET1, ALGSTR_0,
WALLIS01;
notations TARSKI, XBOOLE_0, SUBSET_1, FUNCT_1, ORDINAL1, RELSET_1, FUNCT_2,
BINOP_1, FUNCOP_1, NUMBERS, XCMPLX_0, XXREAL_0, XREAL_0, REAL_1,
SQUARE_1, NAT_1, VALUED_0, COMPLEX1, NAT_D, FINSEQ_1, VALUED_1, SEQ_1,
SEQ_2, RVSUM_1, NEWTON, RCOMP_1, FCONT_1, FDIFF_1, POWER, MEASURE5,
SIN_COS, PARTFUN3, INTEGRA5, STRUCT_0, ALGSTR_0, RLVECT_1, GROUP_1,
FUNCSDOM, BINOM, INTEGRA7;
constructors RELSET_1, REAL_1, SQUARE_1, NAT_D, SEQ_1, COMSEQ_2, FINSEQ_3,
SEQ_2, RVSUM_1, NEWTON, ABIAN, PARTFUN3, VECTSP_1, FUNCSDOM, RCOMP_1,
FCONT_1, FDIFF_1, POWER, SIN_COS, BINOM, INTEGRA5, INTEGRA7;
registrations RELAT_1, NUMBERS, XXREAL_0, XREAL_0, MEMBERED, RCOMP_1,
VALUED_0, VALUED_1, FUNCT_2, CARD_1, SEQ_2, RELSET_1, MEASURE5, RVSUM_1,
ORDINAL1, FUNCT_1, NAT_1, INT_1, FDIFF_1, NEWTON04, XCMPLX_0, NEWTON,
SIN_COS, RVSUM_4, FUNCSDOM, VECTSP_1, FCONT_1, SQUARE_1, POWER, VECTSP_2,
ABIAN, ABSVALUE, PARTFUN3, NUMPOLY1, FINSEQ_9, FOMODEL0, GROUP_1;
requirements NUMERALS, BOOLE, SUBSET, REAL, ARITHM;
begin
theorem :: WALLIS01:1
for n
be Nat, x
be Real st
0 < x < PI/
2 holds 0 < sin.x <
1;
theorem :: WALLIS01:2
for n,m
be Nat, x
be Real st n < m &
0 < x <
1 holds x|^m < x|^n;
theorem :: WALLIS01:3
for n
be non zero Nat, x
be Real st
0 < x < PI/
2 holds
(sin.x)|^(
2*n) < (sin.x)|^(
2*n-'
1) &
(sin.x)|^(
2*n+
1) < (sin.x)|^(
2*n);
begin
::::::::::::::::::::::::::::::::::::::
:: 1. Some results on double factorial
::::::::::::::::::::::::::::::::::::::
definition
let m
be Nat;
func even-seq m -> FinSequence
of INT means
:: WALLIS01:def 1
len it = m &
for i
be Nat st i
in dom it
holds it.i =
2*i;
end;
definition
let m
be non zero Nat;
func odd-seq m -> FinSequence
of INT equals
:: WALLIS01:def 2
even-seq(m) + ((dom even-seq m) --> -
1);
end;
theorem :: WALLIS01:4
for n
be non zero Nat
holds dom even-seq n = Seg n &
dom odd-seq n = Seg n &
len odd-seq n = n & len even-seq n = n;
theorem :: WALLIS01:5
for n
be non zero Nat
holds
for i
be Nat st i
in dom odd-seq n
holds (odd-seq n).i =
2*i -
1;
registration
let n
be non zero Nat;
cluster even-seq n -> positive-yielding;
end;
registration
let n
be non zero Nat;
cluster even-seq n -> non empty;
end;
registration
let n
be non zero Nat;
cluster odd-seq n -> positive-yielding;
end;
registration
let n
be non zero Nat;
cluster odd-seq n -> non empty;
end;
registration
let n
be non zero Nat;
cluster even-seq n -> increasing;
cluster odd-seq n -> increasing;
end;
theorem :: WALLIS01:6
for n
be non zero Nat
holds
even-seq(n+
1) = (even-seq n)^<*
2*(n+
1) *>;
theorem :: WALLIS01:7
for n
be non zero Nat
holds
Product even-seq(n+
1) = (
2*(n+
1))*Product(even-seq(n));
theorem :: WALLIS01:8
even-seq(
1) = <*
2 *> & even-seq(
2) = <*
2,
4 *> &
even-seq(
3) = <*
2,
4,
6 *>;
theorem :: WALLIS01:9
for n
be non zero Nat
holds
(odd-seq(n+
1))|Seg(n) = odd-seq n;
theorem :: WALLIS01:10
for n
be non zero Nat
holds
odd-seq(n+
1) = (odd-seq(n))^<*
2*n +
1 *>;
theorem :: WALLIS01:11
odd-seq(
1) = <*
1 *> & odd-seq(
2) = <*
1,
3 *> &
odd-seq(
3) = <*
1,
3,
5 *>;
theorem :: WALLIS01:12
for n
be non zero Nat
holds
Product even-seq(n+
1) = (
2*(n+
1))*Product(even-seq n);
theorem :: WALLIS01:13
for n
be non zero Nat
holds
Product odd-seq(n+
1) = (
2*n +
1)*Product(odd-seq(n));
theorem :: WALLIS01:14
for k
be non zero Nat
holds
Product even-seq(k) = (
2|^k)*(k!);
theorem :: WALLIS01:15
for k
be non zero Nat
holds
Product(odd-seq(k)) = ((
2*k)!)/((
2|^k)*(k!));
begin
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 2. Treating a function as Elements of $\mathbb{R}$-algebra
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
definition
let A
be set;
let f
be Element
of RAlgebra(A);
func @f -> Element
of Funcs(A,REAL) equals
:: WALLIS01:def 3
f;
end;
definition
let A
be set;
let f
be Function
of A, REAL;
func @f -> Element
of RAlgebra(A) equals
:: WALLIS01:def 4
f;
end;
registration
let A
be set;
let f
be Element
of RAlgebra A;
reduce @(@f) to f;
end;
registration
let A
be set;
let f
be Function
of A,REAL;
reduce @(@f) to f;
end;
theorem :: WALLIS01:16
for A
be non empty set
holds
for f,g
be Element
of RAlgebra(A)
holds f*g = @f(
#)@g & @(f*g) = @f(
#)@g;
theorem :: WALLIS01:17
for A
be non empty set
holds
for a
be Element
of REAL, f
be Element
of RAlgebra(A)
holds a(
#)@f = a*f;
registration
cluster RAlgebra REAL -> scalar-unital;
end;
theorem :: WALLIS01:18
RAlgebra REAL
is RealLinearSpace;
theorem :: WALLIS01:19
for A
be non empty set
holds
for f,g
be Element
of RAlgebra(A)
holds
(RealFuncAdd(A)).(f,g) = (RealFuncAdd(A)).(@f,@g);
theorem :: WALLIS01:20
for A
being non empty set, f
be Element
of RAlgebra(A)
holds
(-
1)*f = (-
1) (
#) @f & @((-
1)*f) = -@f &
0.RAlgebra(A) =
0 (
#) @f;
theorem :: WALLIS01:21
for A
be non empty set
holds
for f,g
be Element
of RAlgebra(A)
holds f + g = @f + @g;
theorem :: WALLIS01:22
for f,g
be Element
of RAlgebra(REAL)
holds f - g = @f - @g;
theorem :: WALLIS01:23
for M
be unital associative non empty multMagma
for n
be Nat, a
be Element
of M
holds a|^(n+
1) = (a|^n) * a;
theorem :: WALLIS01:24
for n
be Nat, x
be Function
of REAL,REAL st x
is continuous
holds
@((@x)|^n)
is continuous;
theorem :: WALLIS01:25
for x
be Function
of REAL,REAL, n
be Nat, a
be Real st (@(@x)).a >
0
holds
(@((@x)|^n)).a = ((@(@x)).a)|^n;
theorem :: WALLIS01:26
for x
be Function
of REAL,REAL, n
be non zero Nat, a
be Real st (@(@x)).a =
0
holds (@((@x)|^n)).a =
0;
theorem :: WALLIS01:27
for Z
be open Subset
of REAL, n
be non zero Nat
holds
for x
be Function
of REAL,REAL st x is_differentiable_on Z
holds
@((@x)|^n) is_differentiable_on Z;
theorem :: WALLIS01:28
for n
be Nat, I
be non empty closed_interval Subset
of REAL
holds
for x
be Function
of REAL,REAL st x
is continuous
holds
@((@x)|^n)|I
is continuous & @((@x)|^n) is_integrable_on I &
@((@x)|^n)|I
is bounded;
reserve r
for Real;
theorem :: WALLIS01:29
for n
be Nat, I
be non empty closed_interval Subset
of REAL
holds
for x
be Function
of REAL,REAL st x
is continuous
holds
(r(
#)@((@x)|^n))|I
is continuous & r(
#)@((@x)|^n) is_integrable_on I &
(r(
#)@((@x)|^n))|I
is bounded;
theorem :: WALLIS01:30
for n
be non zero Nat
holds
(@((@sin)|^n)).
0 =
0 & (@((@sin)|^n)).(PI/
2) =
1;
theorem :: WALLIS01:31
for n
be non zero Nat
holds
@((@sin)|^(n+
1)) `|REAL = (n+
1)(
#)@((@sin)|^n) (
#) @(@cos);
begin
::::::::::::::::::::::::::::::::::::
:: 3. Recurrence relation on $\int_0^{\frac{\pi}{2}} \sin^{n} x \ dx$
:: \& Wallis Integral
:::::::::::::::::::::::::::::::::::
theorem :: WALLIS01:32
@((@sin)|^
1) `|REAL is_differentiable_on REAL;
theorem :: WALLIS01:33
for n
be non zero Nat
holds
@((@sin)|^(n+
1)) `|REAL is_differentiable_on REAL;
theorem :: WALLIS01:34
for n
be Nat st n >=
2 holds
@((@sin)|^(n-'
1)) is_integral_of
(n-'
1)(
#)(@((@sin)|^(n-'
2))) (
#) @(@cos), REAL;
theorem :: WALLIS01:35
integral(@((@sin)|^
0),
0,PI/
2) = PI/
2;
theorem :: WALLIS01:36
integral(@((@sin)|^
1),
0,PI/
2) =
1;
theorem :: WALLIS01:37
(sin (
#) sin) + (cos (
#) cos) =
1.RAlgebra(REAL);
theorem :: WALLIS01:38
(@sin)|^
2 + (@cos)|^
2 =
1.RAlgebra(REAL) &
(@sin)|^
2 = sin (
#) sin & (@cos)|^
2 = cos (
#) cos &
(@sin)|^
2 = @sin * (@sin) & (@cos)|^
2 = @cos * (@cos);
definition
func 'I' -> Real_Sequence means
:: WALLIS01:def 5
for m
be Nat
holds it.m = integral(@((@sin)|^m),
0,PI/
2);
end;
begin
:::::::::::::::::::::::::::::::::
::4. the Wallis Product Formula
::::::::::::::::::::::::::::::::
theorem :: WALLIS01:39
for n
be Nat st n >=
2 holds ((n-'
1)/n)*('I'.(n-'
2)) = 'I'.n;
theorem :: WALLIS01:40
for n
be non zero Nat
holds
'I'.(
2*n+
1) = Product(even-seq(n))/(Product(odd-seq(n+
1)));
theorem :: WALLIS01:41
for n
be non zero Nat
holds
'I'.(
2*n) = (Product(odd-seq(n))/(Product(even-seq(n))))*(PI/
2);
begin
:::::::::::::::::::::::::
:: Wallis Product
::::::::::::::::::::::::
theorem :: WALLIS01:42
for n
be non zero Nat, x
be Real st
0< x < PI/
2 holds
@((@sin)|^(
2*n)).x < @((@sin)|^(
2*n-'
1)).x &
@((@sin)|^(
2*n+
1)).x < @((@sin)|^(
2*n)).x;
theorem :: WALLIS01:43
for n
be non zero Nat
holds
'I'.(
2*n) <= 'I'.(
2*n-'
1) & 'I'.(
2*n+
1) <= 'I'.(
2*n);
theorem :: WALLIS01:44
for n
be non zero Nat
holds
1 <= 'I'.(
2*n)/'I'.(
2*n+
1) &
'I'.(
2*n)/'I'.(
2*n+
1)
= (Product(odd-seq(n))|^
2/(Product(even-seq(n)))|^
2)*n*((
1+
1/(
2*n))*PI);
theorem :: WALLIS01:45
for n
be non zero Nat
holds
1/((
1+
1/(
2*n))*PI) <= (Product(odd-seq(n))|^
2/(Product(even-seq(n)))|^
2)*n;
theorem :: WALLIS01:46
for n
be non zero Nat
holds 'I'.(
2*n)/'I'.(
2*n+
1) <=
1 +
1/(
2*n);
theorem :: WALLIS01:47
for n
be non zero Nat
holds
(Product(odd-seq(n))|^
2/(Product(even-seq(n)))|^
2)*n <=
1/PI;
definition
func Wallis_Seq -> Real_Sequence means
:: WALLIS01:def 6
for k
be Nat
holds
it.k = (Product(odd-seq(k+
1))|^
2 / (Product(even-seq(k+
1)))|^
2) * (k+
1);
end;
definition
func w_seq -> Real_Sequence means
:: WALLIS01:def 7
for n
be Nat
holds it.n =
1/((
1+
1/(
2*(n+
1)))*PI);
end;
theorem :: WALLIS01:48
lim Wallis_Seq =
1/PI & Wallis_Seq
is convergent;
theorem :: WALLIS01:49
Wallis_Seq
is positive-yielding;
registration
cluster Wallis_Seq -> positive-yielding;
end;
theorem :: WALLIS01:50
for seq
be positive-yielding Real_Sequence st seq
is convergent
holds
sqrt seq
is convergent & lim sqrt seq = sqrt lim seq;
theorem :: WALLIS01:51
lim sqrt Wallis_Seq =
1/sqrt(PI);
theorem :: WALLIS01:52
for n
be non zero Nat
holds
(sqrt Wallis_Seq).(n-'
1) = sqrt(n)*((
2*n)!)/((
4|^n)*((n!)|^
2));