Back to NPA

Module

Mathlib.Geometry.RightTriangle.Abstract

npa-mathlib

Packages

2

Module

63

Theorems

750

Declarations

1016

Untrusted sidecar

Source text and display overlays are presentation metadata. The signed certificate and checker result are the trusted evidence.

Theorems

7

Definitions

5

Inductive types

0

Axioms

0

Declarations

Perp

forall (Scalar : Sort u), forall (zero : Scalar), forall (Vector : Sort v), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (x : Vecto...

definition

RightTriangle

forall (Scalar : Sort u), forall (zero : Scalar), forall (Vector : Sort v), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarr...

definition

AngleRight

forall (PointCarrier : Sort p), forall (angle_right_rel : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Prop), forall (A : Po...

definition

Area2

forall (Scalar : Sort u), forall (PointCarrier : Sort p), forall (area2_op : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Sc...

definition

FootOnHypotenuse

forall (PointCarrier : Sort p), forall (foot_rel : forall (H : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Prop), forall (H : PointCarr...

definition

perp_iff_dot_eq_zero

forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (...

theorem

perp_symm

forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (...

theorem

right_triangle_legs_perp

forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (...

theorem

pythagorean_distance_sq_general

forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (...

theorem

law_of_cosines_general

forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (...

theorem

right_triangle_area_general

forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (...

theorem

median_to_hypotenuse_general

forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (...

theorem

Hashes

source
sha256:dda93a618ea737a9bfa9fe359deedcae08497bad08d5df2962ccb66dd076cc44
certificateFile
sha256:4ad51ace89ad52cc869e0793a7c9a29bee48c99fa05f259fa3df0218fc0cb8b7
export
sha256:1ed84dc5fb2771b39e9780daafa2d67d237875716091e1ceb9762f105adbe501
axiomReport
sha256:7715c06c634de0020345067c58ecf3bd23c10e71d84f4b97cd4c2e00e82c1a07
certificate
sha256:12c9b50e2bce346b793d58b483e71e74f68184ba77d54a7575f33360025b6841

Source

import Mathlib.Algebra.Ring.Basic
import Mathlib.Algebra.OrderedField.Basic
import Mathlib.Algebra.OrderedField.Square
import Mathlib.LinearAlgebra.VectorSpace
import Mathlib.LinearAlgebra.InnerProduct
import Mathlib.Geometry.Affine

def Perp.{u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (Vector : Sort v), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (x : Vector), forall (y : Vector), Prop :=
  fun Scalar => fun zero => fun Vector => fun inner => fun x => fun y => @PerpVec.{u,v} Scalar zero Vector inner x y

def RightTriangle.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (Vector : Sort v), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Prop :=
  fun Scalar => fun zero => fun Vector => fun inner => fun PointCarrier => fun disp_op => fun A => fun B => fun C => @Perp.{u,v} Scalar zero Vector inner (@disp.{p,v} PointCarrier Vector disp_op A B) (@disp.{p,v} PointCarrier Vector disp_op A C)

def AngleRight.{p} :
  forall (PointCarrier : Sort p), forall (angle_right_rel : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Prop), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Prop :=
  fun PointCarrier => fun angle_right_rel => fun A => fun B => fun C => angle_right_rel A B C

def Area2.{p,u} :
  forall (Scalar : Sort u), forall (PointCarrier : Sort p), forall (area2_op : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Scalar), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Scalar :=
  fun Scalar => fun PointCarrier => fun area2_op => fun A => fun B => fun C => area2_op A B C

def FootOnHypotenuse.{p} :
  forall (PointCarrier : Sort p), forall (foot_rel : forall (H : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Prop), forall (H : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Prop :=
  fun PointCarrier => fun foot_rel => fun H => fun B => fun C => foot_rel H B C

theorem perp_iff_dot_eq_zero.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (a : Scalar), Scalar), forall (sub : forall (a : Scalar), forall (b : Scalar), Scalar), forall (mul : forall (a : Scalar), forall (b : Scalar), Scalar), forall (le_rel : forall (a : Scalar), forall (b : Scalar), Prop), forall (Vector : Sort v), forall (vzero : Vector), forall (vadd : forall (x : Vector), forall (y : Vector), Vector), forall (vneg : forall (x : Vector), Vector), forall (smul : forall (a : Scalar), forall (x : Vector), Vector), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (x : Vector), forall (y : Vector), forall (R : Prop), forall (mk : forall (forward : forall (h : @Perp.{u,v} Scalar zero Vector inner x y), @Eq.{u} Scalar (@dot.{u,v} Scalar Vector inner x y) zero), forall (backward : forall (h : @Eq.{u} Scalar (@dot.{u,v} Scalar Vector inner x y) zero), @Perp.{u,v} Scalar zero Vector inner x y), R), R :=
  fun Scalar => fun zero => fun one => fun add => fun neg => fun sub => fun mul => fun le_rel => fun Vector => fun vzero => fun vadd => fun vneg => fun smul => fun inner => fun PointCarrier => fun disp_op => fun x => fun y => fun (R : Prop) => fun (mk : forall (forward : forall (h : @Perp.{u,v} Scalar zero Vector inner x y), @Eq.{u} Scalar (@dot.{u,v} Scalar Vector inner x y) zero), forall (backward : forall (h : @Eq.{u} Scalar (@dot.{u,v} Scalar Vector inner x y) zero), @Perp.{u,v} Scalar zero Vector inner x y), R) => mk (fun (h : @Perp.{u,v} Scalar zero Vector inner x y) => h) (fun (h : @Eq.{u} Scalar (@dot.{u,v} Scalar Vector inner x y) zero) => h)

theorem perp_symm.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (a : Scalar), Scalar), forall (sub : forall (a : Scalar), forall (b : Scalar), Scalar), forall (mul : forall (a : Scalar), forall (b : Scalar), Scalar), forall (le_rel : forall (a : Scalar), forall (b : Scalar), Prop), forall (Vector : Sort v), forall (vzero : Vector), forall (vadd : forall (x : Vector), forall (y : Vector), Vector), forall (vneg : forall (x : Vector), Vector), forall (smul : forall (a : Scalar), forall (x : Vector), Vector), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (law : forall (x : Vector), forall (y : Vector), forall (h : @Perp.{u,v} Scalar zero Vector inner x y), @Perp.{u,v} Scalar zero Vector inner y x), forall (x : Vector), forall (y : Vector), forall (h : @Perp.{u,v} Scalar zero Vector inner x y), @Perp.{u,v} Scalar zero Vector inner y x :=
  fun Scalar => fun zero => fun one => fun add => fun neg => fun sub => fun mul => fun le_rel => fun Vector => fun vzero => fun vadd => fun vneg => fun smul => fun inner => fun PointCarrier => fun disp_op => fun law => fun x => fun y => fun h => law x y h

theorem right_triangle_legs_perp.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (a : Scalar), Scalar), forall (sub : forall (a : Scalar), forall (b : Scalar), Scalar), forall (mul : forall (a : Scalar), forall (b : Scalar), Scalar), forall (le_rel : forall (a : Scalar), forall (b : Scalar), Prop), forall (Vector : Sort v), forall (vzero : Vector), forall (vadd : forall (x : Vector), forall (y : Vector), Vector), forall (vneg : forall (x : Vector), Vector), forall (smul : forall (a : Scalar), forall (x : Vector), Vector), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), forall (h : @RightTriangle.{p,u,v} Scalar zero Vector inner PointCarrier disp_op A B C), @Perp.{u,v} Scalar zero Vector inner (@disp.{p,v} PointCarrier Vector disp_op A B) (@disp.{p,v} PointCarrier Vector disp_op A C) :=
  fun Scalar => fun zero => fun one => fun add => fun neg => fun sub => fun mul => fun le_rel => fun Vector => fun vzero => fun vadd => fun vneg => fun smul => fun inner => fun PointCarrier => fun disp_op => fun A => fun B => fun C => fun h => h

theorem pythagorean_distance_sq_general.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (a : Scalar), Scalar), forall (sub : forall (a : Scalar), forall (b : Scalar), Scalar), forall (mul : forall (a : Scalar), forall (b : Scalar), Scalar), forall (le_rel : forall (a : Scalar), forall (b : Scalar), Prop), forall (Vector : Sort v), forall (vzero : Vector), forall (vadd : forall (x : Vector), forall (y : Vector), Vector), forall (vneg : forall (x : Vector), Vector), forall (smul : forall (a : Scalar), forall (x : Vector), Vector), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (pythagorean_sq_target : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), forall (h : @RightTriangle.{p,u,v} Scalar zero Vector inner PointCarrier disp_op A B C), @Eq.{u} Scalar (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op B C) (add (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A B) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A C))), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), forall (h : @RightTriangle.{p,u,v} Scalar zero Vector inner PointCarrier disp_op A B C), @Eq.{u} Scalar (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op B C) (add (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A B) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A C)) :=
  fun Scalar => fun zero => fun one => fun add => fun neg => fun sub => fun mul => fun le_rel => fun Vector => fun vzero => fun vadd => fun vneg => fun smul => fun inner => fun PointCarrier => fun disp_op => fun pythagorean_sq_target => fun A => fun B => fun C => fun h => pythagorean_sq_target A B C h

theorem law_of_cosines_general.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (a : Scalar), Scalar), forall (sub : forall (a : Scalar), forall (b : Scalar), Scalar), forall (mul : forall (a : Scalar), forall (b : Scalar), Scalar), forall (le_rel : forall (a : Scalar), forall (b : Scalar), Prop), forall (Vector : Sort v), forall (vzero : Vector), forall (vadd : forall (x : Vector), forall (y : Vector), Vector), forall (vneg : forall (x : Vector), Vector), forall (smul : forall (a : Scalar), forall (x : Vector), Vector), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (law : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), @Eq.{u} Scalar (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op B C) (sub (add (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A B) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A C)) (mul (@two.{u} Scalar one add) (@dot.{u,v} Scalar Vector inner (@disp.{p,v} PointCarrier Vector disp_op A B) (@disp.{p,v} PointCarrier Vector disp_op A C))))), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), @Eq.{u} Scalar (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op B C) (sub (add (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A B) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A C)) (mul (@two.{u} Scalar one add) (@dot.{u,v} Scalar Vector inner (@disp.{p,v} PointCarrier Vector disp_op A B) (@disp.{p,v} PointCarrier Vector disp_op A C)))) :=
  fun Scalar => fun zero => fun one => fun add => fun neg => fun sub => fun mul => fun le_rel => fun Vector => fun vzero => fun vadd => fun vneg => fun smul => fun inner => fun PointCarrier => fun disp_op => fun law => fun A => fun B => fun C => law A B C

theorem right_triangle_area_general.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (a : Scalar), Scalar), forall (sub : forall (a : Scalar), forall (b : Scalar), Scalar), forall (mul : forall (a : Scalar), forall (b : Scalar), Scalar), forall (le_rel : forall (a : Scalar), forall (b : Scalar), Prop), forall (Vector : Sort v), forall (vzero : Vector), forall (vadd : forall (x : Vector), forall (y : Vector), Vector), forall (vneg : forall (x : Vector), Vector), forall (smul : forall (a : Scalar), forall (x : Vector), Vector), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (area2_op : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), Scalar), forall (area_target : forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), forall (h : @RightTriangle.{p,u,v} Scalar zero Vector inner PointCarrier disp_op A B C), @Eq.{u} Scalar (@sq.{u} Scalar mul (@Area2.{p,u} Scalar PointCarrier area2_op A B C)) (mul (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A B) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A C))), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), forall (h : @RightTriangle.{p,u,v} Scalar zero Vector inner PointCarrier disp_op A B C), @Eq.{u} Scalar (@sq.{u} Scalar mul (@Area2.{p,u} Scalar PointCarrier area2_op A B C)) (mul (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A B) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A C)) :=
  fun Scalar => fun zero => fun one => fun add => fun neg => fun sub => fun mul => fun le_rel => fun Vector => fun vzero => fun vadd => fun vneg => fun smul => fun inner => fun PointCarrier => fun disp_op => fun area2_op => fun area_target => fun A => fun B => fun C => fun h => area_target A B C h

theorem median_to_hypotenuse_general.{p,u,v} :
  forall (Scalar : Sort u), forall (zero : Scalar), forall (one : Scalar), forall (add : forall (a : Scalar), forall (b : Scalar), Scalar), forall (neg : forall (a : Scalar), Scalar), forall (sub : forall (a : Scalar), forall (b : Scalar), Scalar), forall (mul : forall (a : Scalar), forall (b : Scalar), Scalar), forall (le_rel : forall (a : Scalar), forall (b : Scalar), Prop), forall (Vector : Sort v), forall (vzero : Vector), forall (vadd : forall (x : Vector), forall (y : Vector), Vector), forall (vneg : forall (x : Vector), Vector), forall (smul : forall (a : Scalar), forall (x : Vector), Vector), forall (inner : forall (x : Vector), forall (y : Vector), Scalar), forall (PointCarrier : Sort p), forall (disp_op : forall (A : PointCarrier), forall (B : PointCarrier), Vector), forall (midpoint_op : forall (A : PointCarrier), forall (B : PointCarrier), PointCarrier), forall (median_target : forall (M : PointCarrier), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), forall (h : @RightTriangle.{p,u,v} Scalar zero Vector inner PointCarrier disp_op A B C), forall (hm : @Eq.{p} PointCarrier M (@midpoint.{p} PointCarrier midpoint_op B C)), @Eq.{u} Scalar (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A M) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op B M)), forall (M : PointCarrier), forall (A : PointCarrier), forall (B : PointCarrier), forall (C : PointCarrier), forall (h : @RightTriangle.{p,u,v} Scalar zero Vector inner PointCarrier disp_op A B C), forall (hm : @Eq.{p} PointCarrier M (@midpoint.{p} PointCarrier midpoint_op B C)), @Eq.{u} Scalar (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op A M) (@distSqPoints.{p,u,v} Scalar Vector inner PointCarrier disp_op B M) :=
  fun Scalar => fun zero => fun one => fun add => fun neg => fun sub => fun mul => fun le_rel => fun Vector => fun vzero => fun vadd => fun vneg => fun smul => fun inner => fun PointCarrier => fun disp_op => fun midpoint_op => fun median_target => fun M => fun A => fun B => fun C => fun h => fun hm => median_target M A B C h hm