Formalization of Complex Analysis and Matrix Theory [1st ed.] 9789811572609, 9789811572616

This book discusses the formalization of mathematical theories centering on complex analysis and matrix theory, covering

228 53 15MB

English Pages X, 168 [172] Year 2020

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Front Matter ....Pages i-x
Introduction (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 1-5
Algebraic Systems (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 7-24
Complex Numbers (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 25-39
Gauge Integration (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 41-55
Fourier Transformation (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 57-72
Discrete Fourier Transformation (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 73-87
Matrices (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 89-113
Transformation of Matrices (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 115-133
Inner-Product Spaces (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 135-150
Function Matrices (Zhiping Shi, Yong Guan, Ximeng Li)....Pages 151-166
Back Matter ....Pages 167-168
Recommend Papers

Formalization of Complex Analysis and Matrix Theory [1st ed.]
 9789811572609, 9789811572616

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

Zhiping Shi Yong Guan Ximeng Li

Formalization of Complex Analysis and Matrix Theory

Formalization of Complex Analysis and Matrix Theory

Zhiping Shi Yong Guan Ximeng Li •



Formalization of Complex Analysis and Matrix Theory

123

Zhiping Shi College of Information Engineering Capital Normal University Beijing, China

Yong Guan College of Information Engineering Capital Normal University Beijing, China

Ximeng Li College of Information Engineering Capital Normal University Beijing, China

ISBN 978-981-15-7260-9 ISBN 978-981-15-7261-6 https://doi.org/10.1007/978-981-15-7261-6

(eBook)

Jointly published with Tsinghua University Press The print edition is not for sale in China (Mainland). Customers from China (Mainland) please order the print book from: Tsinghua University Press. © Tsinghua University Press and Springer Nature Singapore Pte Ltd. 2020 This work is subject to copyright. All rights are reserved by the Publishers, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publishers, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publishers nor the authors or the editors give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publishers remain neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Singapore Pte Ltd. The registered company address is: 152 Beach Road, #21-01/04 Gateway East, Singapore 189721, Singapore

Preface

The formalization of mathematical knowledge in theorem provers plays a crucial role in ascertaining the correctness of results that require lengthy proofs to be established. It also lays an indispensable foundation for the formal verification of engineering systems designed using mathematical knowledge. Despite the usefulness of formalization, this field is far from being popularized within the research communities of mathematics and computer science. On one hand, this is due to the high level of difficulty, and the great amount of work often required, in formalizing mathematical reasoning. On the other hand, the insuffiency of the dissemination of results has contributed to the relatively low attention level to this field. This book presents a series of topics derived from research results on the formalization of mathematical knowledge, focusing on complex analysis and the theory of matrices. One of the main aims is to raise attention to some of the recent developments in the field, and their applicative values. The main intended audience includes graduate students in mathematics and computer science, as well as researchers in these two disciplines. This book is structured in 10 chapters. Chapter 1 motivates the formalization of mathematical knowledge, and briefly introduces the subject of each chapter that follows, as well as the theorem prover used for the book. Chapter 2 deals with the formalization of algebraic systems (or algebraic structures) that can be used in the study of diverse mathematical subjects. Chapters 3–6 present four individual topics concerned with the formalization of complex analysis: complex numbers, gauge integration, Fourier analysis, and discrete Fourier analysis. Chapters 7–10 present four individual topics in the theory of matrices: the concept and algebraic properties of matrices, the transformation of matrices, inner-product spaces, and function matrices. The chapters are written with a similar structure, starting with the basic concepts of the formalized subject, turning to the formalization of their properties, and culminating in case studies about the application of the formalization. The work and writing of this book have been supported by multiple research projects. These include: the National Key R&D Plan (2017YFB1301100), the National Technology Innovation Special Zone (18-163-11-ZT-005-038-05), the National Natural Science Foundation of China (61602325, 61876111, and v

vi

Preface

618770400), Academy for Multidisciplinary Studies, Capital Normal University (19530012005), and Beijing Advanced Innovation Center for Imaging Theory and Technology, Capital Normal University. Thanks go also to the former graduate students working in related topics, in the theorem proving group at the College of Information Engineering, Capital Normal University. Beijing, China

Zhiping Shi Yong Guan Ximeng Li

Contents

1

2

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Formalization of Mathematical Theories . . . . . . . . . . . 1.1.1 The Quest for Rigor in Mathematical Development . . . . . . . . . . . . . . . . . . . . . . . . 1.1.2 The Mechanization of Mathematical Theories 1.1.3 The Benefits of Formalizing and Mechanizing Mathematical Theories . . . . . . . . . . . . . . . . . 1.2 Mathematical Theories Formalized in This Book . . . . 1.3 The Theorem Prover of Choice . . . . . . . . . . . . . . . . .

....... .......

1 1

....... .......

1 2

....... ....... .......

2 3 4

Algebraic Systems . . . . . . . . . . . . . . . . 2.1 The Basics of Algebraic Systems . 2.2 Operations and Properties . . . . . . 2.2.1 Closedness . . . . . . . . . . . 2.2.2 Commutativity . . . . . . . . 2.2.3 Associativity . . . . . . . . . 2.2.4 Distributivity . . . . . . . . . 2.2.5 Absorption . . . . . . . . . . . 2.2.6 Idempotency . . . . . . . . . 2.2.7 Identity Element . . . . . . . 2.2.8 Zero Element . . . . . . . . . 2.2.9 Inverse Element . . . . . . . 2.3 Semi-groups . . . . . . . . . . . . . . . . 2.3.1 Groupoids . . . . . . . . . . . 2.3.2 Semi-groups . . . . . . . . . . 2.3.3 Monoids . . . . . . . . . . . . 2.4 Groups and Sub-groups . . . . . . . . 2.4.1 Groups . . . . . . . . . . . . . 2.4.2 Finite Groups . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .

7 7 8 8 9 9 9 10 10 10 11 11 12 12 12 13 13 14 15

vii

viii

Contents

2.5

2.6

2.7

2.8

2.4.3 Properties of Groups . . . . . . . . . . . . . . . . . . . . . . 2.4.4 Sub-groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . Abelian Groups and Cyclic Groups . . . . . . . . . . . . . . . . . 2.5.1 Abelian Groups . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.2 The Power Operation . . . . . . . . . . . . . . . . . . . . . 2.5.3 Cyclic Groups . . . . . . . . . . . . . . . . . . . . . . . . . . Homomorphism and Isomorphism . . . . . . . . . . . . . . . . . . 2.6.1 Homomorphism . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.2 Epimorphism, Monomorphism, and Isomorphism . 2.6.3 Endomorphism and Automorphism . . . . . . . . . . . Rings and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.1 Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.2 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

15 16 17 17 17 18 19 19 20 20 21 21 22 23

3

Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 The Basic Definitions of Complex Numbers . . . . 3.2 The Field of Complex Numbers . . . . . . . . . . . . . 3.2.1 Basic Arithmetic Operations . . . . . . . . . 3.2.2 (C, +) is an Abelian Group . . . . . . . . . . 3.2.3 (C {0c}, *) is an Abelian Group . . . . . 3.2.4 (C, +, *) is a Field . . . . . . . . . . . . . . . . 3.3 R-Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Complex Conjugate . . . . . . . . . . . . . . . . . . . . . 3.5 Polar Form of Complex Numbers . . . . . . . . . . . 3.5.1 Modulus and Argument . . . . . . . . . . . . 3.5.2 Exponential Form of Complex Numbers 3.6 A Case Study About Sine Wave Signals . . . . . . 3.7 Summary and Related Work . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

25 25 26 26 27 28 28 30 31 33 33 36 36 38

4

Gauge Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 The Gauge Integral and Its Properties . . . . . . . . . 4.1.1 Linearity of the Gauge Integral . . . . . . . . 4.1.2 Inequalities of the Gauge Integral . . . . . . 4.1.3 The Integral of the Pointwise Perturbation and Spike Functions . . . . . . . . . . . . . . . . 4.1.4 Other Important Properties . . . . . . . . . . . 4.2 Verifying a Summing Inverting Integrator . . . . . . 4.3 Summary and Related Work . . . . . . . . . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

41 41 43 45

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

47 48 52 55

Fourier Transformation . . . . . . . . . . 5.1 The Definition of CFT . . . . . . . 5.2 The Properties of CFT . . . . . . . 5.2.1 The Linearity Property . 5.2.2 The Reversion Property

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

57 57 59 59 60

5

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

Contents

5.3 5.4

ix

5.2.3 The Frequency-Shifting Property . . . . . . . . . . . . . 5.2.4 The Differentiation Property in the Time Domain . 5.2.5 The Integration Property in the Time Domain . . . Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

63 63 67 69 72

6

Discrete Fourier Transformation . . . 6.1 The Definition of DFT . . . . . . . 6.2 The Properties of DFT . . . . . . . 6.2.1 Some Useful Lemmas . . 6.2.2 Implicit Periodicity . . . . 6.2.3 Linearity . . . . . . . . . . . 6.2.4 Symmetry . . . . . . . . . . 6.2.5 Conjugated Symmetry . 6.2.6 Frequency Shift . . . . . . 6.2.7 Time Shift . . . . . . . . . . 6.2.8 Convolution . . . . . . . . . 6.3 Applications . . . . . . . . . . . . . . . 6.3.1 FFT . . . . . . . . . . . . . . . 6.3.2 Cosine Frequency Shift . 6.4 Summary and Related Work . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

73 73 74 74 76 77 77 78 79 79 80 81 81 85 86

7

Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 The Data Type for Vectors . . . . . . . . 7.1.2 The Operations of Vectors . . . . . . . . 7.1.3 The Algebraic Properties of Vectors . 7.2 The Basics of Matrix Theory . . . . . . . . . . . . . 7.2.1 The Data Type for Matrices . . . . . . . 7.2.2 The Operations of Matrices . . . . . . . . 7.2.3 The Algebraic Properties of Matrices . 7.2.4 The Determinant . . . . . . . . . . . . . . . 7.3 Applications . . . . . . . . . . . . . . . . . . . . . . . . . 7.3.1 Parameterized Two-Port Networks . . . 7.3.2 State Transfer Equations . . . . . . . . . . 7.4 Summary and Related Work . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

89 90 90 90 92 96 96 96 100 102 105 106 109 110

8

Transformation of Matrices . . . . . . . . . . 8.1 The Concept of Linear Spaces . . . . . 8.2 The Key Attributes of Matrices . . . . 8.2.1 Rank . . . . . . . . . . . . . . . . . 8.2.2 Trace . . . . . . . . . . . . . . . . . 8.2.3 Eigenvalue . . . . . . . . . . . . . 8.2.4 Elementary Transformations

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

115 115 118 119 123 124 124

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . .

. . . . . . .

. . . . . . .

x

Contents

8.3

8.4

Transformations in Euclidean Spaces . . . . . . . . . . . . . . . . . 8.3.1 The Similarity Transformation and the Congruence Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.2 The Orthogonal Transformation . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . 127 . . . 127 . . . 129 . . . 133

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

135 135 137 137 138 141 142 144 146 150

10 Function Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1 Function Matrices and Their Continuity . . . . . . . . . . . 10.1.1 Continuity of Function Matrices . . . . . . . . . . 10.1.2 Function Vectors and Their Continuity . . . . . 10.2 The Differential of Function Matrices . . . . . . . . . . . . . 10.2.1 The Differential of Function Vectors . . . . . . . 10.2.2 The Differential of Function Matrices . . . . . . 10.2.3 The Derivative of Operations Involving Both Function Matrices and Function Vectors . . . . 10.3 The Integral of Function Matrices . . . . . . . . . . . . . . . 10.3.1 The Integral of Function Vectors . . . . . . . . . . 10.3.2 The Integral of Function Matrices . . . . . . . . . 10.4 Application: The Derivative of the Rotation Matrix . . 10.5 Summary and Related Work . . . . . . . . . . . . . . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

151 151 152 152 153 154 155

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

159 160 160 161 163 165

9

Inner-Product Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 Complex Vector Spaces . . . . . . . . . . . . . . . . . . . . . 9.2 Complex Inner-Product Spaces . . . . . . . . . . . . . . . . 9.2.1 Linear Spaces and Linear Functions . . . . . . 9.2.2 Inner Product . . . . . . . . . . . . . . . . . . . . . . . 9.2.3 Norm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2.4 Other Definitions . . . . . . . . . . . . . . . . . . . . 9.3 Transformation in a Finite Dimensional Linear Space 9.4 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5 Summary and Related Work . . . . . . . . . . . . . . . . . .

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

Chapter 1

Introduction

1.1 Formalization of Mathematical Theories The development of mathematical theories heavily involves the identification of appropriate concepts, propositions, and reasoning steps. In these activities, intuition plays a key role. After a piece of theory is conceived, it is crucial to ascertain its correctness. In ensuring the correctness of mathematical developments, caution prevails over intuition to a large extent. Mistakes made in mathematical developments are not rare. For instance, it took a manuscript of 130 pages for Lecat to compile the mistakes made by the major mathematicians before 1900 (Awodey et al. 2013). As mathematical developments are gaining in complexity, it has become increasingly difficult to verify the correctness of mathematical theories. Early in the 19th century, the first proof of the Four Color Theorem (published in 1879) was found to contain mistakes ten years after its publication. As a more recent example, the proof for the Kepler conjecture by Hales in 1998 (with a proof text of 300 pages that is accompanied by a computer program of 40 K lines) was only found to be correct with 99% certainty after a 4-year reviewing process (Avigad and Harrison 2014).

1.1.1 The Quest for Rigor in Mathematical Development To be able to verify the correctness of a piece of mathematical theory, a necessary precondition is that the theory is constructed following principled reasoning steps and it is expressed in a rigorous language. Prominent efforts have been made in these two aspects throughout the history of mathematics. In Euclid’s the Elements dating back to 300 BC, the principled method of mathematical proof appears. In the mid-17th century, Leibniz proposes to express all problems in a general language, which enables one to procedurally decide the truth of any statement. In the 19th century, Weierstrass proposes precise -δ definitions of © Tsinghua University Press and Springer Nature Singapore Pte Ltd. 2020 Z. Shi et al., Formalization of Complex Analysis and Matrix Theory, https://doi.org/10.1007/978-981-15-7261-6_1

1

2

1 Introduction

limit, which adds significantly to the rigor of mathematical analysis. From the 19th to early 20th century, Frege and others contribute to the establishment of Mathematical Logic. This enables the expression of concepts in rigorous syntax and semantics, and the reasoning about the truth of statements in a principled fashion, following the rules of a formal system. Hilbert strongly advocates axiomatization in mathematics. In the Foundations of Geometry, he provides a pure axiomatic foundation to Euclid’s geometry, in the form of a rigorous (formal) deduction system. Russell and Whitehead, in their work Principia Mathematica, advocate that all of mathematics can be reduced to formal logic.

1.1.2 The Mechanization of Mathematical Theories The expression and validation of mathematical theories by means of mathematical logic makes it possible to conduct mathematical developments with the help of machines. Computers can be employed both to find the proofs of mathematical theorems and to check the correctness of mathematical proofs. Currently, the automation provided by a computer has not arrived at such a level that the human ingenuity required to construct a proof can be largely replaced by machine intelligence. Correspondingly, automated theorem proving is effective only for the relatively simple mathematical statements. Interactive theorem proving (Harrison et al. 2014), on the other hand, enables human to provide key insights and proof steps to a computer program, such that it can generate and verify the complete proof. Such a computer program is often called an interactive theorem prover, or a proof assistant. Since the complete proof eventually accepted by the prover is required to consist only of steps in accordance with the first principles of mathematical logic, the approach enables a great level of trust on the correctness of each verified theorem. Furthermore, this trust level is almost unaffected by the length and overall complexity level of the proof. Significant achievements have been made in the mechanized verification of mathematical theories. Notably, mechanized proofs for the Four-Color Theorem and the Odd Order Theorem are completed by Georges Gonthier and collaborators in the proof assistant Coq (Bertot 2004). The latter proof totals 170 K lines of code in Coq, with 4200 definitions and 15000 theorems. Other notable achievements include the outcome of the Flyspeck project led by Thomas Hales—a formalized proof of the Kepler conjecture (Hales et al. 2017).

1.1.3 The Benefits of Formalizing and Mechanizing Mathematical Theories The formalization and mechanization of mathematical theories is beneficial not only to the integrity of mathematics itself, but also the reliability of engineering systems

1.1 Formalization of Mathematical Theories

3

built with mathematical knowledge. On the one hand, this is for the obvious reason that systems designed and built using erroneous mathematical equations (or their solutions) are likely to malfunction. On the other hand, the mechanized verification of a piece of mathematical theory forces one to make explicit all the assumptions of the theory, thereby dismissing the chance for it to be used in unfitting scenarios. The formalization and mechanization of mathematical theories in a prover also strengthens the reasoning capacity of the prover. To prove results derived from an already mechanized piece of theory, one has all the verified lemmas and theorems in that piece of theory at disposal. These lemmas and theorems can be directly applied to construct a proof (again composed of basic reasoning steps following only the first principles of mathematical logic), avoiding the manual generation of the basic reasoning steps from scratch. Hence, the formalization of mathematical theories often makes available theory libraries useful in further proof development. A different way of performing mathematical derivation with the help of a computer is via Computer Algebra Systems (CAS). MATLAB, Maple and Mathematica are examples of CASs. These systems offer a large collection of powerful algebraic packages and they can perform symbolic computation efficiently. However, the chances for CASs to yield incorrect results are non-negligible, and the consequence can be severe in case the results are used to support the engineering of safety-critical systems. This is because there is no dedicated mechanism in CASs to check the correctness of the derivation and reasoning steps. Errors could arise in applying functions with unsatisfied side conditions, due to ill-definedness of expressions wrt. symbolic parameters, etc. (Adams et al. 2001). Moreover, CASs tend to implement numerical and symbolic computations in large, unverified computer programs. This increases the chances of introducing errors when using CASs to produce results that are not subsequently verified (e.g., using an interactive theorem prover).

1.2 Mathematical Theories Formalized in This Book In this book, the formalization of mathematical theories that is centered on complex analysis and matrix theory is reported and discussed. In Chap. 2, we begin with the formalization of algebraic systems. Many of the concepts of concern here (e.g., groups, rings, etc.) also underlie the formal treatment discussed in the later chapters. In Chap. 3, we turn to the formalization of the theory of complex numbers that is the basis of diverse mathematical and physical disciplines such as control theory, signal analysis, quantum mechanics, relativity, and fluid dynamics. In Chap. 4, we discuss the formalization of the gauge integration theory. The gauge integral is a generalization of the Riemann integral. Hence, it is a more powerful tool for solving practical engineering problems. Yet the development of the gauge integration theory enjoys a high degree of simplicity and intuitiveness. In Chap. 5, we present the formalization of the Fourier transform. In Chap. 6, we discuss the formalization of the discrete Fourier transform (DFT), and of the algorithms designed to carry out the discrete Fourier transform efficiently. This formalization is based on the theory

4

1 Introduction

of complex numbers. Starting in Chap. 7, we turn to the formalization of theories on vectors and matrices. This includes the formalization of the basic theory of matrices in Chap. 7, the transformation of matrices in Chap. 8, the formalization of innerproduct spaces in Chap. 9, and the formalization of the theory of function matrices in Chap. 10. We begin each chapter with a brief introduction on the theory formalized in the chapter (incl. its main application areas), and the specific ingredients of the theory that are formalized. We end each chapter with a brief summary of what is achieved and a discussion of the main related work if applicable.

1.3 The Theorem Prover of Choice The most widely used theorem provers of the day include the HOL family of provers (Slind and Norrish 2008; Harrison 2009), Coq (Bertot 2004), PVS (Owre et al. 1992) and Mizar (Naumowicz and Korniłowicz 2009). The HOL system is a well-developed theorem prover originated from the University of Cambridge. It uses Higher Order Logic as the formal language in which theorems and proofs are expressed. HOL4 is the latest version of HOL, and one of the most extensively used higher order logic theorem provers, at the time of writing. HOL4 is also the version of the HOL system currently supported by the international HOL community. Like most other interactive theorem provers, HOL4 supports general formal reasoning using the first principles of mathematical logic. HOL4 provides a wide collection of theory libraries: Booleans, pairs, sums, options, numbers (N, Z, Q, R, fixed point, floating point, n-bit words), lists, lazy lists, character strings, partial orders, monads, predicate sets, multisets, finite maps, polynomials, probability, abstract algebra, elliptic curves, lambda calculus, program logics (Hoare logic, separation logic), machine models (ARM, PPC, and IA32), temporal logics (ω-automata, CTL, μ-calculus, PSL) and so on. The rich libraries of HOL4 (e.g., library on transcendental functions, the limTheory library, etc.) greatly benefit its modeling and reasoning capacity. In HOL4, the keyword val is used to define values in the meta-language SML. This is the functional programming language in which HOL4 is realized. The values typically defined include HOL functions, theorems, etc. For constructing HOL functions, the keyword Define is used. The theorems are SML values of the datatype thm. In SML, these values can only be constructed using the predefined type constructors for thm. Each one of these type constructors models a deduction rule of Higher Order Logic. The basic HOL4 notations used to formulate functions and theorems is shown and explained in Table 1.1. In HOL4, a theorem can be proven using forward reasoning, backward reasoning, or a combination of both. With forward reasoning, one seeks to deduce the conclusion of the theorem by processing the hypotheses and intermediate results, using the constructors of thm and derived functions. With backward reasoning, one seeks to reduce the conclusion to a set of required conditions met by the hypotheses, by applying tactics. Proof development often starts by stating the theorem to be proven

1.3 The Theorem Prover of Choice Table 1.1 The main HOL4 notations for functional and logical expressions

5

HOL notation

Standard notation

Meaning

T



Truth

F



Falsity

t1 /\ t2

t1 ∧ t2

Conjunction

t1 \/ t2

t1 ∨ t2

Disjunction

~t

t

Negation

t1 ==> t2

t1 ⇒ t2

Implication

t1 = t2

t1 = t2

Equality

!x. t

∀x.t

∀-quantification

?x. t

∃x.t

∃-quantification

\x. t

λx.t

Lambda

as a goal. This is followed by applying tactics in an interactive session to show that the hypotheses are sufficient for the conclusion to be established. Afterwards, the prove command can be used to assemble the tactics into a complete proof for the theorem statement. For two tactics, tac1 and tac2 , tac1 THEN tac2 represents that the result of applying tac1 is further processed by applying tac2 . In addition, tac THENL [tac1 , . . . , tacn ] represents that the application of tac yields n subgoals, that are to be processed by tac1 , . . . , tacn , respectively. As an example for the usage of prove, the following statement associates the assembly of tactics tacs to the theorem statement stmt, and binds the resulting theorem value to thm_val. Here, tacs is constructed using THEN, THENL, etc., to connect the basic tactics. val thm_val = prove(`stmt`, tacs)

Furthermore, a proven theorem can be exported under a name using store_thm. For instance, the following statement exports the theorem formulated as stmt and proven using the combination of tactics tacs under the name name, and binds the value for the exported theorem to thm_val. val thm_val = store_thm(“name”, ``stmt``, tacs)

For further information about the language and usage of the HOL4 system, please refer to its online documentation.

Chapter 2

Algebraic Systems

Abstract algebra is the mathematical subject concerned with the study of algebraic systems (or algebraic structures). A few typical algebraic systems defined and examined in this subject are groups, rings, fields, modules, vector spaces, and algebras. The formal (pen-and-paper) definition of some of these structures can be traced back to the 19th century. The study of these algebraic systems was partially driven by the desire of more rigor in mathematics. Most problems in an algebraic system can be resolved through formal derivation using the axioms of the algebraic system. In the other direction, the study of algebraic systems led to improved understanding of the logical foundation of mathematics. Nowadays, the use of the results in algebraic systems can be identified in almost all branches of mathematics. In this chapter, we begin with the concept of algebraic systems in general. We then turn to a few concrete algebraic systems, focusing on the properties of the algebraic operations (that determine the structure of these algebraic systems). Afterwards, we introduce our formalization of these algebraic systems in HOL4. The formalization forms a solid basis for the utilization of these algebraic systems in computer-aided proofs. Our formalization has been performed based on textbooks on discrete mathematics, e.g., Biggs (2002).

2.1 The Basics of Algebraic Systems Before introducing the concept of algebraic systems, we introduce a few operations on sets. The formalization of these operations and the formal proof of their properties can be found in the HOL4 library set_pred. The number of operands for an operation is called the arity of the operation. For example, the operation mapping each nonzero member a of the set R of real numbers to its reciprocal a1 is a unary operation on R. The usual addition and multiplication on R are binary operations on R. The conditional expression if x = 0 then y else z can be © Tsinghua University Press and Springer Nature Singapore Pte Ltd. 2020 Z. Shi et al., Formalization of Complex Analysis and Matrix Theory, https://doi.org/10.1007/978-981-15-7261-6_2

7

8

2 Algebraic Systems

seen as a ternary operation on R. These examples share a common characteristic— the result of the operation of concern is in the same set R as for the arguments. In this situation, the set (e.g., R in the cases above) is said to be closed under the operation. Definition 2.1.1 For a set A, an n-ary operation on A is a mapping from An to B. If B ⊆ A holds, then A is said to be closed under this n-ary operation. Definition 2.1.2 An algebraic system is a non-empty set A together with a number of operations f 1 , f 2 , …, f k defined on A. Such an algebraic system is denoted by .

2.2 Operations and Properties We focus on binary operations and formalize the properties of these operations and of their underlying sets. To facilitate the corresponding formalization in HOL4, we define the following type for algebraic structures.

The typical properties of the operations and their underlying sets are formalized next.

2.2.1 Closedness Definition 2.2.1 Let * be a binary operation on set A. If for all x, y ∈ A, x * y ∈ A holds, then A is said to be closed under *. In HOL4, the condition for the closedness of a set under the binary operation * is formalized as

2.2 Operations and Properties

9

2.2.2 Commutativity Definition 2.2.2 Let * be a binary operation on set A. If for all x, y ∈ A,it holds that x*y = y*x, then * is said to be commutative. In HOL4, the condition for the commutativity of the binary operation * is formalized as

2.2.3 Associativity Definition 2.2.3 Let * be a binary operation on set A. If for all x, y, z ∈ A,it holds that (x*y)*z=x*(y*z), then * is said to be associative. In HOL4, the condition for the associativity of the binary operation * is formalized as

2.2.4 Distributivity Definition 2.2.4 Let * and + be two binary operations on set A. If for all x, y, z ∈ A, the following two conditions hold, then * is said to be distributive over +. More specifically, if (1) holds, then * is said to be left-distributive over +. If (2) holds, then * is said to be right-distributive over +. x ∗ (y + z) = (x ∗ y) + (x ∗ z)

(2.1)

(y + z) ∗ x = (y ∗ x) + (z ∗ x)

(2.2)

In HOL4, the condition for left-distributivity is formalized as

10

2 Algebraic Systems

The condition for right-distributivity is formalized as

2.2.5 Absorption Definition 2.2.5 Let * and + be two commutative operations on set A. If for all x, y ∈ A, the following two conditions hold, then * and + are said to satisfy the absorption law. x ∗ (x + y) = x x + (x ∗ y) = x In HOL4, the conditions for two binary operations to satisfy the absorption law are formalized as

2.2.6 Idempotency Definition 2.2.6 Let * be a binary operation on set A. If for all x ∈ A,it holds that x*x = x, then * is said to be idempotent, or to satisfy the idempotent law. In HOL4, the condition for idempotency is formalized as

2.2.7 Identity Element Definition 2.2.7 Let * be a binary operation on set A. If an element el ∈ A satisfies el*x = x for all x ∈ A, then e1 is said to be a left identity for *. If an element er ∈ A satisfies x*er = x for all x ∈ A, then er is said to be a right identity for *. If an element e ∈ A is both a left identity and a right identity for *, then e is said to be an identity element for *. For an identity element e ∈ A, it obviously holds that e*x = x*e = x for all x ∈ A.

2.2 Operations and Properties

11

Theorem 2.2.1 Let * be a binary operation on set A. If there exists a left identity el for * in A, and a right identity er for * in A, then there is a unique identity element e for * with el = er = e. In HOL4, the condition for an element to be an identity element is formalized as

2.2.8 Zero Element Definition 2.2.8 Let * be a binary operation on set A. If an element θ l satisfies θ l*x=θ l for all x ∈ A, then θ l is said to be a left zero element for * in A. If an element θ r ∈ A satisfies x*θ r=θ r for all x ∈ A, then θ r is said to be a right zero element for * in A. If an element θ ∈ A is both a left zero element and a right zero element, then θ is said to be a zero element for * in A. For a zero element θ ∈ A, it obviously holds that θ *x=x*θ =θ for all x ∈ A. Theorem 2.2.2 Let * be a binary operation on A. If there exists a left zero element θ l for * in A, and a right zero element θ r for * in A, then there exists a unique zero element θ for * in A with θ l = θ r = θ . In HOL4, the condition for an element to be a zero element is formalized as

2.2.9 Inverse Element Definition 2.2.9 Let * be a binary operation on set A, e be the identity element for * in A, and a ∈ A. If there is b ∈ A such that b*a = e, then b is said to be the left inverse of a. If there is b ∈ A such that a*b = e, then b is said to be the right inverse of a. If some b ∈ A is both a left inverse of a and a right inverse of a, then b is said to be an inverse element of a. Obviously, if b is an inverse of a, then a is also an inverse of b. When a ∈ A has a unique inverse element, we denote this inverse element of a by a−1 .

12

2 Algebraic Systems

In HOL4, the conditions for left inverse, right inverse, and inverse elements are formalized as

In general, the left inverse of an element is not necessarily equal to the right inverse of the element. An element of the underlying set might have a left (resp. right) inverse without having a right (resp. left) inverse. Moreover, the left inverse (resp. right inverse) of an element is not necessarily unique.

2.3 Semi-groups Semi-groups are a specific kind of algebraic systems with concrete applications in formal languages and automata. Before giving the definition of semi-groups, we introduce the more general concept of groupoids.

2.3.1 Groupoids Definition 2.3.1 Let be an algebraic system, where S is the underlying set and * is a binary operation on S. If S is closed under *, then is said to be a groupoid.

2.3.2 Semi-groups Definition 2.3.2 Let be an algebraic system, where S is the underlying set and * is a binary operation on S. The algebraic system is said to be a semi-group if the following two conditions hold. (1) S is closed under * (2) * is associative. That is, for all x, y, z ∈ S, it holds that (x ∗ y) ∗ z = x ∗ (y ∗ z)

2.3 Semi-groups

13

In HOL4, the definition of semi-groups can be formalized as follows, using the previously introduced type alg

2.3.3 Monoids Definition 2.3.3 A semi-group that contains an identity element is said to be a monoid. A monoid whose binary operation is commutative is called a commutative monoid. When dealing with repeated additions or multiplications, the properties of commutative monoids are often used. In HOL4, the concept of commutative monoids is formalized as

For example, the algebraic system is a commutative monoid. This is because is a semi-group with the identity element 0, and the operation + is commutative. In addition, the algebraic systems , , and are all semi-groups with the identity element 1. Hence, all three algebraic systems are commutative monoids by the commutativity of ·. Theorem 2.3.1 Let be a monoid. Then, any two rows (resp. two columns) in the multiplication table for * (as shown in Table 2.1) are different.

2.4 Groups and Sub-groups Groups are an algebraic structure with a wide range of applications. The formalization of groups and the formal proofs of their properties are essential in the formal development of algebraic systems.

14

2 Algebraic Systems

Table 2.1 The multiplication table for *

* .. . a .. . b .. .

… … … … … …

e .. .



a .. .



b .. .









2.4.1 Groups Definition 2.4.1 Let be an algebraic system, where G is the underlying set and * is a binary operation on G. The algebraic system is said to be a group if all of the following conditions hold. (1) (2) (3) (4)

G is closed under * * is associative there is an identity element e ∈ G all elements in G have their inverse elements in G

To facilitate the formalization of the concept of groups, the following datatype is defined in HOL4.

The definition of groups is then formalized as

2.4 Groups and Sub-groups

15

Fig. 2.1 The set inclusion relationships between groupoids, semi-groups, monoids, and groups

2.4.2 Finite Groups Definition 2.4.2 Let be a group. If G is finite, then is said to be a finite group, and the number of elements in G is called the order of G. If G is infinite, then is said to be an infinite group. In HOL4, the definition of finite groups is formalized as

To briefly summarize the series of concepts related to groups, a groupoid is a non-empty set equipped with a binary operation under which the set is closed, a semi-group is a groupoid with an associative operation, a monoid is a semi-group with an identity element, and a group is a monoid where each element has an inverse element. Hence, we have the following set inclusion relationships as also illustrated in Fig. 2.1. set of groups ⊂ set of monoids ⊂ set of semi-groups ⊂ set of groupoids

2.4.3 Properties of Groups Theorem 2.4.1 There is no zero element in a finite group. Theorem 2.4.2 Let be a group. Then, for all a, x, y ∈ G, it holds that

16

2 Algebraic Systems

a∗ x = a∗ y ⇒ x = y

(2.1)

x∗ a = y∗ a ⇒ x = y

(2.2)

That is, the cancellation law is satisfied, with (2.1) representing left cancellation, and (2.2) representing right cancellation. In HOL4, the theorem above is formalized as

Theorem 2.4.3 Let be a group. Then, for all x ∈ G, it holds that (x −1 )−1 = x. In HOL4, this theorem is formalized as

Theorem 2.4.4 Let be a group. Then, for all x, y ∈ G, it holds that x−1 = y ⇒ x = y−1

(2.3)

x−1 = y ⇒ x∗ y = e

(2.4)

In HOL4, this theorem is formalized as

2.4.4 Sub-groups Definition 2.4.3 Let be a group, and S be a non-empty subset of G. If is a group, then is said to be a sub-group of . Theorem 2.4.5 Let be a group. If is a sub-group of , then the identity element of is also the identity element of .

2.4 Groups and Sub-groups

17

Definition 2.4.4 Let be a group, and a sub-group of . If S = {e} where e is the identity element of , or S = G, then is said to be a trivial sub-group of . In a later part of this chapter, we will provide a way of formalizing sub-groups in HOL4.

2.5 Abelian Groups and Cyclic Groups 2.5.1 Abelian Groups Definition 2.5.1 Let be a group. If the binary operation * is commutative, then the group is said to be an Abelian group, or a commutative group. In HOL4, the definition of Abelian groups is formalized as

The definition of finite Abelian groups is formalized as

2.5.2 The Power Operation In a group , the operation * is associative and G is closed under *. Hence, for arbitrary elements a1 , a2 , …, an of G, the expression a1 * a2 * … * an is well-formed and represents an element of G. Definition 2.5.2 Let be a group, and a be an element in G. We write an for a * a * … * a, where the number of a’s is n, which is a positive integer. The term an is called the nth power of a. This is extended to non-positive integers by a0 = e

(2.5)

 n a−n = a−1 (n is a positive integer)

(2.6)

18

2 Algebraic Systems

When studying the properties of groups, taking the power of a group element is a frequently used operation. In HOL4, the power operation is formalized as

Theorem 2.5.1 For all integers n and m, it holds that an ∗ am = an+m

(2.7)

(an )m = anm

(2.8)

In HOL4, this property is formalized as

The proof of this property can be performed using the definition of the power operation and the properties of integers.

2.5.3 Cyclic Groups Definition 2.5.3 Let be a group. If there is an element a ∈ G such that any element in G can be expressed as a power of a (that is, G = {ak | k is an integer}), then the group is called a cyclic group, and the element a is called a generator of the group. In HOL4, the definition of cyclic groups is formalized as

2.6 Homomorphism and Isomorphism

19

2.6 Homomorphism and Isomorphism In this section, we consider the ways two algebraic systems can correspond to each other – through homomorphism or through isomorphism.

2.6.1 Homomorphism Definition 2.6.1 Let and be two algebraic systems with the binary operations ✩ and * (generalization to n-ary operations is possible), and f be a mapping from A to B such that for all a1 ,a2 ∈ A, f(a1 ✩a2 )=f(a1 )*(a2 ) holds. Then the mapping f is said to be a homomorphism from to , and the algebraic system is said to be homomorphic to the algebraic system , which is denoted by A~B. In addition, the algebraic system is said to be a homomorphic image of the algebraic system . Here, f(A) is given by f(A)={x| x=f(a),a ∈ A} and f(A) is a subset of B. The correspondence of two algebraic systems under homomorphism is illustrated in Fig. 2.2.

Fig. 2.2 The homomorphism between two algebraic systems

20

2 Algebraic Systems

In HOL4, the concept of homomorphism is formalized as

It is worth pointing out that the homomorphisms from an algebraic system to another might not be unique.

2.6.2 Epimorphism, Monomorphism, and Isomorphism Definition 2.6.2 Let f be a homomorphism from to . If f is surjective, then f is said to be an epimorphism. If f is injective, then f is said to be a monomorphism. If f is bijective, then f is said to be an isomorphism, and and are said to be isomorphic, which is denoted by A ∼ = B. If two algebraic systems of different forms are isomorphic, then they are essentially the same algebraic system with different use of symbols. This allows for the investigation of algebras up to isomorphism. It is not difficult to see that the inverse of an isomorphism is also an isomorphism. In HOL4, the concept of isomorphism is formalized as

2.6.3 Endomorphism and Automorphism Definition 2.6.3 Let be an algebraic system. If f is a homomorphism from to itself, then f is said to be an endomorphism. If g is an isomorphism from to itself, then g is said to be an automorphism. In HOL4, the concepts of endomorphism and automorphism are formalized as

2.6 Homomorphism and Isomorphism

21

The condition that a group is a sub-group of another (as discussed in 2.4.4), can be formalized using the identity relation and the concept of homomorphism as

2.7 Rings and Fields In the previous sections, we have examined basic algebraic systems with one single binary operation—semi-groups, monoids, and groups. We now turn to algebraic systems with two binary operations. With two given algebraic systems and , it is not difficult to compose an algebraic system with both of the binary operations + and *. It is customary to call the operation + “addition” and to call the operation * “multiplication”. With addition and multiplication, the algebraic system of reals and the algebraic system of integers are among the ones with which most people are familiar. For all a, b, c ∈ R (resp. I), it holds that a × (b + c) = (a × b) + (a × c) and (b+c) × a=(b × a) + (c × a). That is, multiplication is distributive over addition.

2.7.1 Rings Definition 2.7.1 Let < A, +, *> be an algebraic system. This algebraic system is said to be a ring if all of the three conditions below hold. (1) is an Abelian group (2) is a semi-group (3) * is distributive over + The following theorem articulates the core properties of rings. Theorem 2.7.1 Let be a ring. Then, for all a, b, c ∈ A, it holds that (1) (2) (3) (4) (5)

a*θ =θ *a=θ a*(−b) = (−a)*b = −(a*b) (−a)*(−b) = a*b a*(b − c) = a*b − a*c (b − c)*a = b*a − c*a

In the above, θ is the identity element for +, −a is the inverse element of a for +, and a − b is written for a + (−b). We dispense with discussing the formalization of rings in HOL4, since it is analogous to the formalization of fields to be discussed next.

22

2 Algebraic Systems

2.7.2 Fields Definition 2.7.2 Let be an algebraic system. This algebraic system is said to be a field if all of the following three conditions hold. (1) is an Abelian group (2) is an Abelian group (3) * is distributive over + To facilitate the formalization of fields in HOL4, the following data type is defined.

The addition operation in a field is formally defined by

The zero element of a field is formally defined by

The negation operation in a field (which is the inverse operation for addition) is formally defined by

The multiplication operation in a field is formally defined by

The identity element of a field is formally defined by

The reciprocal operation in a field (which is the inverse operation for multiplication) is formally defined by

2.7 Rings and Fields

23

The subtraction operation in a field is formally defined by

The division operation in a field is formally defined by

The set of non-zero elements is formally defined by

The concept of fields is formalized as

Furthermore, the concept of finite fields is formalized as

2.8 Summary In this chapter, we discussed the formalization of algebraic systems. We began with the core properties of the operations of algebraic systems. We then focused on the discussion of a few major algebraic structures and their properties, presenting the formalization of these algebraic structures and their properties in HOL4. The integration of our formalization into the libraries of HOL4 facilitates the formulation of

24

2 Algebraic Systems

abstract problems in this prover. Moreover, this integration eases the formal treatment of concrete problems sharing common characteristics by abstracting them into the same algebraic problem, benefiting the efficiency of problem solving. Through the formalization of algebraic structures, we also build up a rigorous framework for the modeling of mathematical theories.

Chapter 3

Complex Numbers

The theory of complex numbers underlies a great number of mathematical, physical, and engineering disciplines—control theory, signal analysis, quantum mechanics, relativity, fluid dynamics, etc. The formalization of complex numbers in HOL4 is a prerequisite for formalizing the core theories of all these disciplines in this theorem prover. In this chapter, we present a theory library of complex numbers in HOL4. We start with defining the data type for complex numbers. Then, we formalize and prove a series of theorems about groups, fields, and module algebraic systems. Afterwards, we discuss the concept of conjugate complex numbers and its relevant properties. We also formalize the polar form and the exponential form of complex numbers that are frequently the key simplifying factor in problem solving.

3.1 The Basic Definitions of Complex Numbers A complex number is in the form x + i y, where x and y are real numbers and i is a constant postulated to satisfy i2 = −1. Thus, the complex numbers are isomorphic to the pairs of real numbers. Based on the data types pair and real that already exist in HOL4, it is not difficult to define the type C of complex numbers using the type abbreviation R × R. A complex number a + i b can be represented as a pair (a, b) where a and b are elements of R. The functions and defined below are used to retrieve the real part and the imaginary part, respectively, of a complex number. Definition 3.1.1 ∀z ∈ C, R E z = F ST z Definition 3.1.2 ∀z ∈ C, I M z = S N D z

© Tsinghua University Press and Springer Nature Singapore Pte Ltd. 2020 Z. Shi et al., Formalization of Complex Analysis and Matrix Theory, https://doi.org/10.1007/978-981-15-7261-6_3

25

26

3 Complex Numbers

In the above, the projection functions FST and SND return the corresponding components of a pair. The function FST returns the first component, and the function SND returns the second. Hence, RE and IM are both of the type: C → R. Real numbers can be regarded as a subset of complex numbers. This is because each real number can be seen as a complex number with 0 as its imaginary part. Definition 3.1.3 ∀x ∈ R, complex_of_real x = (x, 0r) The suffix r in this definition indicates a real number. Specifically, the imaginary unit i is defined as Definition 3.1.4 i = (0r, 1r) Two complex numbers are equal if and only if both the real parts and the imaginary parts of them are equal. Theorem 3.1.1 (COMPLEX_RE_IM_EQ): ∀z, w ∈ C, (z = w) (R E z = R E w)/\(I M z = I M w) Theorem 3.1.1 can be proven using the definitions of RE and IM. |- val COMPLEX_RE_IM_EQ = store_thm("COMPLEX_RE_IM_EQ", ``!z w:complex. (z = w) (RE z = RE w) /\ (IM z = IM w)``; REWRITE_TAC[RE,IM, PAIR_FST_SND_EQ]);

Note that a theorem is started with a turnstile.

3.2 The Field of Complex Numbers In this section, the complex numbers are characterized as a field (see 2.7.2).

3.2.1 Basic Arithmetic Operations We overload the common operators for C and R.

3.2 The Field of Complex Numbers

27

Addition: Definition 3.2.1 ∀z, w ∈ C, z + w = (R E z + R E w, I M z + I M w) Additive inverse (negation): Definition 3.2.2 ∀z ∈ C, −z = (−R E z, −I M z) Multiplication: Definition 3.2.3 ∀z, w ∈ C, z ∗w = (R E z ∗ R E w − I M z ∗ I M w,R E z ∗ I M w + I M z ∗ R E w) Multiplicative inverse (reciprocal): Definition 3.2.4 ∀z ∈ C, inv z   −I M z/ (R E z)2 + (I M z)2

=



  R E z/ (R E z)2 + (I M z)2 ,

We set inv 0c = 0c as an extension of inv 0r = 0r in the library realTheory that already exists in HOL4 (where the suffix c indicates a complex number).

3.2.2 (C, +) is an Abelian Group Based on the definition of the addition of complex numbers, we verify that (C, +) is an Abelian group. The theorems below show that (C, +) is a group. Theorem 3.2.1 (COMPLEX_ADD_CLOSURE): ∀z, w ∈ C, z + w ∈ C Theorem 3.2.2 (COMPLEX_ADD_ASSOC): ∀z, w, v ∈ C, z + (w + v) = (z + w) + v Theorem 3.2.3 (COMPLEX_ADD_RID): ∀z ∈ C, z + 0c = z Theorem 3.2.4 (COMPLEX_ADD_LID): ∀z ∈ C, 0c + z = z Theorem 3.2.5 (COMPLEX_ADD_RINV): ∀z ∈ C, z + −z = 0c Theorem 3.2.6 (COMPLEX_ADD_LINV): ∀z ∈ C, −z + z = 0c In the above, the complex number 0c is the identity element of addition. It is not difficult to prove that the group (C, +) also satisfies the commutativity law, as is stated in the following theorem. Theorem 3.2.7 (COMPLEX_ADD_COMM): ∀z, w ∈ C, z + w = w + z Thus, (C, +) is shown to be an Abelian group.

28

3 Complex Numbers

3.2.3 (C−{0c}, *) is an Abelian Group The following properties of multiplication can be established, qualifying (C-{0c}, *) as a group. Theorem 3.2.8 (COMPLEX_MUL_CLOSURE): ∀z, w ∈ C, z ∗ w ∈ C Theorem 3.2.9 (COMPLEX_MUL_ASSOC): ∀z, w, v ∈ C, z ∗ (w ∗ v) = (z ∗ w) ∗ v Theorem 3.2.10 (COMPLEX_MUL_RID): ∀z ∈ C, z ∗ 1c = z Theorem 3.2.11 (COMPLEX_MUL_LID): ∀z ∈ C, 1c ∗ z = z Theorem 3.2.12 (COMPLEX_MUL_RINV): ∀z ∈ C, z 0c ==> z ∗inv z = 1c Theorem 3.2.13 (COMPLEX_MUL_LINV): ∀z ∈ C, z 0c ==> inv z ∗ z = 1c Here, the complex number 1c is the unit element of the multiplication, i.e., the unitary element. It is also not difficult to prove the following commutative condition. Theorem 3.2.14 (COMPLEX_MUL_COMM): ∀z, w ∈ C, z ∗ w = w ∗ z Thus, (C − {0c}, ∗) is shown to be an Abelian group.

3.2.4 (C, +, *) is a Field Theorem 3.2.15 (COMPLEX_ADD_LDISTRIB): ∀z, w, v ∈ C, z ∗ (w + v) = z∗w+z∗v Theorem 3.2.16 (COMPLEX_ADD_RDISTRIB): ∀z, w, v ∈ C, (z + w) ∗ v = z∗v+w∗v Combining this with what has been established above, (C, +, *) is shown to be a field. In addition, the subtraction operation of complex numbers can be defined using the addition and negation operators. Definition 3.2.5 ∀z, w ∈ C, z − w = z + (−w)

3.2 The Field of Complex Numbers

29

Similarly, the division operation of complex numbers can be defined using the multiplication and reciprocal operations. Definition 3.2.6 ∀z, w ∈ C, z/w = z ∗ inv w Many derived operations and properties of complex numbers can now be established. An example is the equation for the addition of two ratios (z/w + u/v = (z ∗ v + w ∗ u)/(w ∗ v)), denoted as COMPLEX_ADD_RAT. The following theorems are proven for the establishment of this equation. The distributivity of division over addition, denoted as COMPLEX_DIV_ADD, is proven by rewriting with the definition of division and the distributivity of multiplication over addition. |- val COMPLEX_DIV_ADD = store_thm("COMPLEX_DIV_ADD", ``!z w v :complex. z / v + w / v = (z + w) / v``, REWRITE_TAC[complex_div, GSYM COMPLEX_ADD_RDISTRIB]);

The properties about canceling the same factor in the operands of a division, denoted as COMPLEX_DIV_RMUL_CANCEL and COMPLEX_DIV_LMUL_CANCEL, can be formally established as follows. |- val COMPLEX_DIV_RMUL_CANCEL = store_thm ("COMPLEX_DIV_RMUL_CANCEL", ``!v:complex z w. ~(v = 0) ==> ((z * v) / (w * v) = z / w)``, RW_TAC bool_ss [complex_div] THEN Cases_on `w = 0` THEN RW_TAC bool_ss [COMPLEX_MUL_LZERO, COMPLEX_INV_0, COMPLEX_INV_MUL, COMPLEX_MUL_RZERO, COMPLEX_EQ_LMUL, GSYM COMPLEX_MUL_ASSOC] THEN DISJ2_TAC THEN ONCE_REWRITE_TAC [COMPLEX_MUL_COMM] THEN ONCE_REWRITE_TAC [GSYM COMPLEX_MUL_ASSOC] THEN RW_TAC bool_ss [COMPLEX_MUL_LINV, COMPLEX_MUL_RID]); |- val COMPLEX_DIV_LMUL_CANCEL = store_thm("COMPLEX_DIV_LMUL_CANCEL", ``!v:complex z w. ~(v = 0) ==> ((v * z) / (v * w) = z / w)``, METIS_TAC [COMPLEX_DIV_RMUL_CANCEL, COMPLEX_MUL_COMM]);

The property COMPLEX_ADD_RAT can now be proven using these theorems.

30

3 Complex Numbers val COMPLEX_ADD_RAT = store_thm ("COMPLEX_ADD_RAT", ``!z:complex w u v. ~(w = 0) /\ ~(v = 0) ==> (z / w + u / v = (z * v + w * u) / (w * v))``, RW_TAC bool_ss [GSYM COMPLEX_DIV_ADD, COMPLEX_DIV_RMUL_CANCEL, COMPLEX_DIV_LMUL_CANCEL]);

3.3 R-Module In practice, expressions are often formed with the scalar multiplication of complex numbers. Examples are r*(cos(θ ) + i*sin(θ )) and r*ei*θ . The operands of the scalar multiplication are in R and C, respectively, and the result is C. The scalar multiplication of complex numbers has two styles, with the scalar value on the left, and on the right, respectively. The symbol “*” is overloaded to represent this operation. Definition 3.3.1 ∀k ∈ R, z ∈ C, k ∗ z = (k ∗ R E z, k ∗ I M z) Definition 3.3.2 ∀k ∈ R, z ∈ C, z ∗ k = (R E z ∗ k, I M z ∗ k) Based on these two definitions, the following theorems can be verified. Theorem 3.3.1 (COMPLEX_ADD_SCALAR_LMUL): ∀a ∈ R, z, w ∈ C, a ∗ (z + w) = a ∗ z + a ∗ w Theorem 3.3.2 (COMPLEX_SCALAR_LMUL_ADD): ∀a, b ∈ R, z ∈ C, (a + b) ∗ z = a ∗ z + b ∗ z Theorem 3.3.3 (COMPLEX_SCALAR_LMUL): ∀a, b ∈ R, z ∈ C, a ∗ (b ∗ z) = (a ∗ b) ∗ z Theorem 3.3.4 (COMPLEX_SCALAR_LMUL_ONE): ∀z ∈ C, 1r ∗ z = z

3.3 R-Module

31

Because the set R of real numbers is a ring with unitary element 1, and it is shown in Sect. 3.2.2 that (C, +) is an Abelian group, the theorems presented above ensure that the set C of complex numbers is a left R-module. The scalar multiplication is commutative. Theorem 3.3.5 (COMPLEX_SCALAR_MUL_COMM): ∀k ∈ R, z ∈ C, z ∗ k = k∗z Hence, the set C is a right R-module. Therefore, C is an R-module. The scalar multiplication of complex numbers is the basis of the polar form of complex numbers, and this operation is frequently used in the remaining part of this chapter. Below, we formalize an interesting property about the reciprocal of the scalar multiplication. |-val COMPLEX_INV_SCALAR_LMUL = store_thm("COMPLEX_INV_SCALAR_LMUL", ``!k:real z:complex. k 0 /\ z 0 ==> (inv (k * z) = inv k * inv z)``, REWRITE_TAC [COMPLEX_0_THM, complex_inv,complex_scalar_lmul,RE,IM, POW_MUL, GSYM REAL_ADD_LDISTRIB, real_div, REAL_INV_MUL] THEN REPEAT STRIP_TAC THEN `k pow 2 0` by RW_TAC real_ss[POW_2, REAL_ENTIRE] THEN RW_TAC real_ss[REAL_INV_MUL] THEN `inv (k pow 2) = inv k * inv k` by RW_TAC real_ss[POW_2, REAL_INV_MUL] THEN ASM_REWRITE_TAC[REAL_MUL_ASSOC] THEN REWRITE_TAC[REAL_ARITH ``!a:real b:real c:real. a * b * c * c = c * a * b * c``] THEN RW_TAC real_ss[REAL_MUL_LINV,REAL_MUL_COMM]);

3.4 Complex Conjugate If the real parts of two complex numbers are equal and the imaginary parts are opposite, then the two complex numbers are the conjugate of each other. The complex conjugate is an important concept to complex numbers. It is used in the rationalization of complex numbers and for finding the amplitude of the polar form of a complex number. This concept is also involved in discussing important properties concerning complex numbers such as about the dot product of complex vectors. The complex conjugate is defined as follows Definition 3.4.1 ∀z ∈ C, con j z = (R E z, −I M z)

32

3 Complex Numbers

The complex conjugate can be visualized by two coordinates of the complex plane that are symmetric to the real axis. There are many interesting properties about complex conjugate. First, several computational properties of the complex conjugate are given. Theorem 3.4.1 (CONJ_ADD): ∀z, w ∈ C, con j(z + w) = con j z + con j w Theorem 3.4.2 (CONJ_NEG): ∀z ∈ C, con j(−z) = −con j z Theorem 3.4.3 (CONJ_SUB): ∀z, w ∈ C, con j(z − w) = con j z − con j w Theorem 3.4.4 (CONJ_MUL): ∀z, w ∈ C, con j(z ∗ w) = con j z ∗ con j w Theorem 3.4.5 (CONJ_INV): ∀z ∈ C, con j(inv z) = inv(con j z) Theorem 3.4.6 (CONJ_DIV): ∀z, w ∈ C, con j(z/w) = con j z/con j w Theorem 3.4.7 (CONJ_SCALAR_LMUL): ∀k ∈ R, z ∈ C, con j(k ∗ z) = k ∗ con j z The theorems above represent that for an algebraic operator f , ranging over negation, addition, subtraction, multiplication, and division, the conjugation operation is commutative, i.e., f (con j z) = con j f (z). The two additional properties of the complex conjugate, as shown below, are frequently used in the proofs. Theorem 3.4.8 (CONJ_CONJ): ∀z ∈ C, con j(con j z) = z Theorem 3.4.9 (COMPLEX_MUL_RCONJ):   ∀z ∈ C, z ∗ con j z = complex_o f _r eal (R E z)2 + (I M z)2 The formal establishment of these two properties in HOL4 is shown below. |- val CONJ_CONJ = store_thm("CONJ_CONJ", ``!z:complex. conj (conj z) = z``, REWRITE_TAC[conj, RE,IM,REAL_NEGNEG]); |- val COMPLEX_MUL_RCONJ = store_thm("COMPLEX_MUL_RCONJ", ``!z:complex. z * conj z = complex_of_real ((RE z) pow 2 + (IM z) pow 2)``, REWRITE_TAC [complex_mul, conj, complex_of_real, RE, IM, REAL_MUL_RNEG, REAL_SUB_RNEG] THEN PROVE_TAC [POW_2, REAL_MUL_COMM, REAL_ADD_LINV]);

3.5 Polar Form of Complex Numbers

33

3.5 Polar Form of Complex Numbers 3.5.1 Modulus and Argument In signal analysis and related fields, periodically varying signals can be described with complex numbers conveniently. In particular, the polar form of complex numbers has many advantages, including the simplification of multiplication, division and power of complex numbers. The polar form of a complex number is represented with a modulus and an argument. The modulus (absolute value) of a complex number corresponds to the distance between the origin point and the point corresponding to the complex number in the complex plane. Obviously, it is a non-negative real number.   Definition 3.5.1 ∀z ∈ C, modu z = sqr t (R E z)2 + (I M z)2 In this definition, sqrt is the function taking the square root of a real number. The main properties of the moduli of complex numbers are given below. Theorem 3.5.1 (MODU_NEG): ∀z ∈ C, modu(−z) = modu z Theorem 3.5.2 (MODU_CONJ): ∀z ∈ C, modu(con j z) = modu z Theorem 3.5.3 (MODU_MUL): ∀z, w ∈ C, modu(z ∗ w) = modu z ∗ modu w Theorem 3.5.4 (MODU_INV): ∀z ∈ C, z 0 ==> modu(inv z) = inv(modu z) Theorem 3.5.5 (MODU_DIV): ∀z, w ∈ C, w 0 ==> modu(z/w) = modu z/modu w Theorem 3.5.6 (MODU_SCALAR_LMUL): ∀k ∈ R, z ∈ C, modu(k ∗ z) = abs k ∗ modu z In Theorem 3.5.6, abs k is the absolute value of k, which is a real number. An interesting property (referred to as triangle inequality) is that the modulus of the sum of two arbitrary complex numbers is less than or equal to the sum of their modulus, where equality holds if and only if the principal values of their arguments are equal. Theorem 3.5.7 (MODU_TRIANGLE_INEQUALITY): ∀z, w ∈ C, modu (z + w) 0, there is a gauge δ such that for any δ-fine division, the usual Riemann-type sum approaches I closer than ε:   n     f (ti )(xi+1 − xi ) − I  < ε    i=0

The above reasoning shows that a derivative f  always has gauge integral f (b) − f (a) over the interval [a, b]; that is, the fundamental theorem of calculus holds. © Tsinghua University Press and Springer Nature Singapore Pte Ltd. 2020 Z. Shi et al., Formalization of Complex Analysis and Matrix Theory, https://doi.org/10.1007/978-981-15-7261-6_4

41

42

4 Gauge Integration

Definition 4.1.1 (the gauge integral). Let f: [a, b] → R be some function, and let b V be some number. We say that V is the gauge integral of f, written V = a f (t)dt, if for each ε > 0 there exists a corresponding function δ: [a, b] → (0, +∞) with the following property: whenever n is a positive integer,t0 , t1 , t2 , . . . , tn and s1 , s2 , . . . , sn are numbers that satisfy a = t0 ≤ s1 ≤ t1 ≤ s2 ≤ t2 ≤ · · · ≤ tn−1 ≤ sn ≤ tn = b n    f (si )(ti − ti−1 ) < ε. and ti − ti−1 < δ(si ) for all i, then V − i=1

Definition 4.1.1 is formalized in HOL4 as: |- !a b f k. Dint (a,b) f k !e. 0 < e ==> ?g. gauge (\x. a D n < D (SUC n)) /\ !n. n >= N ==> (D n = b);

Then, tdiv (a,b) (D,p) is given by division (a,b) D /\ !n. D n D (SUC n) - D n < g (p n);

where “dsize D” denotes the number of divisions of the interval divided by the division D:

4.1 The Gauge Integral and Its Properties

43

dsize D = @N. !n. n < N ==> D n < D (SUC n) /\ !n. n >= N ==> (D n = D N);

Overall,“Dint (a,b) f k” says that the integral of f on [a, b] is k. Then, we give the definitions of integrable and integral based on Definition 4.1.1. Definition 4.1.2 (integrable). Function f is integrable on interval [a, b] if and only if there exists a number i that satisfies Definition 4.1.1. This definition is formalized in HOL4 as integrable = |- !a b f. integrable (a,b) f ?i. Dint (a,b) f i;

Definition 4.1.3 (integral value). A function’s integral value is formalized as follows: integral = |- !a b f. integral (a,b) f = @i. Dint (a,b) f i;

The relation between the definitions is described in Theorems 4.1.1 and 4.1.2: Theorem 4.1.1 (INTEGRABLE_DINT). It holds that |- !f a b. integrable (a,b) f ==> Dint (a,b) f (integral (a,b) f);

Theorem 4.1.2 (DINT_INTEGRAL). It holds that |- !f a b i. a (integral (a,b) f = i);

We next formalize the operational properties of the gauge integral (Swartz 2001).

4.1.1 Linearity of the Gauge Integral In this subsection, the formalizations of the linear properties are presented after the respective mathematical expressions. Theorem 4.1.3 (DINT_CONST). The integral of a constant function is computed by: b cd x = c ∗ (b − a) a

44

4 Gauge Integration

The formalization is as follows: |- !a b c. Dint (a,b) (\x. c) (c * (b - a));

Theorem 4.1.4 (DINT_0). The integral of zero is zero: b 0d x = 0 a

The formalization is as follows: |- !a b. Dint (a,b) (\x. 0) 0;

Theorem 4.1.5 (DINT_NEG). The integral is negated when the function is negated: b

b f (x)d x = i ⇒

a

(− f (x))d x = −i a

The formalization is as follows: |- !f a b i. Dint (a,b) f i ==> Dint (a,b) (\x. -f x) (-i);

Theorem 4.1.6 (DINT_CMUL). The integral of the product of a function multiplied by a constant equals the product of the constant and the integral of the function: b

b f (x)d x = i ⇒

a

c ∗ f (x)d x = c ∗ i a

The formalization is as follows: |- !f a b c i. Dint (a,b) f i ==> Dint (a,b) (\x. c * f x) (c * i);

Theorem 4.1.7 (DINT_ADD). The integral of the sum of two functions is the sum of the integrals of the two functions: b

b f (x)d x = i ∧

a

b g(x)d x = j ⇒

a

( f (x) + g(x))d x = i + j a

4.1 The Gauge Integral and Its Properties

45

The formalization is as follows: |- !f g a b i j. Dint (a,b) f i /\ Dint (a,b) g j ==> Dint (a,b) (\x. f x + g x) (i + j);

Theorem 4.1.8 (DINT_SUB). The integral of the difference of two functions is the difference of the integrals of the two functions: b

b f (x)d x = i ∧

a

b g(x)d x = j ⇒

a

( f (x) − g(x))d x = i − j a

The formalization is as follows: |- !f g a b i j. Dint (a,b) f i /\ Dint (a,b) g j ==> Dint (a,b) (\x. f x - g x) (i - j);

Theorem 4.1.9 (DINT_LINEAR). The integral is linear: b

b f (x)d x = i ∧

a

b g(x)d x = j ⇒

a

(m ∗ f (x) + n ∗ g(x))d x = m ∗ i + n ∗ j a

The formalization is as follows: |- !f g a b i j. Dint (a,b) f i /\ Dint (a,b) g j ==> Dint (a,b) (\x. m * f x + n * g x) (m * i + n * j);

These theorems are proven based on the definition of the gauge integral.

4.1.2 Inequalities of the Gauge Integral Three inequalities of the gauge integral are formalized in this subsection. Theorem 4.1.10 (upper and lower bounds). An integrable function f over [a, b] is necessarily bounded on the interval. Thus, there are real numbers m and M so that m ≤ f (x) ≤ M for all x in [a, b]. Since the lower and upper sums of the function f over [a, b] are therefore bounded by, respectively, m(b − a) and M(b − a), it follows that

46

4 Gauge Integration

 m(b − a) ≤

b

f (x)d x ≤ M(b − a)

a

The formalization is as follows: INTEGRAL_MVT_LE: |- !f a b. a < b /\ (!x. a (f ' i = g i))

In the above, @f stands for a set. If FCP i exists, f  i must have a definite value. The sequence numbers of the elements are assumed to start from zero. Now, the basic operations on complex vectors can be straightforwardly defined in HOL4. Let us consider vector addition first. Definition 9.1.2 Vector addition |- x y i. (x + y) = FCP i. (x ' i + y ' i))

The term on the left-hand side of the equation means that + is a binary operation. The term on the right-hand side transforms the addition of two vectors into the addition of two complex numbers. Other operations on complex vectors, such as subtraction, multiplication and negation, can be defined in the same way. The basic properties of the complex vector addition are given as follows. Theorem 9.1.1 Basic properties of vector addition CVECTOR_ADD_SYM = |- !x y. x + y = y + x CVECTOR_ADD_ASSOC = |- !x y z. x + (y + z) = x + y + z CVECTOR_ADD_LDISTRIB = |- c x y. c * (x + y) = c * x + c * y CVECTOR_ADD_LID = |- !x. cvec 0 + x = x

In addition, we give the definitions of three iterative operations: CSUM, CPRODUCT and CVSUM. Definition 9.1.3 Iterative operations |- CSUM = ITERATE (( + ):complex->complex->complex) |- CPRODUCT = ITERATE (( * ):complex->complex->complex) |- !s f. CVSUM s f = FCP i. CSUM s (\x. f x ' i)

9.1 Complex Vector Spaces

137

Here, CSUM is the operation for iterative summation, which adds all the elements of a complex vector together. CPRODUCT is the operation for iterative multiplication, which multiplies all the elements of a complex vector together one by one. The operation CVSUM is used to add all the vectors of a set. In HOL4, two other operations, clift and cdrop, are also widely used to deal with complex numbers and vectors. The operation cdrop transforms a complex number into a one-dimensional vector, while the operation clift has the opposite effect. These two operations are defined as follows. Definition 9.1.4 Lift and drop with complex numbers |- !x. (clift:complex->complex[unit]) x = FCP i. x |- !x. (cdrop:complex[unit]->complex) x = x ' 0

9.2 Complex Inner-Product Spaces 9.2.1 Linear Spaces and Linear Functions The concept of linear spaces is formalized as follows. Definition 9.2.1 The space s is a complex linear subspace, iff |-!s:complex[‘a]->bool. csubspace s cvec 0 IN s /\ (!x y. x IN s /\ y IN s ==> x + y IN s) /\ !c x. x IN s ==> c * x IN s

Using the definition above, we can prove that a complex vector space is a csubspace, i.e., csubspace_univ = |- csubspace univ(:complex['n])

Next, the concepts of linear and anti-linear functions are formalized. Definition 9.2.2 Function f is a linear function on space s, iff |- !f s. clinear (f :complex['m] -> complex['n]) (s :complex['m] -> bool) csubspace s /\ !x y c. x IN s /\ y IN s ==> (f (x + y) = f x + f y) /\ (f (c * x) = c * f x)

138

9 Inner-Product Spaces

Definition 9.2.3 Function f is an anti-linear function on space s, iff |- !f s. antilinear (f :complex['m] -> complex['n]) (s :complex['m] -> bool) csubspace s /\ !x y c. x IN s /\ y IN s ==> (f (x + y) = f x + f y) /\ (f (c * x) = conj c * f x)

Based on the definitions of linear and anti-linear functions, it is straightforward to formalize the concept of sesquilinear functions. A sesquilinear function in a complex vector space V is a map of the form: V × V → V . Each sesquilinear function has two arguments, one being a linear function and the other being an anti-linear one. Definition 9.2.4 Function f is a sesquilinear map in space s, only if |- !f s. sesquilinear f s csubspace s /\ (!y. y IN s ==> clinear (\x. f x y) s) /\ !x. x IN s ==> antilinear (\y. f x y) s

A sesquilinear function in a complex vector space V has an alternative form: V × V → C, which can be formalized as |- !f s. sesquilinear_form f s csubspace s /\ sesquilinear (\x y. lift (f x y)) s

Next, the above definitions will be used to formalize the inner product, norm and other properties.

9.2.2 Inner Product An inner product space is a vector space, in which each pair of vectors can be multiplied together to yield a scalar quantity. Such a scalar quantity is called the inner product of the two corresponding vectors. For example, the dot product is a special inner product in Euclidean spaces. In this section, we will give the higher order logic formalization of the concept of inner product and its properties. Definition 9.2.5 An inner product in space V is a function that associates each ordered pair of vectors of V with a number. It has the following properties: (1) Conjugate symmetry (v, w) = w, v, v, w ∈ V ;

9.2 Complex Inner-Product Spaces

139

(2) Linearity wrt. the first element u + v, w = u, w + v, w, u, v, w ∈ V ; av, w = au, w, a ∈ F, v, w ∈ V ; (3) Non-negativity (v, v) ≥ 0, v ∈ V ; (4) Definiteness (v, v) = 0 i f f v = 0; Suppose F represents the complex domain, and the function f is of the type V × V → C. Then, the inner product of itself (f x x) will be a complex number. However, Definition 9.2.3 requires that (f x x) should be a real number. For this reason, we let its imaginary part be zero. This can be formalized as follows. |- !f s. innerprod f s csubspace s /\ !x y z. x IN s /\ y IN s /\ z IN s ==> (f x y = conj (f y x)) /\ (!c. f (c * x) y = c * f x y) /\ (f (x + y) z = f x z + f y z) /\ (IM (f x x) = 0) /\ 0 (f (cvec 0) x = 0) /\ (f x (cvec 0) = 0)

Theorem 9-2.4 An inner product is a sesquilinear map. |- innerprod f s ==> sesquilinear (\x y. lift (f x y)) s

If an inner-product space is complete, it is a Hilbert space. In fact, all the inner product spaces we discuss here are Hilbert spaces.

140

9 Inner-Product Spaces

Next, we give an example formalization of the theory of the Euclidean inner product in C n . Definition 9.2.6 The Euclidean inner product in C n (w1 , . . . , wn ), (z1 , . . . , zn ) = w2 z2 + · · · + wn zn and formally.

is

given

by

|- !x y. (x cdot y) = CSUM (count (dimindex (:'a))) (\i. x ' i * conj (y ' i))

Four properties of the Euclidean inner product are formalized and formally proven. Theorem 9.2.5 |- !x y. (x cdot y) = conj (y cdot x)

Theorem 9.2.6 |- !x y z. (x + y cdot z) = (x cdot z) + (y cdot z)

Theorem 9.2.7 |- !c x y. (c * x cdot y) = c * (x cdot y)

Theorem 9.2.8 cdot is an inner product in C n |- innerprod (\x y. x cdot y) univ(:complex['n])

Proof. To prove this theorem, we use innerprod_def to expand the goal into seven sub-goals. It is straightforward to prove the first five sub-goals using Theorem 9.2.4. Only two sub-goals, 0 ≤ R E (x · x) and (x = 0) = ((x cot x) = 0), remain. We can prove the first sub-goal using the lemmas  (∀x. x ∈ s => (0 !i. i < dimindex (:’n) ==> (RE (x ‘ i) pow 2 + IM (x ‘ i) pow 2 = 0). Finally, we prove this by matching it with the lemma |- !f n. (!p. p < n ==> 0 !p. p < n ==> (f p = 0).

9.2 Complex Inner-Product Spaces

141

9.2.3 Norm Norm is a mathematical concept widely used in linear algebra, functional analysis, and related mathematical fields. A space can be regarded as a normed linear space on the condition that each non-zero vector is associated with a non-zero length. A norm in a vector space V can be defined as a function p: V → R. It has the following properties: (1) Positive scalability For all a ∈ F and all u, v ∈ V, p(av) = |a| p(v), where F is a subspace in V. (2) Triangle inequality p(u + v) ≤ p(u) + p(v). (3) Positive definiteness If p(v) = 0 then v is a zero vector. (4) Positiveness It follows from the first property that p(0) = 0 and p(−v) = p(v). Combining this with the triangle inequality, one obtains p(v) ≥ 0. Definition 9.2.7 Norm in csubspace s |- !p s. gnorm p s csubspace s /\ !a u v. u IN s /\ v IN s ==> 0 (norm (cvec 0) f s = 0) |- !x. innerprod f s /\ x

s ==> (norm (~x) f s = norm x f s)

|- !x. innerprod f s /\ x

s ==> 0 modu (f x y) 0 /\ y > 0. Hence, we can construct the following sub-goal:   ¯ − αy, y = x 2 − αx, y x − αy, x − αy = x − αy, x − αx   − α¯ x, y − α2 y 2 = x 2 − |x, y|2 · y −2 where α  y −2 · x, y. Then, the proof is complete simply because x − αy, x − αy ≥ 0.

9.2.4 Other Definitions Based on the definition of inner-product, we can define further quantities and operators that play vital roles in the theory of complex spaces.

9.2 Complex Inner-Product Spaces

143

In a Euclidean plane, the angle θ between two vectors u and v is related to their dot product and their lengths by the formula U · V = cos θ U

V This formula provides an easy way to calculate the angle between two planes (or curved surfaces) by using their normal vectors and to determine the angle between two oblique lines based on their vector equations. In a complex inner product space, the cosine in the above formula may have non-real values. Therefore, it is revised as R EU, V  = cos θ U

V The angle in a complex space can be formalized in the following way. Definition 9.2.9 The angle between two non-zero vectors is defined as cos2 (x, y) =

x, yx, y x, xy, y

|- !x y f s. ANGLE x y f s = @theta. innerprod f s /\ x IN s /\ y IN s /\ x cvec 0 /\ y cvec 0 /\ (cos theta pow 2 = RE (f x y * f y x) * inv (norm x f s pow 2) * inv (norm y f s pow 2))

Then, the definition of orthogonality can be formalized as Definition 9.2.10 Two vectors are orthogonal to each other, iff x, y = 0 |- !x y f s. corthogonal x y f s innerprod f s /\ x IN s /\ y IN s /\ (f x y = 0)

Based on the definition of orthogonality, we can also define the orthonormal bases and Gram-Schmidt transform of complex vectors. Although the proof is involved, it can be completed step-by-step in a Euclidean space.

144

9 Inner-Product Spaces

Definition 9.2.11 T is a unitary transformation, iff x, y = Tx, Ty. |- !t f s. UNITARY_TRANS t f s !x. innerprod f s /\ x IN s /\ (f x x = f (t x) (t x))

Definition 9.2.12 T is a Hermitian transformation, iff Tx, y = x, Ty. |- !t f s. HERMITIAN_TRANS t f s !x. innerprod f s /\ x IN s /\ (f (t x) x = f x (t x))

9.3 Transformation in a Finite Dimensional Linear Space In this section, we formalize the transforms and their properties in a finite dimensional linear space. Assume that T maps a linear space V to itself. For any x ∈ V, if only a single vector y corresponds to it, then T is called a transformation or an operator of V. Such a transformation is written as T x = y. Because a transformation in a linear space with a given set of bases can be expressed by a matrix, we represent all the transformations and their properties in the form of matrices. A complex matrix can be regarded as an extension of a Cartesian product. Hence, we use “A:complex[ n][ m]” to represent a complex matrix Am×n , which is equal to (RN )M . The commonly used complex matrix operations, including addition, subtraction, multiplication, inversion, scalar multiplication, and vector multiplication, can be formalized in a way similar to the formalization of vector operations. Here, we use matrix addition as an illustrative example. Definition 9.3.1 Matrix addition |- !A B. A + B = FCP i j. A ' i ' j + B ' i ' j

Furthermore, four additive properties are formalized as follows. Theorem 9.3.1 (1) Commutativity |- !A B. A + B = B + A

(2) Associativity |- !A B C. A + (B + C) = A + B + C

9.3 Transformation in a Finite Dimensional Linear Space

145

(3) Left distributivity for vector multiplication |- !x A B. x ** (A + B) = x ** A + x ** B

(4) Left inverse unit |- !A. CMAT 0 + A = A

Next, we formalize a few special matrices and their properties. Definition 9.3.2 Inverse matrix |- !A. CMATRIX_INV A = @A'. (A ** A' = CMAT 1) /\ (A' ** A = CMAT 1)

Here, CMAT 1 represents a unit matrix. Definition 9.3.3 A is a Hermitian matrix, iff A = A* |- !A. HERMITIAN A (A = CONJ_TRANS A)

Theorem 9.3.2 The following statement holds. |- !A B. (A ** B = B ** A) /\ HERMITIAN A /\ HERMITIAN B ==> HERMITIAN (A ** B)

Theorem 9.3.3 The following statement holds. |- !A. NORMAL A (CONJ_TRANS A ** A = A ** CONJ_TRANS A)

Definition 9.3.4 A is a normal matrix, iff AA* = A*A. |- !A. NORMAL A (CONJ_TRANS A ** A = A ** CONJ_TRANS A)

Definition 9-3.5 A is a unitary matrix, iff AA* =A*A = I. |- !A. UNITARY A (CONJ_TRANS A ** A = CMAT 1 /\ A ** CONJ_TRANS A = CMAT 1)

146

9 Inner-Product Spaces

Theorem 9.3.4 A is a unitary matrix and AB = BA; then |det(A)| = 1. |- !A. UNITARY A ==> CDET A = 1

Definition 9.3.6 Eigenvalue of a matrix |- !A. EIGENVALUE A = @k. ?x. x cvec 0 /\ (A ** x = k * x) |- !A k. EIGENVECTOR A k = @x. x cvec 0 /\ (A ** x = k * x) |- !A. EIGENPOLY A = (\k. CDET (k * CMAT 1 - A))

The definitions above can be re-formulated as mapping transformation via orthonormal bases. Definition 9.3.7 The norm of a complex matrix |- !p. cmatrix_norm p !a A B. 0