Use natural deduction with labelled temporary assumptions. Assume under label , then under label , then under label . Two applications of the modus ponens rule give and . The negation elimination rule gives , and the supplied reductio ad absurdum rule discharges to conclude .
Discharge using the implication introduction rule, obtaining under . Discharge with the implication introduction rule, obtaining
All three temporary assumptions have now been discharged; no premise remains.
The reduced row echelon form gives , , and . Taking gives every vector in the null space as . Thus a basis for the kernel of the linear map is
Direct multiplication gives . The rank-nullity theorem also checks the count: matrix rank three plus nullity one equals the domain dimension four.
Gaussian elimination gives the row operations , , , producing the lower three rows , , . Subtract the new row two from row three and add three times row two to row four; the remaining nonzero row is . Move it above the zero row and finish elimination to obtain
The pivot columns are one, two and three. Row operations preserve the linear dependence relations among columns, so the corresponding columns of the original matrix form a basis for the column space, which is the image of the linear map:
In particular, the matrix rank is three. Columns of the reduced matrix itself would generally give a different subspace, so the original columns must be used.
The first left multiplication swaps rows three and four. The final right multiplication swaps columns three and four, restoring the two diagonal ones to their diagonal positions while exchanging the earlier entries of the two rows. Therefore
The two specified zeros at positions and are important. Conjugation by this permutation matrix preserves this restricted lower triangular pattern; it would not preserve lower triangularity for an arbitrary matrix with a nonzero entry.
The th column of is . The permutation matrix fixes and interchanges , so these columns are . They are exactly the first, second, fourth and third columns of . Thus right multiplication by interchanges columns three and four, leaving the others unchanged.
Left multiplication by interchanges rows three and four; applying it twice restores every row. Equivalently, it sends the standard basis vectors to each other and fixes , so its square fixes a basis. .
Let denote the matrix unit with one at position and zero elsewhere. The five inverses are
Thus each is the identity matrix with only the indicated off-diagonal matrix entry altered. These inverses reverse the corresponding row additions; no row scaling or permutation is involved.
The second pivot is two. Row three has second entry two, so subtract row two; row four has second entry minus two, so add row two. Therefore , . Their trailing row pairs become and , respectively; the zero in the third pivot position is why a later row interchange is needed.
Left multiplication by an elementary matrix adds a multiple of row one to its designated target row. The first-column entries below the pivot are , so , , . The corresponding row operations are , , and . Since none changes row one, their sequential application gives the required three eliminated first-column entries and the displayed remaining entries.
Repeatedly applying the previous product rule gives
Formally, the result holds for ; multiplication by preserves the zero off-diagonal matrix entries and multiplies each diagonal matrix entry by , proving the induction step.
By matrix multiplication, . A potentially nonzero term requires because is a diagonal matrix, and because is a diagonal matrix. For these requirements cannot both hold. Thus every summand is zero and whenever .
One base-class implementation changes the private fields directly:
def flip(): Unit = {
  val oldH = _h
  _h = _w
  _w = oldH
}
The completed operation leaves the area unchanged. It calls no overriding setters, so the logging subclass's count stays unchanged and does not need an override. The invariant is about completed public updates, not transient internal states between the two assignments.
A second implementation uses public setters:
def flip(): Unit = {
  val oldH = height
  val oldW = width
  height = oldW
  width = oldH
}
These setter calls use dynamic dispatch on a logging receiver. Starting at height two and width three, the first call increases the temporary area from six to nine and wrongly increments the count, while the final area returns to six. This version needs a subclass override. With the counter name from part (i), the following override discards the internal setter contributions:
override def flip(): Unit = {
  val before = increases
  super.flip()
  increases = before
}
For this specified base implementation the two assignments complete normally and the final area equals the initial area, so restoring the saved count is correct. Another design could suppress logging during the compound operation. The difference between the two base implementations illustrates the fragile base class problem: an internal refactoring can change subclass behavior through newly introduced virtual calls.
Compare areas before and after each completed setter call. Widen before multiplication so all products of two Int dimensions are represented exactly:
class LoggedResizableFrame(h: Int, w: Int) extends ResizableFrame(h, w) {
  private var increases = BigInt(0)

  private def actualArea: Long = height.toLong * width.toLong

  override def height_=(h: Int): Unit = {
    val before = actualArea
    super.height_=(h)
    if (actualArea > before) increases += 1
  }

  override def width_=(w: Int): Unit = {
    val before = actualArea
    super.width_=(w)
    if (actualArea > before) increases += 1
  }

  def getIncreases: BigInt = increases
}
The history invariant is that increases counts exactly the completed dimension updates whose new area strictly exceeds their immediately preceding area. The constructor's starting area is a baseline, not an increase. Each overriding setter invokes the superclass setter once and increments precisely when its comparison succeeds. Equal-area changes do not count. The comparison is on area, not merely on which dimension increased; this also handles zero or signed dimensions without adding an unstated input restriction. An arbitrary-precision integer avoids eventual counter overflow.
Make defensive copies on both entry and exit, while keeping the supplied Dimension class unchanged:
class Frame(d: Dimension) {
  require(d != null)
  private val saved = new Dimension(d.width, d.height)
  private val savedArea = saved.width * saved.height

  def area: Int = savedArea
  def dimension: Dimension = new Dimension(saved.width, saved.height)
  def isPortrait: Boolean = saved.height >= saved.width
}
The private stored dimensions have no aliases exposed to the caller and are never changed. Mutating the constructor argument affects only the caller's object; mutating a returned Dimension affects only a fresh copy. Consequently the stored area is calculated once and stays equal to the stored dimensions' product. This defensive copying is sufficient because Dimension contains only primitive fields; a more deeply nested mutable structure could require a deep copy or an immutable representation.
The multiplication above deliberately retains the supplied class's Int arithmetic and accessor type. If an exact mathematical area outside that range is required, compute once with saved.width.toLong * saved.height.toLong and expose Long instead; avoiding aliases and avoiding integer overflow are separate concerns.
The constructor stores a reference, not a copy:
val d = new Dimension(3, 4)
val f = new Frame(d)
d.width = 10
Now f.area is still , but the product of its stored dimension fields is . Even without retaining d, a client can break the same invariant through f.dimension.height = 9, because the accessor exposes the same mutable object. This is representation exposure through reference aliasing. A val prevents reassigning the reference; it does not freeze the referenced object.
Class inheritance defines a subclass by extending another class's behavior, often with method overriding and subtyping. An editor might have an abstract Command type with execute, and subclasses for insertion and deletion. The controller keeps commands through the common type and dynamic dispatch chooses each command's actual operation. Alternatively, a specialized document can extend a base document's documented behavior. An inheritance relationship used for substitution must preserve the superclass contract; borrowing its code alone does not justify exposing incompatible behavior. Commands exemplify the Command pattern without exposing document storage to the controller.

Pinned article: Introduction to the OurBigBook Project

Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
We have two killer features:
  1. topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculus
    Articles of different users are sorted by upvote within each article page. This feature is a bit like:
    • a Wikipedia where each user can have their own version of each article
    • a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
    This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.
    Figure 1.
    Screenshot of the "Derivative" topic page
    . View it live at: ourbigbook.com/go/topic/derivative
  2. local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:
    This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
    Figure 5. . You can also edit articles on the Web editor without installing anything locally.
    Video 3.
    Edit locally and publish demo
    . Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.
  3. https://raw.githubusercontent.com/ourbigbook/ourbigbook-media/master/feature/x/hilbert-space-arrow.png
  4. Infinitely deep tables of contents:
    Figure 6.
    Dynamic article tree with infinitely deep table of contents
    .
    Descendant pages can also show up as toplevel e.g.: ourbigbook.com/cirosantilli/chordate-subclade
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact