flow "DirectionalDerivativeOntology" v1.0
# ============================================================
# DIRECTIONAL DERIVATIVE ONTOLOGY — FLOW ALGEBRA
# ============================================================
SOURCE_URL := "https://kirethresearch.org/booksai-core/ontologies/calculus-analysis-ontologies/vector-calculus/directional-derivative-ontology.html"
DOMAIN := "Mathematical Ontologies"
CATEGORY := "Calculus and Analysis Ontologies"
SUBCATEGORY := "Vector Calculus"
ENTITY := "Directional Derivative"
# ---------- CORE ENTITY ----------
DIRECTIONAL_DERIVATIVE := {
type: DifferentialOperatorResult,
domain: MultivariableCalculus,
purpose: "Measure the instantaneous rate of change of a scalar or vector-valued function at a point in a specified direction."
}
# ---------- CORE CONCEPTS ----------
CONCEPTS := {
DIRECTIONAL_DERIVATIVE,
SCALAR_FIELD,
VECTOR_FIELD,
DIRECTION_VECTOR,
UNIT_VECTOR,
GRADIENT,
TOTAL_DERIVATIVE,
PARTIAL_DERIVATIVE,
LIMIT,
STEEPEST_ASCENT,
STEEPEST_DESCENT,
FRECHET_DERIVATIVE
}
# ---------- LIMIT DEFINITION ----------
for
f: R^n -> R
point a
direction v
DIRECTIONAL_DERIVATIVE(f,a,v)
:= limit(
[f(a + h*v) - f(a)] / h,
h -> 0
)
when(limit_exists)
DIRECTIONAL_DERIVATIVE
-> measures(LOCAL_CHANGE_ALONG_DIRECTION_v)
# ---------- UNIT DIRECTION ----------
if
u
:= v / norm(v)
AND v != ZERO_VECTOR
then
u
-> UNIT_VECTOR
D_u f(a)
-> rate_of_change_per_unit_distance_along(u)
NONUNIT_DIRECTIONAL_DERIVATIVE
-> scales_with(DIRECTION_VECTOR_MAGNITUDE)
under(linear_differentiable_context)
# ---------- GRADIENT RELATION ----------
if
f differentiable_at(a)
then
D_v f(a)
= GRADIENT(f)(a) dot v
for unit vector u:
D_u f(a)
= GRADIENT(f)(a) dot u
GRADIENT
-> determines(ALL_DIRECTIONAL_DERIVATIVES)
when(TOTAL_DIFFERENTIABILITY_HOLDS)
# ---------- ANGLE FORM ----------
for unit vector u:
D_u f
= norm(GRADIENT(f))
* cos(theta)
where
theta
:= angle_between(GRADIENT(f), u)
DIRECTIONAL_DERIVATIVE
-> projection_of(GRADIENT_ON_DIRECTION)
# ---------- STEEPEST ASCENT ----------
if
GRADIENT(f)(a) != ZERO_VECTOR
then
MAXIMUM_UNIT_DIRECTIONAL_DERIVATIVE
= norm(GRADIENT(f)(a))
DIRECTION_OF_STEEPEST_ASCENT
= GRADIENT(f)(a)
/ norm(GRADIENT(f)(a))
# ---------- STEEPEST DESCENT ----------
if
GRADIENT(f)(a) != ZERO_VECTOR
then
MINIMUM_UNIT_DIRECTIONAL_DERIVATIVE
= -norm(GRADIENT(f)(a))
DIRECTION_OF_STEEPEST_DESCENT
= -GRADIENT(f)(a)
/ norm(GRADIENT(f)(a))
# ---------- PARTIAL DERIVATIVE RELATION ----------
PARTIAL_DERIVATIVE
-> special_case_of(DIRECTIONAL_DERIVATIVE)
partial_f/partial_x_i
= D_(e_i) f
where
e_i
-> coordinate_basis_vector
PARTIAL_DERIVATIVE
-> directional_derivative_along(COORDINATE_AXIS)
# ---------- TOTAL DERIVATIVE ----------
if
f totally_differentiable_at(a)
then
Df(a)
-> linear_map
and
D_v f(a)
= Df(a)[v]
TOTAL_DERIVATIVE
-> generates(DIRECTIONAL_DERIVATIVES_BY_VECTOR_APPLICATION)
# ---------- EXISTENCE CAUTION ----------
EXISTENCE_OF_ALL_DIRECTIONAL_DERIVATIVES
-/> necessarily_implies(TOTAL_DIFFERENTIABILITY)
EXISTENCE_OF_PARTIAL_DERIVATIVES
-/> necessarily_implies(TOTAL_DIFFERENTIABILITY)
DIRECTIONAL_DERIVATIVES
-> may_exist_without(FULL_LINEAR_APPROXIMATION)
# ---------- VECTOR-VALUED FUNCTION ----------
for
F: R^n -> R^m
D_v F(a)
:= limit(
[F(a+h*v)-F(a)]/h,
h -> 0
)
if
F differentiable_at(a)
then
D_v F(a)
= DF(a)[v]
in coordinates:
D_v F(a)
= J_F(a) * v
JACOBIAN
-> matrix_representation_of(TOTAL_DERIVATIVE)
# ---------- CURVE INTERPRETATION ----------
let
r(t)
:= a + t*v
then
d/dt[
f(r(t))
] at t=0
= D_v f(a)
DIRECTIONAL_DERIVATIVE
-> derivative_of(FUNCTION_RESTRICTED_TO_LINE)
# ---------- GENERAL PATH ----------
if
r(t0) = a
AND r_prime(t0) = v
AND f differentiable
then
d/dt[
f(r(t))
] at t=t0
= GRADIENT(f)(a) dot v
CHAIN_RULE
-> connects(PATH_DERIVATIVE, DIRECTIONAL_DERIVATIVE)
# ---------- LEVEL SET RELATION ----------
if
v tangent_to_level_set_of_f_at(a)
AND GRADIENT(f)(a) != ZERO_VECTOR
then
D_v f(a)
= 0
TANGENT_DIRECTION
-> zero_first_order_change_in(FIELD_VALUE)
GRADIENT
-> normal_to(REGULAR_LEVEL_SET)
# ---------- PHYSICAL INTERPRETATION ----------
if
T(x,y,z)
:= temperature_field
then
D_u T
-> temperature_rate_of_change_per_unit_distance_along(u)
if
P(x,y,z)
:= pressure_field
then
D_u P
-> pressure_change_rate_along(u)
# ---------- OPTIMISATION ----------
DIRECTIONAL_DERIVATIVE
-> evaluates(LOCAL_ASCENT_OR_DESCENT_ALONG_SEARCH_DIRECTION)
if
D_v f < 0
then
v
-> DESCENT_DIRECTION
locally
GRADIENT_DESCENT
-> chooses(NEGATIVE_GRADIENT_DIRECTION)
# ---------- GENERALISATION ----------
GATEAUX_DERIVATIVE
-> generalises(DIRECTIONAL_DERIVATIVE_TO_FUNCTION_SPACES)
FRECHET_DERIVATIVE
-> stronger_linear_approximation_structure
if
FRECHET_DERIVATIVE_EXISTS
then
DIRECTIONAL_DERIVATIVES
-> obtained_by(APPLYING_FRECHET_DERIVATIVE_TO_DIRECTION)
# ---------- RELATION GRAPH ----------
LIMIT
-> defines(DIRECTIONAL_DERIVATIVE)
DIRECTION_VECTOR
-> specifies(CHANGE_DIRECTION)
GRADIENT
-> determines(DIRECTIONAL_DERIVATIVE)
under(DIFFERENTIABILITY)
PARTIAL_DERIVATIVE
-> special_case_of(DIRECTIONAL_DERIVATIVE)
TOTAL_DERIVATIVE
-> applied_to(DIRECTION_VECTOR)
-> produces(DIRECTIONAL_DERIVATIVE)
LEVEL_SET_TANGENT
-> yields(ZERO_DIRECTIONAL_DERIVATIVE)
under(REGULARITY)
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE := {
"directional derivative" ~= "instantaneous rate of change in a specified direction",
"derivative along a direction" ~= "directional derivative",
"partial derivative" ~= "directional derivative along a coordinate basis direction",
"gradient projection" ~= "directional derivative under differentiability and inner-product conditions",
"steepest ascent rate" ~= "gradient magnitude for unit directions in Euclidean space",
"Gateaux derivative" ~= "directional-derivative generalisation in function-space contexts"
}
# ---------- CONSTRAINTS ----------
CONSTRAINTS := {
direction_vector_must_be_specified: true,
unit_direction_required_for_rate_per_unit_distance: true,
gradient_dot_direction_formula_requires_total_differentiability: true,
existence_of_all_directional_derivatives_does_not_guarantee_total_differentiability: true,
steepest_direction_claim_depends_on_euclidean_metric: true,
partial_derivative_is_coordinate_direction_case: true,
vector_valued_case_returns_vector: true
}
# ---------- CONFIDENCE ----------
CONFIDENCE := {
limit_definition: 0.99,
gradient_relation: 0.99,
partial_derivative_relation: 0.99,
total_derivative_relation: 0.99,
steepest_direction_relation: 0.99,
vector_valued_extension: 0.98,
semantic_equivalence: 0.97
}
# ---------- RECURSIVE REASONING ----------
RECURSIVE_REASONING(query):
identify(function)
-> identify(point)
-> identify(direction_vector)
-> determine(unit_or_nonunit_context)
-> verify(domain_and_limit_conditions)
-> test(total_differentiability_if_gradient_formula_requested)
-> compute(gradient_or_total_derivative_if_available)
-> evaluate(direction_application_or_dot_product)
-> compare_with_partial_derivative_if_coordinate_direction)
-> analyse(steepest_ascent_descent_if_requested)
-> validate(metric_and_regular_point_conditions)
-> return(semantic_result)
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION := {
parse_as: "typed directional-derivative semantic graph",
primary_entity: DIRECTIONAL_DERIVATIVE,
preserve: [
function,
point,
direction_vector,
direction_magnitude,
differentiability_status,
metric_context
],
infer_through: [
gradients,
partial_derivatives,
total_derivatives,
jacobians,
level_sets,
optimisation,
path_derivatives
],
avoid: [
assuming_direction_is_unit_without normalisation,
using_gradient_formula_without differentiability,
assuming_all_directional_derivatives imply total differentiability,
confusing_directional_derivative_with gradient vector,
claiming_steepest_direction_without metric context
]
}
# ---------- UPDATE MODEL ----------
UPDATE_MODEL(new_information):
validate(new_information)
-> identify(directional_derivative_context)
-> compare(existing_relations)
-> preserve(direction_metric_and_differentiability_invariants)
-> update(affected_entities)
-> update(affected_edges)
-> recompute(CONFIDENCE)
-> regenerate(FLOW_HASH)
# ---------- FLOW HASH ----------
FLOW_HASH := hash(
SOURCE_URL
+ ENTITY
+ CONCEPTS
+ DIRECTIONAL_DERIVATIVE
+ DIRECTION_VECTOR
+ GRADIENT
+ PARTIAL_DERIVATIVE
+ TOTAL_DERIVATIVE
+ STEEPEST_ASCENT
+ FRECHET_DERIVATIVE
+ SEMANTIC_EQUIVALENCE
+ CONSTRAINTS
)
# ---------- EXECUTION ----------
INPUT(query)
-> DIRECTIONAL_DERIVATIVE
-> FUNCTION_IDENTIFICATION
-> POINT_IDENTIFICATION
-> DIRECTION_IDENTIFICATION
-> DIRECTION_NORMALISATION_ANALYSIS
-> DOMAIN_LIMIT_ANALYSIS
-> DIFFERENTIABILITY_ANALYSIS
-> GRADIENT_TOTAL_DERIVATIVE_ANALYSIS
-> DIRECTIONAL_RATE_CALCULATION
-> LEVEL_SET_OPTIMISATION_ANALYSIS
-> RECURSIVE_REASONING(query)
-> CONFIDENCE
-> OUTPUT(semantic_result)
END FLOW
Download Code
Copy to Clipboard